fix: gas estimation error cause network error
This commit is contained in:
parent
9d993ab884
commit
004bd4e79a
|
@ -13,6 +13,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum"
|
"github.com/ethereum/go-ethereum"
|
||||||
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
"github.com/ethereum/go-ethereum/accounts/abi/bind"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
"github.com/ethereum/go-ethereum/core"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/core/vm"
|
"github.com/ethereum/go-ethereum/core/vm"
|
||||||
"github.com/ethereum/go-ethereum/ethclient"
|
"github.com/ethereum/go-ethereum/ethclient"
|
||||||
|
@ -85,6 +86,8 @@ var propagateErrors = []error{
|
||||||
vm.ErrInvalidCode,
|
vm.ErrInvalidCode,
|
||||||
vm.ErrNonceUintOverflow,
|
vm.ErrNonceUintOverflow,
|
||||||
|
|
||||||
|
core.ErrInsufficientFunds,
|
||||||
|
|
||||||
// Used by balance history to check state
|
// Used by balance history to check state
|
||||||
ethereum.NotFound,
|
ethereum.NotFound,
|
||||||
bind.ErrNoCode,
|
bind.ErrNoCode,
|
||||||
|
@ -154,7 +157,7 @@ func isVMError(err error) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
for _, vmError := range propagateErrors {
|
for _, vmError := range propagateErrors {
|
||||||
if err == vmError {
|
if err == vmError || strings.Contains(err.Error(), vmError.Error()) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue