Unverified Commit 9b9a1b67 authored by s7v7nislands's avatar s7v7nislands Committed by GitHub

internal/ethapi, accounts/abi/backends: use error defined in core (#26012)

Co-authored-by: 's avatarseven <seven@nodereal.io>
parent b9ba6f6e
......@@ -527,7 +527,7 @@ func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMs
available := new(big.Int).Set(balance)
if call.Value != nil {
if call.Value.Cmp(available) >= 0 {
return 0, errors.New("insufficient funds for transfer")
return 0, core.ErrInsufficientFundsForTransfer
}
available.Sub(available, call.Value)
}
......
......@@ -1098,7 +1098,7 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr
available := new(big.Int).Set(balance)
if args.Value != nil {
if args.Value.ToInt().Cmp(available) >= 0 {
return 0, errors.New("insufficient funds for transfer")
return 0, core.ErrInsufficientFundsForTransfer
}
available.Sub(available, args.Value.ToInt())
}
......
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