Skip to content

Commit 8fd95f9

Browse files
s7v7nislandsseven
authored andcommitted
internal/ethapi, accounts/abi/backends: use error defined in core (ethereum#26012)
Co-authored-by: seven <[email protected]>
1 parent e8e9c66 commit 8fd95f9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

accounts/abi/bind/backends/simulated.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMs
527527
available := new(big.Int).Set(balance)
528528
if call.Value != nil {
529529
if call.Value.Cmp(available) >= 0 {
530-
return 0, errors.New("insufficient funds for transfer")
530+
return 0, core.ErrInsufficientFundsForTransfer
531531
}
532532
available.Sub(available, call.Value)
533533
}

internal/ethapi/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr
10981098
available := new(big.Int).Set(balance)
10991099
if args.Value != nil {
11001100
if args.Value.ToInt().Cmp(available) >= 0 {
1101-
return 0, errors.New("insufficient funds for transfer")
1101+
return 0, core.ErrInsufficientFundsForTransfer
11021102
}
11031103
available.Sub(available, args.Value.ToInt())
11041104
}

0 commit comments

Comments
 (0)