diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-01-05 18:39:24 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-01-24 16:54:13 +0800 |
commit | 1bf508b449ebd42653f521ada92c782e8cb664d2 (patch) | |
tree | 1895aeb44d68b189a40a4023ca4869b1f3d1b955 /accounts/abi/event.go | |
parent | 02aeb3d76652a4c0451e5c3734e6881aefe46249 (diff) | |
download | dexon-1bf508b449ebd42653f521ada92c782e8cb664d2.tar dexon-1bf508b449ebd42653f521ada92c782e8cb664d2.tar.gz dexon-1bf508b449ebd42653f521ada92c782e8cb664d2.tar.bz2 dexon-1bf508b449ebd42653f521ada92c782e8cb664d2.tar.lz dexon-1bf508b449ebd42653f521ada92c782e8cb664d2.tar.xz dexon-1bf508b449ebd42653f521ada92c782e8cb664d2.tar.zst dexon-1bf508b449ebd42653f521ada92c782e8cb664d2.zip |
accounts/abi/bind: support event filtering in abigen
Diffstat (limited to 'accounts/abi/event.go')
-rw-r--r-- | accounts/abi/event.go | 11 |
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 { |