Commit bc36f5f3 authored by hezhengjun's avatar hezhengjun

correct gas set

parent 181d46ac
...@@ -96,14 +96,7 @@ func CreateTxInfoAndWrite(abiData []byte, deployAddr, contract, name, url string ...@@ -96,14 +96,7 @@ func CreateTxInfoAndWrite(abiData []byte, deployAddr, contract, name, url string
msg.To = &contracAddr msg.To = &contracAddr
msg.Value = big.NewInt(0) msg.Value = big.NewInt(0)
//估算gas //估算gas
gasLimit, err := client.EstimateGas(context.Background(), msg) gasLimit := uint64(500 * 10000)
if err != nil {
fmt.Println("EstimateGas Err:", err)
return
}
if gasLimit < 100*10000 {
gasLimit = 100 * 10000
}
ntx := types.NewTx(&types.LegacyTx{ ntx := types.NewTx(&types.LegacyTx{
Nonce: nonce, Nonce: nonce,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment