aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-04-06 11:51:59 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-15 22:09:55 +0800
commit92929a98dfd662f860feefe76ff824fdf9ce76a3 (patch)
tree4e70c09f6ffa3a9b11c1ea84bbde2fb11222a527
parent7e0cf4521822a40db9cb9049fd5622be8d3a4e20 (diff)
downloadgo-tangerine-92929a98dfd662f860feefe76ff824fdf9ce76a3.tar.gz
go-tangerine-92929a98dfd662f860feefe76ff824fdf9ce76a3.tar.zst
go-tangerine-92929a98dfd662f860feefe76ff824fdf9ce76a3.zip
cmd: monkey: use suggested gas price
-rw-r--r--cmd/zoo/monkey/monkey.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd/zoo/monkey/monkey.go b/cmd/zoo/monkey/monkey.go
index 2afffa87c..a511c42fa 100644
--- a/cmd/zoo/monkey/monkey.go
+++ b/cmd/zoo/monkey/monkey.go
@@ -124,16 +124,21 @@ func (m *Monkey) prepareTx(ctx *transferContext) *types.Transaction {
}
}
+ gasPrice, err := m.client.SuggestGasPrice(context.Background())
+ if err != nil {
+ panic(err)
+ }
+
tx := types.NewTransaction(
ctx.Nonce,
ctx.ToAddress,
ctx.Amount,
ctx.Gas,
- big.NewInt(1e9),
+ gasPrice,
ctx.Data)
signer := types.NewEIP155Signer(m.networkID)
- tx, err := types.SignTx(tx, signer, ctx.Key)
+ tx, err = types.SignTx(tx, signer, ctx.Key)
if err != nil {
panic(err)
}