aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/abi/bind/base.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-04-01 18:02:43 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-04-01 18:07:05 +0800
commit4097478884fb27db3f90e0997c12d8266eed9531 (patch)
tree61992cfe119d8c4088230319b48e3e4d49e63cd5 /accounts/abi/bind/base.go
parent10d3466c934bd425a8c941270749a652a588527d (diff)
downloaddexon-4097478884fb27db3f90e0997c12d8266eed9531.tar
dexon-4097478884fb27db3f90e0997c12d8266eed9531.tar.gz
dexon-4097478884fb27db3f90e0997c12d8266eed9531.tar.bz2
dexon-4097478884fb27db3f90e0997c12d8266eed9531.tar.lz
dexon-4097478884fb27db3f90e0997c12d8266eed9531.tar.xz
dexon-4097478884fb27db3f90e0997c12d8266eed9531.tar.zst
dexon-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.go9
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) {