Skip to content
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

test(tax2gas): add test for post handler #523

Merged
merged 9 commits into from
Oct 8, 2024

Conversation

TropicalDog17
Copy link

@TropicalDog17 TropicalDog17 commented Oct 4, 2024

Summary of changes

  • Remove ctx.isCheckTx() in posthandler

  • Ensure non-negative coin amounts in fee deduction to prevent panic and better error message.

    // Deduct feeCoins with paid amount  
    if paidAmount.Ceil().RoundInt().Int64() > feeCoins.AmountOf(paidDenom).Int64() {  
       return ctx, errorsmod.Wrapf(sdkerrors.ErrInsufficientFee, "insufficient fee: %s", feeCoins)  
    }  
    feeCoins = feeCoins.Sub(sdk.NewCoin(paidDenom, paidAmount.Ceil().RoundInt()))  
}

Report of required housekeeping

  • Github issue OR spec proposal link
  • Wrote tests
  • Updated API documentation (client/lcd/swagger-ui/swagger.yaml)
  • Added a relevant changelog entry: clog add [section] [stanza] [message]

(FOR ADMIN) Before merging

  • Added appropriate labels to PR
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)
  • Confirm added tests are consistent with the intended behavior of changes
  • Ensure all tests pass

@TropicalDog17 TropicalDog17 marked this pull request as ready for review October 8, 2024 03:20
@TropicalDog17 TropicalDog17 marked this pull request as draft October 8, 2024 06:24
@TropicalDog17 TropicalDog17 marked this pull request as ready for review October 8, 2024 06:55
@StrathCole StrathCole merged commit c2797fb into classic-terra:strath/tax2gas-gasmeter Oct 8, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants