aboutsummaryrefslogtreecommitdiffstats
path: root/mobile/bind.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-12-08 20:09:26 +0800
committerFelix Lange <fjl@twurst.com>2016-12-08 20:09:26 +0800
commit0fe35b907addf1c066cb4d7c717bb23f9f2e7be4 (patch)
treece23037c4256b7c1ec4561d7477c33b328aa81e8 /mobile/bind.go
parent3fc7c978277051391f8ea7831559e9f4f83c3166 (diff)
downloaddexon-0fe35b907addf1c066cb4d7c717bb23f9f2e7be4.tar.gz
dexon-0fe35b907addf1c066cb4d7c717bb23f9f2e7be4.tar.zst
dexon-0fe35b907addf1c066cb4d7c717bb23f9f2e7be4.zip
mobile: iOS naming and API fixes for generators and Swift (#3408)
* build: modify the iOS namespace to iGeth (gomobile limitation) * mobile: assign names to return types for ObjC wrapper * mobile: use more expanded names for iOS/Swift API
Diffstat (limited to 'mobile/bind.go')
-rw-r--r--mobile/bind.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/mobile/bind.go b/mobile/bind.go
index 50adc6b0f..a25c37aca 100644
--- a/mobile/bind.go
+++ b/mobile/bind.go
@@ -31,15 +31,15 @@ import (
// Signer is an interaface defining the callback when a contract requires a
// method to sign the transaction before submission.
type Signer interface {
- Sign(*Address, *Transaction) (*Transaction, error)
+ Sign(*Address, *Transaction) (tx *Transaction, _ error)
}
type signer struct {
sign bind.SignerFn
}
-func (s *signer) Sign(addr *Address, tx *Transaction) (*Transaction, error) {
- sig, err := s.sign(types.HomesteadSigner{}, addr.address, tx.tx)
+func (s *signer) Sign(addr *Address, unsignedTx *Transaction) (signedTx *Transaction, _ error) {
+ sig, err := s.sign(types.HomesteadSigner{}, addr.address, unsignedTx.tx)
if err != nil {
return nil, err
}
@@ -113,7 +113,7 @@ type BoundContract struct {
// DeployContract deploys a contract onto the Ethereum blockchain and binds the
// deployment address with a wrapper.
-func DeployContract(opts *TransactOpts, abiJSON string, bytecode []byte, client *EthereumClient, args *Interfaces) (*BoundContract, error) {
+func DeployContract(opts *TransactOpts, abiJSON string, bytecode []byte, client *EthereumClient, args *Interfaces) (contract *BoundContract, _ error) {
// Convert all the deployment parameters to Go types
params := make([]interface{}, len(args.objects))
for i, obj := range args.objects {
@@ -137,7 +137,7 @@ func DeployContract(opts *TransactOpts, abiJSON string, bytecode []byte, client
// BindContract creates a low level contract interface through which calls and
// transactions may be made through.
-func BindContract(address *Address, abiJSON string, client *EthereumClient) (*BoundContract, error) {
+func BindContract(address *Address, abiJSON string, client *EthereumClient) (contract *BoundContract, _ error) {
parsed, err := abi.JSON(strings.NewReader(abiJSON))
if err != nil {
return nil, err
@@ -179,24 +179,24 @@ func (c *BoundContract) Call(opts *CallOpts, out *Interfaces, method string, arg
}
// Transact invokes the (paid) contract method with params as input values.
-func (c *BoundContract) Transact(opts *TransactOpts, method string, args *Interfaces) (*Transaction, error) {
+func (c *BoundContract) Transact(opts *TransactOpts, method string, args *Interfaces) (tx *Transaction, _ error) {
params := make([]interface{}, len(args.objects))
for i, obj := range args.objects {
params[i] = obj
}
- tx, err := c.contract.Transact(&opts.opts, method, params)
+ rawTx, err := c.contract.Transact(&opts.opts, method, params)
if err != nil {
return nil, err
}
- return &Transaction{tx}, nil
+ return &Transaction{rawTx}, nil
}
// 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) (*Transaction, error) {
- tx, err := c.contract.Transfer(&opts.opts)
+func (c *BoundContract) Transfer(opts *TransactOpts) (tx *Transaction, _ error) {
+ rawTx, err := c.contract.Transfer(&opts.opts)
if err != nil {
return nil, err
}
- return &Transaction{tx}, nil
+ return &Transaction{rawTx}, nil
}