diff options
| author | Péter Szilágyi <peterke@gmail.com> | 2016-06-30 17:57:50 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-30 17:57:50 +0800 |
| commit | 1e50f5dd281d28b8db1c65b9e80e53080b86e369 (patch) | |
| tree | 30a0832e6f514fe06fe9308043eaa20d2ba44b13 /accounts/abi/bind/backend.go | |
| parent | f127799d795eaf2d6f99780c058361cd561492f1 (diff) | |
| parent | 3a97280ae889bb6852ba16e70750a37b2ed08473 (diff) | |
| download | dexon-1e50f5dd281d28b8db1c65b9e80e53080b86e369.tar dexon-1e50f5dd281d28b8db1c65b9e80e53080b86e369.tar.gz dexon-1e50f5dd281d28b8db1c65b9e80e53080b86e369.tar.bz2 dexon-1e50f5dd281d28b8db1c65b9e80e53080b86e369.tar.lz dexon-1e50f5dd281d28b8db1c65b9e80e53080b86e369.tar.xz dexon-1e50f5dd281d28b8db1c65b9e80e53080b86e369.tar.zst dexon-1e50f5dd281d28b8db1c65b9e80e53080b86e369.zip | |
Merge pull request #2159 from zsfelfoldi/light-backend
eth: separate common and full node-specific API and backend service
Diffstat (limited to 'accounts/abi/bind/backend.go')
| -rw-r--r-- | accounts/abi/bind/backend.go | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/accounts/abi/bind/backend.go b/accounts/abi/bind/backend.go index 65806aef4..bec742c29 100644 --- a/accounts/abi/bind/backend.go +++ b/accounts/abi/bind/backend.go @@ -22,6 +22,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" + "golang.org/x/net/context" ) // ErrNoCode is returned by call and transact operations for which the requested @@ -35,12 +36,12 @@ type ContractCaller interface { // HasCode checks if the contract at the given address has any code associated // with it or not. This is needed to differentiate between contract internal // errors and the local chain being out of sync. - HasCode(contract common.Address, pending bool) (bool, error) + HasCode(ctx context.Context, contract common.Address, pending bool) (bool, error) // ContractCall executes an Ethereum contract call with the specified data as // the input. The pending flag requests execution against the pending block, not // the stable head of the chain. - ContractCall(contract common.Address, data []byte, pending bool) ([]byte, error) + ContractCall(ctx context.Context, contract common.Address, data []byte, pending bool) ([]byte, error) } // ContractTransactor defines the methods needed to allow operating with contract @@ -50,26 +51,26 @@ type ContractCaller interface { type ContractTransactor interface { // PendingAccountNonce retrieves the current pending nonce associated with an // account. - PendingAccountNonce(account common.Address) (uint64, error) + PendingAccountNonce(ctx context.Context, account common.Address) (uint64, error) // SuggestGasPrice retrieves the currently suggested gas price to allow a timely // execution of a transaction. - SuggestGasPrice() (*big.Int, error) + SuggestGasPrice(ctx context.Context) (*big.Int, error) // HasCode checks if the contract at the given address has any code associated // with it or not. This is needed to differentiate between contract internal // errors and the local chain being out of sync. - HasCode(contract common.Address, pending bool) (bool, error) + HasCode(ctx context.Context, contract common.Address, pending bool) (bool, error) // EstimateGasLimit tries to estimate the gas needed to execute a specific // transaction based on the current pending state of the backend blockchain. // There is no guarantee that this is the true gas limit requirement as other // transactions may be added or removed by miners, but it should provide a basis // for setting a reasonable default. - EstimateGasLimit(sender common.Address, contract *common.Address, value *big.Int, data []byte) (*big.Int, error) + EstimateGasLimit(ctx context.Context, sender common.Address, contract *common.Address, value *big.Int, data []byte) (*big.Int, error) // SendTransaction injects the transaction into the pending pool for execution. - SendTransaction(tx *types.Transaction) error + SendTransaction(ctx context.Context, tx *types.Transaction) error } // ContractBackend defines the methods needed to allow operating with contract @@ -84,28 +85,28 @@ type ContractBackend interface { // HasCode checks if the contract at the given address has any code associated // with it or not. This is needed to differentiate between contract internal // errors and the local chain being out of sync. - HasCode(contract common.Address, pending bool) (bool, error) + HasCode(ctx context.Context, contract common.Address, pending bool) (bool, error) // ContractCall executes an Ethereum contract call with the specified data as // the input. The pending flag requests execution against the pending block, not // the stable head of the chain. - ContractCall(contract common.Address, data []byte, pending bool) ([]byte, error) + ContractCall(ctx context.Context, contract common.Address, data []byte, pending bool) ([]byte, error) // PendingAccountNonce retrieves the current pending nonce associated with an // account. - PendingAccountNonce(account common.Address) (uint64, error) + PendingAccountNonce(ctx context.Context, account common.Address) (uint64, error) // SuggestGasPrice retrieves the currently suggested gas price to allow a timely // execution of a transaction. - SuggestGasPrice() (*big.Int, error) + SuggestGasPrice(ctx context.Context) (*big.Int, error) // EstimateGasLimit tries to estimate the gas needed to execute a specific // transaction based on the current pending state of the backend blockchain. // There is no guarantee that this is the true gas limit requirement as other // transactions may be added or removed by miners, but it should provide a basis // for setting a reasonable default. - EstimateGasLimit(sender common.Address, contract *common.Address, value *big.Int, data []byte) (*big.Int, error) + EstimateGasLimit(ctx context.Context, sender common.Address, contract *common.Address, value *big.Int, data []byte) (*big.Int, error) // SendTransaction injects the transaction into the pending pool for execution. - SendTransaction(tx *types.Transaction) error + SendTransaction(ctx context.Context, tx *types.Transaction) error } |
