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: add fee test with wrong denom order #3493

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

DeVikingMark
Copy link

Add test to verify that transactions with fees in non-standard denomination order are processed correctly.
This ensures that the chain is resilient to different orderings of fee denominations in transactions.

The test creates a transaction with fees ordered as "stake" then "atom" and verifies successful processing.

@DeVikingMark DeVikingMark requested review from a team as code owners January 25, 2025 01:47
@@ -86,7 +91,40 @@ func (s *IntegrationTestSuite) TestSlashing() {
s.testSlashing(chainAPI)
}

// todo add fee test with wrong denom order
func (s *IntegrationTestSuite) TestFeeWithWrongDenomOrder() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good. Can you move this to be a function in e2e_bank_test.go and invoke it from within the TestBank function?

Comment on lines 121 to 125
// The transaction should still be accepted and processed correctly
// despite the fees being in a different order
tx, err := s.chainA.SignAndBroadcastTx(val1.keyInfo, txBuilder)
s.Require().NoError(err)
s.Require().Equal(uint32(0), tx.Code)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to use a require.Eventually block like in

s.Require().Eventually(
to actually validate the send worked.

@DeVikingMark
Copy link
Author

Hey @Eric-Warehime, I've addressed your review comments:

  • Moved the test into e2e_bank_test.go where it belongs
  • Added it to TestBank function
  • Made the test more robust with require.Eventually to properly verify the tx goes through
  • Cleaned up by removing the old test from e2e_test.go

@Eric-Warehime
Copy link
Contributor

Hey @Eric-Warehime, I've addressed your review comments:

  • Moved the test into e2e_bank_test.go where it belongs
  • Added it to TestBank function
  • Made the test more robust with require.Eventually to properly verify the tx goes through
  • Cleaned up by removing the old test from e2e_test.go

Your test is failing and not passing lint.

@Eric-Warehime
Copy link
Contributor

=== RUN   TestIntegrationTestSuite/TestBank/test_fee_with_wrong_denom_order
    e2e_bank_test.go:287: 
        	Error Trace:	/home/runner/work/gaia/gaia/tests/e2e/e2e_bank_test.go:287
        	            				/home/runner/go/pkg/mod/github.com/stretchr/[email protected]/suite/suite.go:115
        	Error:      	Condition never satisfied
        	Test:       	TestIntegrationTestSuite/TestBank/test_fee_with_wrong_denom_order
        	Messages:   	Transaction with wrong denom order should succeed

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