-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update insufficient Balance Err #3392
Conversation
action/protocol/rewarding/fund.go
Outdated
@@ -134,7 +135,7 @@ func (p *Protocol) assertEnoughBalance( | |||
return err | |||
} | |||
if acc.Balance.Cmp(amount) < 0 { | |||
return errors.New("balance is not enough for donation") | |||
return errors.Wrapf(state.ErrNotEnoughBalance, "balance is not enough for donation") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add %s", actionCtx.Caller.String()
into error message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think you can add this into 3377
action/protocol/staking/handlers.go
Outdated
@@ -694,7 +694,7 @@ func (p *Protocol) handleCandidateRegister(ctx context.Context, act *action.Cand | |||
// update caller balance | |||
if err := caller.SubBalance(act.Amount()); err != nil { | |||
return log, nil, &handleError{ | |||
err: errors.Wrapf(err, "failed to update the balance of register %s", actCtx.Caller.String()), | |||
err: errors.Wrapf(state.ErrNotEnoughBalance, "failed to update the balance of register %s", actCtx.Caller.String()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these 3 are not necessary
Codecov Report
@@ Coverage Diff @@
## master #3392 +/- ##
=======================================
Coverage 75.22% 75.22%
=======================================
Files 236 236
Lines 21953 21953
=======================================
Hits 16514 16514
Misses 4554 4554
Partials 885 885
Continue to review full report at Codecov.
|
Description
fix err in #3377
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: