diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-03-16 18:48:33 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-03-24 20:15:18 +0800 |
commit | 72826bb5adddedf0fd4fb9903e883d4c64fa18a6 (patch) | |
tree | 9e20f17956a3d0ac5ecf2e64db80dedef0196d45 /accounts/abi/abi.go | |
parent | 75c86f8646ed6a21116d6c5f5e400dd966bb218d (diff) | |
download | dexon-72826bb5adddedf0fd4fb9903e883d4c64fa18a6.tar dexon-72826bb5adddedf0fd4fb9903e883d4c64fa18a6.tar.gz dexon-72826bb5adddedf0fd4fb9903e883d4c64fa18a6.tar.bz2 dexon-72826bb5adddedf0fd4fb9903e883d4c64fa18a6.tar.lz dexon-72826bb5adddedf0fd4fb9903e883d4c64fa18a6.tar.xz dexon-72826bb5adddedf0fd4fb9903e883d4c64fa18a6.tar.zst dexon-72826bb5adddedf0fd4fb9903e883d4c64fa18a6.zip |
accounts/abi/bind, cmd/abigen: Go API generator around an EVM ABI
Diffstat (limited to 'accounts/abi/abi.go')
-rw-r--r-- | accounts/abi/abi.go | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/accounts/abi/abi.go b/accounts/abi/abi.go index 673088f60..029d1b102 100644 --- a/accounts/abi/abi.go +++ b/accounts/abi/abi.go @@ -26,11 +26,6 @@ import ( "github.com/ethereum/go-ethereum/common" ) -// Executer is an executer method for performing state executions. It takes one -// argument which is the input data and expects output data to be returned as -// multiple 32 byte word length concatenated slice -type Executer func(datain []byte) []byte - // The ABI holds information about a contract's context and available // invokable methods. It will allow you to type check function calls and // packs data accordingly. @@ -169,21 +164,6 @@ func toGoType(i int, t Argument, output []byte) (interface{}, error) { return nil, fmt.Errorf("abi: unknown type %v", t.Type.T) } -// Call will unmarshal the output of the call in v. It will return an error if -// invalid type is given or if the output is too short to conform to the ABI -// spec. -// -// Call supports all of the available types and accepts a struct or an interface -// slice if the return is a tuple. -func (abi ABI) Call(executer Executer, v interface{}, name string, args ...interface{}) error { - callData, err := abi.Pack(name, args...) - if err != nil { - return err - } - - return abi.unmarshal(v, name, executer(callData)) -} - // these variable are used to determine certain types during type assertion for // assignment. var ( @@ -193,8 +173,8 @@ var ( r_byte = reflect.TypeOf(byte(0)) ) -// unmarshal output in v according to the abi specification -func (abi ABI) unmarshal(v interface{}, name string, output []byte) error { +// Unpack output in v according to the abi specification +func (abi ABI) Unpack(v interface{}, name string, output []byte) error { var method = abi.Methods[name] if len(output) == 0 { |