aboutsummaryrefslogtreecommitdiffstats
path: root/eth/bind.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-01-03 22:53:06 +0800
committerGitHub <noreply@github.com>2018-01-03 22:53:06 +0800
commit762f3a48a00da02fe58063cb6ce8dc2d08821f15 (patch)
tree783421f8ece4306f69cb17e515ee07c1ab4fe0eb /eth/bind.go
parentb47285f1cf0cb475f29322ceb9fac4d7e1cfb11f (diff)
parent6f69cdd109b1dd692b8dfb15e7c53d2051fbc946 (diff)
downloadgo-tangerine-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar
go-tangerine-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar.gz
go-tangerine-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar.bz2
go-tangerine-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar.lz
go-tangerine-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar.xz
go-tangerine-762f3a48a00da02fe58063cb6ce8dc2d08821f15.tar.zst
go-tangerine-762f3a48a00da02fe58063cb6ce8dc2d08821f15.zip
Merge pull request #15466 from karalabe/uint64-gas-limit
all: switch gas limits from big.Int to uint64
Diffstat (limited to 'eth/bind.go')
-rw-r--r--eth/bind.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/eth/bind.go b/eth/bind.go
index d09977dbc..769a6c741 100644
--- a/eth/bind.go
+++ b/eth/bind.go
@@ -83,9 +83,7 @@ func toCallArgs(msg ethereum.CallMsg) ethapi.CallArgs {
To: msg.To,
From: msg.From,
Data: msg.Data,
- }
- if msg.Gas != nil {
- args.Gas = hexutil.Big(*msg.Gas)
+ Gas: hexutil.Uint64(msg.Gas),
}
if msg.GasPrice != nil {
args.GasPrice = hexutil.Big(*msg.GasPrice)
@@ -124,9 +122,9 @@ func (b *ContractBackend) SuggestGasPrice(ctx context.Context) (*big.Int, error)
// 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.
-func (b *ContractBackend) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (*big.Int, error) {
- out, err := b.bcapi.EstimateGas(ctx, toCallArgs(msg))
- return out.ToInt(), err
+func (b *ContractBackend) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error) {
+ gas, err := b.bcapi.EstimateGas(ctx, toCallArgs(msg))
+ return uint64(gas), err
}
// SendTransaction implements bind.ContractTransactor injects the transaction