accounts/abi/bind: support event filtering in abigen

This commit is contained in:
Péter Szilágyi
2018-01-05 12:39:24 +02:00
parent 02aeb3d766
commit 1bf508b449
25 changed files with 2524 additions and 1463 deletions

View File

@ -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 {