From 5ab8562a85de5a68e8a8bbb897f95b45147ac518 Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Mon, 16 Mar 2020 12:41:59 +0800 Subject: [PATCH] accounts/abi: minor fixes --- accounts/abi/abi.go | 4 ++-- accounts/abi/bind/template.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/accounts/abi/abi.go b/accounts/abi/abi.go index 0500c5fb90..b6e23342c2 100644 --- a/accounts/abi/abi.go +++ b/accounts/abi/abi.go @@ -172,7 +172,7 @@ func (abi *ABI) UnmarshalJSON(data []byte) error { case "fallback": // New introduced function type in v0.6.0, check more detail // here https://solidity.readthedocs.io/en/v0.6.0/contracts.html#fallback-function - if abi.Fallback.Name != "" { + if abi.Fallback.Fallback { return errors.New("only single fallback is allowed") } abi.Fallback = Method{ @@ -195,7 +195,7 @@ func (abi *ABI) UnmarshalJSON(data []byte) error { case "receive": // New introduced function type in v0.6.0, check more detail // here https://solidity.readthedocs.io/en/v0.6.0/contracts.html#fallback-function - if abi.Receive.Name != "" { + if abi.Receive.Receive { return errors.New("only single receive is allowed") } if field.StateMutability != "payable" { diff --git a/accounts/abi/bind/template.go b/accounts/abi/bind/template.go index a78a03c891..65c4139ae2 100644 --- a/accounts/abi/bind/template.go +++ b/accounts/abi/bind/template.go @@ -361,14 +361,14 @@ var ( return _{{$contract.Type}}.contract.RawTransact(opts, calldata) } - // Fallback is a paid mutator transaction binding the contract fallback function. - // + // Fallback is a paid mutator transaction binding the contract fallback function. + // // Solidity: {{formatmethod .Fallback.Original $structs}} func (_{{$contract.Type}} *{{$contract.Type}}Session) Fallback(calldata []byte) (*types.Transaction, error) { return _{{$contract.Type}}.Contract.Fallback(&_{{$contract.Type}}.TransactOpts, calldata) } - // Fallback is a paid mutator transaction binding the contract fallback function. + // Fallback is a paid mutator transaction binding the contract fallback function. // // Solidity: {{formatmethod .Fallback.Original $structs}} func (_{{$contract.Type}} *{{$contract.Type}}TransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { @@ -385,7 +385,7 @@ var ( } // Receive is a paid mutator transaction binding the contract receive function. - // + // // Solidity: {{formatmethod .Receive.Original $structs}} func (_{{$contract.Type}} *{{$contract.Type}}Session) Receive() (*types.Transaction, error) { return _{{$contract.Type}}.Contract.Receive(&_{{$contract.Type}}.TransactOpts)