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

e2e: fee middleware with multiple incentivisers #2073

Merged
merged 3 commits into from
Aug 24, 2022

Conversation

charleenfei
Copy link
Contributor

Description

closes: #1684


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just had a few small suggestions. 👍

Comment on lines +703 to +704
actualFee1 := packets[0].PacketFees[0].Fee
actualFee2 := packets[0].PacketFees[1].Fee
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can add an assertion that s.Require().Len(packets[0].PacketFees, 2) ?

Comment on lines 717 to 727
actualBalance1, err := s.GetChainANativeBalance(ctx, chainAWallet1)
s.Require().NoError(err)

expected1 := testvalues.StartingTokenAmount - walletAmount1.Amount - testFee.Total().AmountOf(chainADenom).Int64()
s.Require().Equal(expected1, actualBalance1)

actualBalance2, err := s.GetChainANativeBalance(ctx, chainAWallet2)
s.Require().NoError(err)

expected2 := testvalues.StartingTokenAmount - testFee.Total().AmountOf(chainADenom).Int64()
s.Require().Equal(expected2, actualBalance2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be worth splitting these up into two separate subtests, in the output of a test failure we would need to rely on line number to know which balance was incorrect.

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! LGTM

e2e/fee_middleware_test.go Outdated Show resolved Hide resolved
@charleenfei charleenfei enabled auto-merge (squash) August 24, 2022 14:01
@charleenfei charleenfei merged commit 9fd7131 into main Aug 24, 2022
@charleenfei charleenfei deleted the charly/e2e_multiple_payers_fee branch August 24, 2022 14:09
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.

E2E: Fee middleware multiple senders
3 participants