accounts/abi: minor fixes

This commit is contained in:
rjl493456442 2020-03-16 12:41:59 +08:00
parent e2973474d4
commit 5ab8562a85
2 changed files with 6 additions and 6 deletions

View file

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

View file

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