aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/abi/event.go
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/abi/event.go')
-rw-r--r--accounts/abi/event.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/accounts/abi/event.go b/accounts/abi/event.go
index 726bac90e..595f169f3 100644
--- a/accounts/abi/event.go
+++ b/accounts/abi/event.go
@@ -33,6 +33,17 @@ type Event struct {
Inputs Arguments
}
+func (event Event) String() string {
+ inputs := make([]string, len(event.Inputs))
+ for i, input := range event.Inputs {
+ inputs[i] = fmt.Sprintf("%v %v", input.Name, input.Type)
+ if input.Indexed {
+ inputs[i] = fmt.Sprintf("%v indexed %v", input.Name, input.Type)
+ }
+ }
+ return fmt.Sprintf("event %v(%v)", event.Name, strings.Join(inputs, ", "))
+}
+
// Id returns the canonical representation of the event's signature used by the
// abi definition to identify event names and types.
func (e Event) Id() common.Hash {