mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-16 20:01:37 +00:00
abigenv2: added a package-level error for event signature mismatch during unpacking
This commit is contained in:
parent
a61e5ccb1e
commit
3f63156b5c
11 changed files with 92 additions and 23 deletions
|
|
@ -177,6 +177,9 @@ var (
|
||||||
return {{$contract.Type}}{{.Normalized.Name}}EventName
|
return {{$contract.Type}}{{.Normalized.Name}}EventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Err{{.Normalized.Name}}SignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var Err{{.Normalized.Name}}SignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// Unpack{{.Normalized.Name}}Event is the Go binding that unpacks the event data emitted
|
// Unpack{{.Normalized.Name}}Event is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -184,7 +187,7 @@ var (
|
||||||
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) Unpack{{.Normalized.Name}}Event(log *types.Log) (*{{$contract.Type}}{{.Normalized.Name}}, error) {
|
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) Unpack{{.Normalized.Name}}Event(log *types.Log) (*{{$contract.Type}}{{.Normalized.Name}}, error) {
|
||||||
event := "{{.Original.Name}}"
|
event := "{{.Original.Name}}"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != {{ decapitalise $contract.Type}}.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != {{ decapitalise $contract.Type}}.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, Err{{.Normalized.Name}}SignatureMismatch
|
||||||
}
|
}
|
||||||
out := new({{$contract.Type}}{{.Normalized.Name}})
|
out := new({{$contract.Type}}{{.Normalized.Name}})
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
|
||||||
|
|
@ -354,6 +354,9 @@ func (CrowdsaleFundTransfer) ContractEventName() string {
|
||||||
return CrowdsaleFundTransferEventName
|
return CrowdsaleFundTransferEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrFundTransferSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrFundTransferSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackFundTransferEvent is the Go binding that unpacks the event data emitted
|
// UnpackFundTransferEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -361,7 +364,7 @@ func (CrowdsaleFundTransfer) ContractEventName() string {
|
||||||
func (crowdsale *Crowdsale) UnpackFundTransferEvent(log *types.Log) (*CrowdsaleFundTransfer, error) {
|
func (crowdsale *Crowdsale) UnpackFundTransferEvent(log *types.Log) (*CrowdsaleFundTransfer, error) {
|
||||||
event := "FundTransfer"
|
event := "FundTransfer"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != crowdsale.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != crowdsale.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrFundTransferSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(CrowdsaleFundTransfer)
|
out := new(CrowdsaleFundTransfer)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
|
||||||
25
accounts/abi/abigen/testdata/v2/dao.go.txt
vendored
25
accounts/abi/abigen/testdata/v2/dao.go.txt
vendored
|
|
@ -600,6 +600,9 @@ func (DAOChangeOfRules) ContractEventName() string {
|
||||||
return DAOChangeOfRulesEventName
|
return DAOChangeOfRulesEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrChangeOfRulesSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrChangeOfRulesSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackChangeOfRulesEvent is the Go binding that unpacks the event data emitted
|
// UnpackChangeOfRulesEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -607,7 +610,7 @@ func (DAOChangeOfRules) ContractEventName() string {
|
||||||
func (dAO *DAO) UnpackChangeOfRulesEvent(log *types.Log) (*DAOChangeOfRules, error) {
|
func (dAO *DAO) UnpackChangeOfRulesEvent(log *types.Log) (*DAOChangeOfRules, error) {
|
||||||
event := "ChangeOfRules"
|
event := "ChangeOfRules"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrChangeOfRulesSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(DAOChangeOfRules)
|
out := new(DAOChangeOfRules)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
@ -642,6 +645,9 @@ func (DAOMembershipChanged) ContractEventName() string {
|
||||||
return DAOMembershipChangedEventName
|
return DAOMembershipChangedEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrMembershipChangedSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrMembershipChangedSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackMembershipChangedEvent is the Go binding that unpacks the event data emitted
|
// UnpackMembershipChangedEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -649,7 +655,7 @@ func (DAOMembershipChanged) ContractEventName() string {
|
||||||
func (dAO *DAO) UnpackMembershipChangedEvent(log *types.Log) (*DAOMembershipChanged, error) {
|
func (dAO *DAO) UnpackMembershipChangedEvent(log *types.Log) (*DAOMembershipChanged, error) {
|
||||||
event := "MembershipChanged"
|
event := "MembershipChanged"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrMembershipChangedSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(DAOMembershipChanged)
|
out := new(DAOMembershipChanged)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
@ -686,6 +692,9 @@ func (DAOProposalAdded) ContractEventName() string {
|
||||||
return DAOProposalAddedEventName
|
return DAOProposalAddedEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrProposalAddedSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrProposalAddedSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackProposalAddedEvent is the Go binding that unpacks the event data emitted
|
// UnpackProposalAddedEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -693,7 +702,7 @@ func (DAOProposalAdded) ContractEventName() string {
|
||||||
func (dAO *DAO) UnpackProposalAddedEvent(log *types.Log) (*DAOProposalAdded, error) {
|
func (dAO *DAO) UnpackProposalAddedEvent(log *types.Log) (*DAOProposalAdded, error) {
|
||||||
event := "ProposalAdded"
|
event := "ProposalAdded"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrProposalAddedSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(DAOProposalAdded)
|
out := new(DAOProposalAdded)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
@ -730,6 +739,9 @@ func (DAOProposalTallied) ContractEventName() string {
|
||||||
return DAOProposalTalliedEventName
|
return DAOProposalTalliedEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrProposalTalliedSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrProposalTalliedSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackProposalTalliedEvent is the Go binding that unpacks the event data emitted
|
// UnpackProposalTalliedEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -737,7 +749,7 @@ func (DAOProposalTallied) ContractEventName() string {
|
||||||
func (dAO *DAO) UnpackProposalTalliedEvent(log *types.Log) (*DAOProposalTallied, error) {
|
func (dAO *DAO) UnpackProposalTalliedEvent(log *types.Log) (*DAOProposalTallied, error) {
|
||||||
event := "ProposalTallied"
|
event := "ProposalTallied"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrProposalTalliedSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(DAOProposalTallied)
|
out := new(DAOProposalTallied)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
@ -774,6 +786,9 @@ func (DAOVoted) ContractEventName() string {
|
||||||
return DAOVotedEventName
|
return DAOVotedEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrVotedSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrVotedSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackVotedEvent is the Go binding that unpacks the event data emitted
|
// UnpackVotedEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -781,7 +796,7 @@ func (DAOVoted) ContractEventName() string {
|
||||||
func (dAO *DAO) UnpackVotedEvent(log *types.Log) (*DAOVoted, error) {
|
func (dAO *DAO) UnpackVotedEvent(log *types.Log) (*DAOVoted, error) {
|
||||||
event := "Voted"
|
event := "Voted"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrVotedSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(DAOVoted)
|
out := new(DAOVoted)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,9 @@ func (EventCheckerDynamic) ContractEventName() string {
|
||||||
return EventCheckerDynamicEventName
|
return EventCheckerDynamicEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrDynamicSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrDynamicSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackDynamicEvent is the Go binding that unpacks the event data emitted
|
// UnpackDynamicEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -73,7 +76,7 @@ func (EventCheckerDynamic) ContractEventName() string {
|
||||||
func (eventChecker *EventChecker) UnpackDynamicEvent(log *types.Log) (*EventCheckerDynamic, error) {
|
func (eventChecker *EventChecker) UnpackDynamicEvent(log *types.Log) (*EventCheckerDynamic, error) {
|
||||||
event := "dynamic"
|
event := "dynamic"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrDynamicSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(EventCheckerDynamic)
|
out := new(EventCheckerDynamic)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
@ -106,6 +109,9 @@ func (EventCheckerEmpty) ContractEventName() string {
|
||||||
return EventCheckerEmptyEventName
|
return EventCheckerEmptyEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrEmptySignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrEmptySignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackEmptyEvent is the Go binding that unpacks the event data emitted
|
// UnpackEmptyEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -113,7 +119,7 @@ func (EventCheckerEmpty) ContractEventName() string {
|
||||||
func (eventChecker *EventChecker) UnpackEmptyEvent(log *types.Log) (*EventCheckerEmpty, error) {
|
func (eventChecker *EventChecker) UnpackEmptyEvent(log *types.Log) (*EventCheckerEmpty, error) {
|
||||||
event := "empty"
|
event := "empty"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrEmptySignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(EventCheckerEmpty)
|
out := new(EventCheckerEmpty)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
@ -148,6 +154,9 @@ func (EventCheckerIndexed) ContractEventName() string {
|
||||||
return EventCheckerIndexedEventName
|
return EventCheckerIndexedEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrIndexedSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrIndexedSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackIndexedEvent is the Go binding that unpacks the event data emitted
|
// UnpackIndexedEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -155,7 +164,7 @@ func (EventCheckerIndexed) ContractEventName() string {
|
||||||
func (eventChecker *EventChecker) UnpackIndexedEvent(log *types.Log) (*EventCheckerIndexed, error) {
|
func (eventChecker *EventChecker) UnpackIndexedEvent(log *types.Log) (*EventCheckerIndexed, error) {
|
||||||
event := "indexed"
|
event := "indexed"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrIndexedSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(EventCheckerIndexed)
|
out := new(EventCheckerIndexed)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
@ -190,6 +199,9 @@ func (EventCheckerMixed) ContractEventName() string {
|
||||||
return EventCheckerMixedEventName
|
return EventCheckerMixedEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrMixedSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrMixedSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackMixedEvent is the Go binding that unpacks the event data emitted
|
// UnpackMixedEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -197,7 +209,7 @@ func (EventCheckerMixed) ContractEventName() string {
|
||||||
func (eventChecker *EventChecker) UnpackMixedEvent(log *types.Log) (*EventCheckerMixed, error) {
|
func (eventChecker *EventChecker) UnpackMixedEvent(log *types.Log) (*EventCheckerMixed, error) {
|
||||||
event := "mixed"
|
event := "mixed"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrMixedSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(EventCheckerMixed)
|
out := new(EventCheckerMixed)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
@ -232,6 +244,9 @@ func (EventCheckerUnnamed) ContractEventName() string {
|
||||||
return EventCheckerUnnamedEventName
|
return EventCheckerUnnamedEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrUnnamedSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrUnnamedSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackUnnamedEvent is the Go binding that unpacks the event data emitted
|
// UnpackUnnamedEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -239,7 +254,7 @@ func (EventCheckerUnnamed) ContractEventName() string {
|
||||||
func (eventChecker *EventChecker) UnpackUnnamedEvent(log *types.Log) (*EventCheckerUnnamed, error) {
|
func (eventChecker *EventChecker) UnpackUnnamedEvent(log *types.Log) (*EventCheckerUnnamed, error) {
|
||||||
event := "unnamed"
|
event := "unnamed"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrUnnamedSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(EventCheckerUnnamed)
|
out := new(EventCheckerUnnamed)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,9 @@ func (NameConflictLog) ContractEventName() string {
|
||||||
return NameConflictLogEventName
|
return NameConflictLogEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrLogSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrLogSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackLogEvent is the Go binding that unpacks the event data emitted
|
// UnpackLogEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -135,7 +138,7 @@ func (NameConflictLog) ContractEventName() string {
|
||||||
func (nameConflict *NameConflict) UnpackLogEvent(log *types.Log) (*NameConflictLog, error) {
|
func (nameConflict *NameConflict) UnpackLogEvent(log *types.Log) (*NameConflictLog, error) {
|
||||||
event := "log"
|
event := "log"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != nameConflict.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != nameConflict.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrLogSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(NameConflictLog)
|
out := new(NameConflictLog)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,9 @@ func (NumericMethodNameE1TestEvent) ContractEventName() string {
|
||||||
return NumericMethodNameE1TestEventEventName
|
return NumericMethodNameE1TestEventEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrE1TestEventSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrE1TestEventSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackE1TestEventEvent is the Go binding that unpacks the event data emitted
|
// UnpackE1TestEventEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -137,7 +140,7 @@ func (NumericMethodNameE1TestEvent) ContractEventName() string {
|
||||||
func (numericMethodName *NumericMethodName) UnpackE1TestEventEvent(log *types.Log) (*NumericMethodNameE1TestEvent, error) {
|
func (numericMethodName *NumericMethodName) UnpackE1TestEventEvent(log *types.Log) (*NumericMethodNameE1TestEvent, error) {
|
||||||
event := "_1TestEvent"
|
event := "_1TestEvent"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != numericMethodName.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != numericMethodName.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrE1TestEventSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(NumericMethodNameE1TestEvent)
|
out := new(NumericMethodNameE1TestEvent)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
|
||||||
10
accounts/abi/abigen/testdata/v2/overload.go.txt
vendored
10
accounts/abi/abigen/testdata/v2/overload.go.txt
vendored
|
|
@ -108,6 +108,9 @@ func (OverloadBar) ContractEventName() string {
|
||||||
return OverloadBarEventName
|
return OverloadBarEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrBarSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrBarSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackBarEvent is the Go binding that unpacks the event data emitted
|
// UnpackBarEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -115,7 +118,7 @@ func (OverloadBar) ContractEventName() string {
|
||||||
func (overload *Overload) UnpackBarEvent(log *types.Log) (*OverloadBar, error) {
|
func (overload *Overload) UnpackBarEvent(log *types.Log) (*OverloadBar, error) {
|
||||||
event := "bar"
|
event := "bar"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != overload.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != overload.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrBarSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(OverloadBar)
|
out := new(OverloadBar)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
@ -150,6 +153,9 @@ func (OverloadBar0) ContractEventName() string {
|
||||||
return OverloadBar0EventName
|
return OverloadBar0EventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrBar0SignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrBar0SignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackBar0Event is the Go binding that unpacks the event data emitted
|
// UnpackBar0Event is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -157,7 +163,7 @@ func (OverloadBar0) ContractEventName() string {
|
||||||
func (overload *Overload) UnpackBar0Event(log *types.Log) (*OverloadBar0, error) {
|
func (overload *Overload) UnpackBar0Event(log *types.Log) (*OverloadBar0, error) {
|
||||||
event := "bar0"
|
event := "bar0"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != overload.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != overload.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrBar0SignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(OverloadBar0)
|
out := new(OverloadBar0)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
|
||||||
5
accounts/abi/abigen/testdata/v2/token.go.txt
vendored
5
accounts/abi/abigen/testdata/v2/token.go.txt
vendored
|
|
@ -380,6 +380,9 @@ func (TokenTransfer) ContractEventName() string {
|
||||||
return TokenTransferEventName
|
return TokenTransferEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrTransferSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrTransferSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackTransferEvent is the Go binding that unpacks the event data emitted
|
// UnpackTransferEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -387,7 +390,7 @@ func (TokenTransfer) ContractEventName() string {
|
||||||
func (token *Token) UnpackTransferEvent(log *types.Log) (*TokenTransfer, error) {
|
func (token *Token) UnpackTransferEvent(log *types.Log) (*TokenTransfer, error) {
|
||||||
event := "Transfer"
|
event := "Transfer"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != token.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != token.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrTransferSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(TokenTransfer)
|
out := new(TokenTransfer)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
|
||||||
10
accounts/abi/abigen/testdata/v2/tuple.go.txt
vendored
10
accounts/abi/abigen/testdata/v2/tuple.go.txt
vendored
|
|
@ -187,6 +187,9 @@ func (TupleTupleEvent) ContractEventName() string {
|
||||||
return TupleTupleEventEventName
|
return TupleTupleEventEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrTupleEventSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrTupleEventSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackTupleEventEvent is the Go binding that unpacks the event data emitted
|
// UnpackTupleEventEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -194,7 +197,7 @@ func (TupleTupleEvent) ContractEventName() string {
|
||||||
func (tuple *Tuple) UnpackTupleEventEvent(log *types.Log) (*TupleTupleEvent, error) {
|
func (tuple *Tuple) UnpackTupleEventEvent(log *types.Log) (*TupleTupleEvent, error) {
|
||||||
event := "TupleEvent"
|
event := "TupleEvent"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != tuple.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != tuple.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrTupleEventSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(TupleTupleEvent)
|
out := new(TupleTupleEvent)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
@ -228,6 +231,9 @@ func (TupleTupleEvent2) ContractEventName() string {
|
||||||
return TupleTupleEvent2EventName
|
return TupleTupleEvent2EventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrTupleEvent2SignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrTupleEvent2SignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackTupleEvent2Event is the Go binding that unpacks the event data emitted
|
// UnpackTupleEvent2Event is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -235,7 +241,7 @@ func (TupleTupleEvent2) ContractEventName() string {
|
||||||
func (tuple *Tuple) UnpackTupleEvent2Event(log *types.Log) (*TupleTupleEvent2, error) {
|
func (tuple *Tuple) UnpackTupleEvent2Event(log *types.Log) (*TupleTupleEvent2, error) {
|
||||||
event := "TupleEvent2"
|
event := "TupleEvent2"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != tuple.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != tuple.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrTupleEvent2SignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(TupleTupleEvent2)
|
out := new(TupleTupleEvent2)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
|
||||||
|
|
@ -270,6 +270,9 @@ func (DBInsert) ContractEventName() string {
|
||||||
return DBInsertEventName
|
return DBInsertEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrInsertSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrInsertSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackInsertEvent is the Go binding that unpacks the event data emitted
|
// UnpackInsertEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -277,7 +280,7 @@ func (DBInsert) ContractEventName() string {
|
||||||
func (dB *DB) UnpackInsertEvent(log *types.Log) (*DBInsert, error) {
|
func (dB *DB) UnpackInsertEvent(log *types.Log) (*DBInsert, error) {
|
||||||
event := "Insert"
|
event := "Insert"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != dB.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != dB.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrInsertSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(DBInsert)
|
out := new(DBInsert)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
@ -312,6 +315,9 @@ func (DBKeyedInsert) ContractEventName() string {
|
||||||
return DBKeyedInsertEventName
|
return DBKeyedInsertEventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrKeyedInsertSignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrKeyedInsertSignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackKeyedInsertEvent is the Go binding that unpacks the event data emitted
|
// UnpackKeyedInsertEvent is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -319,7 +325,7 @@ func (DBKeyedInsert) ContractEventName() string {
|
||||||
func (dB *DB) UnpackKeyedInsertEvent(log *types.Log) (*DBKeyedInsert, error) {
|
func (dB *DB) UnpackKeyedInsertEvent(log *types.Log) (*DBKeyedInsert, error) {
|
||||||
event := "KeyedInsert"
|
event := "KeyedInsert"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != dB.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != dB.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrKeyedInsertSignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(DBKeyedInsert)
|
out := new(DBKeyedInsert)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,9 @@ func (CBasic1) ContractEventName() string {
|
||||||
return CBasic1EventName
|
return CBasic1EventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrBasic1SignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrBasic1SignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackBasic1Event is the Go binding that unpacks the event data emitted
|
// UnpackBasic1Event is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -116,7 +119,7 @@ func (CBasic1) ContractEventName() string {
|
||||||
func (c *C) UnpackBasic1Event(log *types.Log) (*CBasic1, error) {
|
func (c *C) UnpackBasic1Event(log *types.Log) (*CBasic1, error) {
|
||||||
event := "basic1"
|
event := "basic1"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != c.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != c.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrBasic1SignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(CBasic1)
|
out := new(CBasic1)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
@ -151,6 +154,9 @@ func (CBasic2) ContractEventName() string {
|
||||||
return CBasic2EventName
|
return CBasic2EventName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrBasic2SignatureMismatch is returned when the event signature does not match the expected signature.
|
||||||
|
var ErrBasic2SignatureMismatch = errors.New("event signature mismatch")
|
||||||
|
|
||||||
// UnpackBasic2Event is the Go binding that unpacks the event data emitted
|
// UnpackBasic2Event is the Go binding that unpacks the event data emitted
|
||||||
// by contract.
|
// by contract.
|
||||||
//
|
//
|
||||||
|
|
@ -158,7 +164,7 @@ func (CBasic2) ContractEventName() string {
|
||||||
func (c *C) UnpackBasic2Event(log *types.Log) (*CBasic2, error) {
|
func (c *C) UnpackBasic2Event(log *types.Log) (*CBasic2, error) {
|
||||||
event := "basic2"
|
event := "basic2"
|
||||||
if len(log.Topics) == 0 || log.Topics[0] != c.abi.Events[event].ID {
|
if len(log.Topics) == 0 || log.Topics[0] != c.abi.Events[event].ID {
|
||||||
return nil, errors.New("event signature mismatch")
|
return nil, ErrBasic2SignatureMismatch
|
||||||
}
|
}
|
||||||
out := new(CBasic2)
|
out := new(CBasic2)
|
||||||
if len(log.Data) > 0 {
|
if len(log.Data) > 0 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue