diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-04-01 18:02:43 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-04-01 18:07:05 +0800 |
commit | 4097478884fb27db3f90e0997c12d8266eed9531 (patch) | |
tree | 61992cfe119d8c4088230319b48e3e4d49e63cd5 /accounts/abi/bind/base.go | |
parent | 10d3466c934bd425a8c941270749a652a588527d (diff) | |
download | go-tangerine-4097478884fb27db3f90e0997c12d8266eed9531.tar go-tangerine-4097478884fb27db3f90e0997c12d8266eed9531.tar.gz go-tangerine-4097478884fb27db3f90e0997c12d8266eed9531.tar.bz2 go-tangerine-4097478884fb27db3f90e0997c12d8266eed9531.tar.lz go-tangerine-4097478884fb27db3f90e0997c12d8266eed9531.tar.xz go-tangerine-4097478884fb27db3f90e0997c12d8266eed9531.tar.zst go-tangerine-4097478884fb27db3f90e0997c12d8266eed9531.zip |
accounts/abi/bind: surface raw wrappers to access low level ops
Diffstat (limited to 'accounts/abi/bind/base.go')
-rw-r--r-- | accounts/abi/bind/base.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index 053b4ccc0..06621c5ad 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -108,8 +108,7 @@ func (c *BoundContract) Call(opts *CallOpts, result interface{}, method string, return c.abi.Unpack(result, method, output) } -// Transact invokes the (paid) contract method with params as input values and -// value as the fund transfer to the contract. +// Transact invokes the (paid) contract method with params as input values. func (c *BoundContract) Transact(opts *TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { // Otherwise pack up the parameters and invoke the contract input, err := c.abi.Pack(method, params...) @@ -119,6 +118,12 @@ func (c *BoundContract) Transact(opts *TransactOpts, method string, params ...in return c.transact(opts, &c.address, input) } +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (c *BoundContract) Transfer(opts *TransactOpts) (*types.Transaction, error) { + return c.transact(opts, &c.address, nil) +} + // transact executes an actual transaction invocation, first deriving any missing // authorization fields, and then scheduling the transaction for execution. func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, input []byte) (*types.Transaction, error) { |