mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-13 07:23:46 +00:00
accounts/abi/abigen: fix generation of event struct fields in bindings
This commit is contained in:
parent
9ab62d60f0
commit
868e3c6552
11 changed files with 29 additions and 51 deletions
|
|
@ -155,10 +155,9 @@ var (
|
||||||
// {{$contract.Type}}{{.Normalized.Name}} represents a {{.Normalized.Name}} event raised by the {{$contract.Type}} contract.
|
// {{$contract.Type}}{{.Normalized.Name}} represents a {{.Normalized.Name}} event raised by the {{$contract.Type}} contract.
|
||||||
type {{$contract.Type}}{{.Normalized.Name}} struct {
|
type {{$contract.Type}}{{.Normalized.Name}} struct {
|
||||||
{{- range .Normalized.Inputs}}
|
{{- range .Normalized.Inputs}}
|
||||||
{{- capitalise .Name}}
|
{{ capitalise .Name}}
|
||||||
{{- else}} {{bindtype .Type $structs}}
|
{{- if .Indexed}} {{ bindtopictype .Type $structs}}{{- else}} {{ bindtype .Type $structs}}{{ end }}
|
||||||
{{- end }}
|
{{- end}}
|
||||||
{{end}}
|
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -265,8 +265,7 @@ type CrowdsaleFundTransfer struct {
|
||||||
Backer common.Address
|
Backer common.Address
|
||||||
Amount *big.Int
|
Amount *big.Int
|
||||||
IsContribution bool
|
IsContribution bool
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const CrowdsaleFundTransferEventName = "FundTransfer"
|
const CrowdsaleFundTransferEventName = "FundTransfer"
|
||||||
|
|
|
||||||
15
accounts/abi/abigen/testdata/v2/dao.go.txt
vendored
15
accounts/abi/abigen/testdata/v2/dao.go.txt
vendored
|
|
@ -442,8 +442,7 @@ type DAOChangeOfRules struct {
|
||||||
MinimumQuorum *big.Int
|
MinimumQuorum *big.Int
|
||||||
DebatingPeriodInMinutes *big.Int
|
DebatingPeriodInMinutes *big.Int
|
||||||
MajorityMargin *big.Int
|
MajorityMargin *big.Int
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const DAOChangeOfRulesEventName = "ChangeOfRules"
|
const DAOChangeOfRulesEventName = "ChangeOfRules"
|
||||||
|
|
@ -485,8 +484,7 @@ func (dAO *DAO) UnpackChangeOfRulesEvent(log *types.Log) (*DAOChangeOfRules, err
|
||||||
type DAOMembershipChanged struct {
|
type DAOMembershipChanged struct {
|
||||||
Member common.Address
|
Member common.Address
|
||||||
IsMember bool
|
IsMember bool
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const DAOMembershipChangedEventName = "MembershipChanged"
|
const DAOMembershipChangedEventName = "MembershipChanged"
|
||||||
|
|
@ -530,8 +528,7 @@ type DAOProposalAdded struct {
|
||||||
Recipient common.Address
|
Recipient common.Address
|
||||||
Amount *big.Int
|
Amount *big.Int
|
||||||
Description string
|
Description string
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const DAOProposalAddedEventName = "ProposalAdded"
|
const DAOProposalAddedEventName = "ProposalAdded"
|
||||||
|
|
@ -575,8 +572,7 @@ type DAOProposalTallied struct {
|
||||||
Result *big.Int
|
Result *big.Int
|
||||||
Quorum *big.Int
|
Quorum *big.Int
|
||||||
Active bool
|
Active bool
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const DAOProposalTalliedEventName = "ProposalTallied"
|
const DAOProposalTalliedEventName = "ProposalTallied"
|
||||||
|
|
@ -620,8 +616,7 @@ type DAOVoted struct {
|
||||||
Position bool
|
Position bool
|
||||||
Voter common.Address
|
Voter common.Address
|
||||||
Justification string
|
Justification string
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const DAOVotedEventName = "Voted"
|
const DAOVotedEventName = "Voted"
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,7 @@ type EventCheckerDynamic struct {
|
||||||
IdxDat common.Hash
|
IdxDat common.Hash
|
||||||
Str string
|
Str string
|
||||||
Dat []byte
|
Dat []byte
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const EventCheckerDynamicEventName = "dynamic"
|
const EventCheckerDynamicEventName = "dynamic"
|
||||||
|
|
@ -139,8 +138,7 @@ func (eventChecker *EventChecker) UnpackEmptyEvent(log *types.Log) (*EventChecke
|
||||||
type EventCheckerIndexed struct {
|
type EventCheckerIndexed struct {
|
||||||
Addr common.Address
|
Addr common.Address
|
||||||
Num *big.Int
|
Num *big.Int
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const EventCheckerIndexedEventName = "indexed"
|
const EventCheckerIndexedEventName = "indexed"
|
||||||
|
|
@ -182,8 +180,7 @@ func (eventChecker *EventChecker) UnpackIndexedEvent(log *types.Log) (*EventChec
|
||||||
type EventCheckerMixed struct {
|
type EventCheckerMixed struct {
|
||||||
Addr common.Address
|
Addr common.Address
|
||||||
Num *big.Int
|
Num *big.Int
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const EventCheckerMixedEventName = "mixed"
|
const EventCheckerMixedEventName = "mixed"
|
||||||
|
|
@ -225,8 +222,7 @@ func (eventChecker *EventChecker) UnpackMixedEvent(log *types.Log) (*EventChecke
|
||||||
type EventCheckerUnnamed struct {
|
type EventCheckerUnnamed struct {
|
||||||
Arg0 *big.Int
|
Arg0 *big.Int
|
||||||
Arg1 *big.Int
|
Arg1 *big.Int
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const EventCheckerUnnamedEventName = "unnamed"
|
const EventCheckerUnnamedEventName = "unnamed"
|
||||||
|
|
|
||||||
|
|
@ -98,8 +98,7 @@ func (nameConflict *NameConflict) UnpackGetRequest(data []byte) (Oraclerequest,
|
||||||
type NameConflictLog struct {
|
type NameConflictLog struct {
|
||||||
Msg *big.Int
|
Msg *big.Int
|
||||||
Msg0 *big.Int
|
Msg0 *big.Int
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const NameConflictLogEventName = "log"
|
const NameConflictLogEventName = "log"
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,7 @@ func (numericMethodName *NumericMethodName) PackE2test() []byte {
|
||||||
// NumericMethodNameE1TestEvent represents a E1TestEvent event raised by the NumericMethodName contract.
|
// NumericMethodNameE1TestEvent represents a E1TestEvent event raised by the NumericMethodName contract.
|
||||||
type NumericMethodNameE1TestEvent struct {
|
type NumericMethodNameE1TestEvent struct {
|
||||||
Param common.Address
|
Param common.Address
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const NumericMethodNameE1TestEventEventName = "_1TestEvent"
|
const NumericMethodNameE1TestEventEventName = "_1TestEvent"
|
||||||
|
|
|
||||||
|
|
@ -77,8 +77,7 @@ func (overload *Overload) PackFoo0(I *big.Int) []byte {
|
||||||
|
|
||||||
// OverloadBar represents a Bar event raised by the Overload contract.
|
// OverloadBar represents a Bar event raised by the Overload contract.
|
||||||
type OverloadBar struct {
|
type OverloadBar struct {
|
||||||
I *big.Int
|
I *big.Int
|
||||||
|
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
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.
|
// OverloadBar0 represents a Bar0 event raised by the Overload contract.
|
||||||
type OverloadBar0 struct {
|
type OverloadBar0 struct {
|
||||||
I *big.Int
|
I *big.Int
|
||||||
J *big.Int
|
J *big.Int
|
||||||
|
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
3
accounts/abi/abigen/testdata/v2/token.go.txt
vendored
3
accounts/abi/abigen/testdata/v2/token.go.txt
vendored
|
|
@ -280,8 +280,7 @@ type TokenTransfer struct {
|
||||||
From common.Address
|
From common.Address
|
||||||
To common.Address
|
To common.Address
|
||||||
Value *big.Int
|
Value *big.Int
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const TokenTransferEventName = "Transfer"
|
const TokenTransferEventName = "Transfer"
|
||||||
|
|
|
||||||
14
accounts/abi/abigen/testdata/v2/tuple.go.txt
vendored
14
accounts/abi/abigen/testdata/v2/tuple.go.txt
vendored
|
|
@ -143,12 +143,11 @@ func (tuple *Tuple) PackFunc3(Arg0 []TupleQ) []byte {
|
||||||
|
|
||||||
// TupleTupleEvent represents a TupleEvent event raised by the Tuple contract.
|
// TupleTupleEvent represents a TupleEvent event raised by the Tuple contract.
|
||||||
type TupleTupleEvent struct {
|
type TupleTupleEvent struct {
|
||||||
A TupleS
|
A TupleS
|
||||||
B [][2]TupleT
|
B [][2]TupleT
|
||||||
C [2][]TupleT
|
C [2][]TupleT
|
||||||
D []TupleS
|
D []TupleS
|
||||||
E []*big.Int
|
E []*big.Int
|
||||||
|
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
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.
|
// TupleTupleEvent2 represents a TupleEvent2 event raised by the Tuple contract.
|
||||||
type TupleTupleEvent2 struct {
|
type TupleTupleEvent2 struct {
|
||||||
Arg0 []TupleP
|
Arg0 []TupleP
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const TupleTupleEvent2EventName = "TupleEvent2"
|
const TupleTupleEvent2EventName = "TupleEvent2"
|
||||||
|
|
|
||||||
|
|
@ -212,8 +212,7 @@ type DBInsert struct {
|
||||||
Key *big.Int
|
Key *big.Int
|
||||||
Value *big.Int
|
Value *big.Int
|
||||||
Length *big.Int
|
Length *big.Int
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const DBInsertEventName = "Insert"
|
const DBInsertEventName = "Insert"
|
||||||
|
|
@ -255,8 +254,7 @@ func (dB *DB) UnpackInsertEvent(log *types.Log) (*DBInsert, error) {
|
||||||
type DBKeyedInsert struct {
|
type DBKeyedInsert struct {
|
||||||
Key *big.Int
|
Key *big.Int
|
||||||
Value *big.Int
|
Value *big.Int
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const DBKeyedInsertEventName = "KeyedInsert"
|
const DBKeyedInsertEventName = "KeyedInsert"
|
||||||
|
|
|
||||||
|
|
@ -149,8 +149,7 @@ func (c *C) PackEmitOne() []byte {
|
||||||
type CBasic1 struct {
|
type CBasic1 struct {
|
||||||
Id *big.Int
|
Id *big.Int
|
||||||
Data *big.Int
|
Data *big.Int
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const CBasic1EventName = "basic1"
|
const CBasic1EventName = "basic1"
|
||||||
|
|
@ -192,8 +191,7 @@ func (c *C) UnpackBasic1Event(log *types.Log) (*CBasic1, error) {
|
||||||
type CBasic2 struct {
|
type CBasic2 struct {
|
||||||
Flag bool
|
Flag bool
|
||||||
Data *big.Int
|
Data *big.Int
|
||||||
|
Raw *types.Log // Blockchain specific contextual infos
|
||||||
Raw *types.Log // Blockchain specific contextual infos
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const CBasic2EventName = "basic2"
|
const CBasic2EventName = "basic2"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue