diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-04-01 21:42:05 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-04-01 21:42:05 +0800 |
commit | fb578f4550a08617485d9146876489d1f3bb1b52 (patch) | |
tree | f502b5ee41d1d8b5c2eb3908468c05f1d8b0d939 /accounts/abi/bind/base.go | |
parent | 8b2aca96c598dda14f0cbc94e1c41b930c4ab822 (diff) | |
parent | 4097478884fb27db3f90e0997c12d8266eed9531 (diff) | |
download | go-tangerine-fb578f4550a08617485d9146876489d1f3bb1b52.tar.gz go-tangerine-fb578f4550a08617485d9146876489d1f3bb1b52.tar.zst go-tangerine-fb578f4550a08617485d9146876489d1f3bb1b52.zip |
Merge pull request #2405 from karalabe/abigen-default-methods
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) { |