accounts/abi/bind/backends: remove nil and remote backends
The remote backend is superseded by ethclient. The nil backend's stated purpose was to enable testing of accounts/abi/bind. None of its methods actually worked. A much simpler way to get a crashing backend is to simply pass nil as the backend. With a one-line change to the generator (removing two explicit interface assertions), passing nil actually works. Removing these backends means that less changes are required later.
This commit is contained in:
@ -127,7 +127,7 @@ package {{.Package}}
|
||||
|
||||
// New{{.Type}} creates a new instance of {{.Type}}, bound to a specific deployed contract.
|
||||
func New{{.Type}}(address common.Address, backend bind.ContractBackend) (*{{.Type}}, error) {
|
||||
contract, err := bind{{.Type}}(address, backend.(bind.ContractCaller), backend.(bind.ContractTransactor))
|
||||
contract, err := bind{{.Type}}(address, backend, backend)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user