accounts/abi/abigen: fix generation of event struct fields in bindings

This commit is contained in:
Jared Wasinger 2025-02-09 18:15:27 -08:00
parent 9ab62d60f0
commit 868e3c6552
11 changed files with 29 additions and 51 deletions

View file

@ -155,10 +155,9 @@ var (
// {{$contract.Type}}{{.Normalized.Name}} represents a {{.Normalized.Name}} event raised by the {{$contract.Type}} contract.
type {{$contract.Type}}{{.Normalized.Name}} struct {
{{- range .Normalized.Inputs}}
{{- capitalise .Name}}
{{- else}} {{bindtype .Type $structs}}
{{- end }}
{{end}}
{{ capitalise .Name}}
{{- if .Indexed}} {{ bindtopictype .Type $structs}}{{- else}} {{ bindtype .Type $structs}}{{ end }}
{{- end}}
Raw *types.Log // Blockchain specific contextual infos
}

View file

@ -265,8 +265,7 @@ type CrowdsaleFundTransfer struct {
Backer common.Address
Amount *big.Int
IsContribution bool
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const CrowdsaleFundTransferEventName = "FundTransfer"

View file

@ -442,8 +442,7 @@ type DAOChangeOfRules struct {
MinimumQuorum *big.Int
DebatingPeriodInMinutes *big.Int
MajorityMargin *big.Int
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const DAOChangeOfRulesEventName = "ChangeOfRules"
@ -485,8 +484,7 @@ func (dAO *DAO) UnpackChangeOfRulesEvent(log *types.Log) (*DAOChangeOfRules, err
type DAOMembershipChanged struct {
Member common.Address
IsMember bool
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const DAOMembershipChangedEventName = "MembershipChanged"
@ -530,8 +528,7 @@ type DAOProposalAdded struct {
Recipient common.Address
Amount *big.Int
Description string
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const DAOProposalAddedEventName = "ProposalAdded"
@ -575,8 +572,7 @@ type DAOProposalTallied struct {
Result *big.Int
Quorum *big.Int
Active bool
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const DAOProposalTalliedEventName = "ProposalTallied"
@ -620,8 +616,7 @@ type DAOVoted struct {
Position bool
Voter common.Address
Justification string
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const DAOVotedEventName = "Voted"

View file

@ -56,8 +56,7 @@ type EventCheckerDynamic struct {
IdxDat common.Hash
Str string
Dat []byte
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const EventCheckerDynamicEventName = "dynamic"
@ -139,8 +138,7 @@ func (eventChecker *EventChecker) UnpackEmptyEvent(log *types.Log) (*EventChecke
type EventCheckerIndexed struct {
Addr common.Address
Num *big.Int
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const EventCheckerIndexedEventName = "indexed"
@ -182,8 +180,7 @@ func (eventChecker *EventChecker) UnpackIndexedEvent(log *types.Log) (*EventChec
type EventCheckerMixed struct {
Addr common.Address
Num *big.Int
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const EventCheckerMixedEventName = "mixed"
@ -225,8 +222,7 @@ func (eventChecker *EventChecker) UnpackMixedEvent(log *types.Log) (*EventChecke
type EventCheckerUnnamed struct {
Arg0 *big.Int
Arg1 *big.Int
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const EventCheckerUnnamedEventName = "unnamed"

View file

@ -98,8 +98,7 @@ func (nameConflict *NameConflict) UnpackGetRequest(data []byte) (Oraclerequest,
type NameConflictLog struct {
Msg *big.Int
Msg0 *big.Int
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const NameConflictLogEventName = "log"

View file

@ -90,8 +90,7 @@ func (numericMethodName *NumericMethodName) PackE2test() []byte {
// NumericMethodNameE1TestEvent represents a E1TestEvent event raised by the NumericMethodName contract.
type NumericMethodNameE1TestEvent struct {
Param common.Address
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const NumericMethodNameE1TestEventEventName = "_1TestEvent"

View file

@ -77,8 +77,7 @@ func (overload *Overload) PackFoo0(I *big.Int) []byte {
// OverloadBar represents a Bar event raised by the Overload contract.
type OverloadBar struct {
I *big.Int
I *big.Int
Raw *types.Log // Blockchain specific contextual infos
}
@ -119,9 +118,8 @@ func (overload *Overload) UnpackBarEvent(log *types.Log) (*OverloadBar, error) {
// OverloadBar0 represents a Bar0 event raised by the Overload contract.
type OverloadBar0 struct {
I *big.Int
J *big.Int
I *big.Int
J *big.Int
Raw *types.Log // Blockchain specific contextual infos
}

View file

@ -280,8 +280,7 @@ type TokenTransfer struct {
From common.Address
To common.Address
Value *big.Int
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const TokenTransferEventName = "Transfer"

View file

@ -143,12 +143,11 @@ func (tuple *Tuple) PackFunc3(Arg0 []TupleQ) []byte {
// TupleTupleEvent represents a TupleEvent event raised by the Tuple contract.
type TupleTupleEvent struct {
A TupleS
B [][2]TupleT
C [2][]TupleT
D []TupleS
E []*big.Int
A TupleS
B [][2]TupleT
C [2][]TupleT
D []TupleS
E []*big.Int
Raw *types.Log // Blockchain specific contextual infos
}
@ -190,8 +189,7 @@ func (tuple *Tuple) UnpackTupleEventEvent(log *types.Log) (*TupleTupleEvent, err
// TupleTupleEvent2 represents a TupleEvent2 event raised by the Tuple contract.
type TupleTupleEvent2 struct {
Arg0 []TupleP
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const TupleTupleEvent2EventName = "TupleEvent2"

View file

@ -212,8 +212,7 @@ type DBInsert struct {
Key *big.Int
Value *big.Int
Length *big.Int
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const DBInsertEventName = "Insert"
@ -255,8 +254,7 @@ func (dB *DB) UnpackInsertEvent(log *types.Log) (*DBInsert, error) {
type DBKeyedInsert struct {
Key *big.Int
Value *big.Int
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const DBKeyedInsertEventName = "KeyedInsert"

View file

@ -149,8 +149,7 @@ func (c *C) PackEmitOne() []byte {
type CBasic1 struct {
Id *big.Int
Data *big.Int
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const CBasic1EventName = "basic1"
@ -192,8 +191,7 @@ func (c *C) UnpackBasic1Event(log *types.Log) (*CBasic1, error) {
type CBasic2 struct {
Flag bool
Data *big.Int
Raw *types.Log // Blockchain specific contextual infos
Raw *types.Log // Blockchain specific contextual infos
}
const CBasic2EventName = "basic2"