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 integration test for the ibc tokenfilter #1474

Merged
merged 5 commits into from
Mar 15, 2023
Merged

Conversation

cmwaters
Copy link
Contributor

Closes: #1249

I first explored using interchaintest which similar to testground spun up all necessary infra using docker containers and then exposed some go APIs for executing IBC messages and making assertions. I unfortunately, came across several problems owing to the fact that celestia has made several changes to the cosmos-sdk that interchain test bases assumptions on.

I switched tack, and instead looked at using ibc's own testing framework. There were a few similar complications before (i.e. it's difficult to inject a custom app) but I managed to overcome them and have put together a test suite under testing/tokenfilter that does the following:

  • ensures that native celestia tokens can be sent out from celestia and can return
  • ensures that other chains can't send tokens to celestia chains and that their balance is unaffected.

@MSevey MSevey requested review from a team and rootulp and removed request for a team March 13, 2023 11:59
@MSevey MSevey requested a review from a team March 13, 2023 11:59
@cmwaters cmwaters self-assigned this Mar 13, 2023
rootulp
rootulp previously approved these changes Mar 13, 2023
Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

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

Overall LGTM. No blocking feedback


txConfig := app.GetTxConfig()

// create an account to send transactions from
Copy link
Collaborator

Choose a reason for hiding this comment

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

[question] I'm not sure how this comment is applicable to the line below. Should the comment be moved?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I can cut it out. This entire setup.go page is copy pasted from IBC's testing framework just FYI. Predominantly because our staking.Validator requires an EvmAddress.

testing/tokenfilter/setup.go Outdated Show resolved Hide resolved
testing/tokenfilter/setup.go Outdated Show resolved Hide resolved
testing/tokenfilter/tokenfilter_test.go Show resolved Hide resolved
@evan-forbes evan-forbes mentioned this pull request Mar 13, 2023
2 tasks
evan-forbes
evan-forbes previously approved these changes Mar 13, 2023
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

we have a lot of things in testuil, but I think the testing package makes more sense name wise for some of the things in testutil, so we might want to move some things over to testing after merging this.

ibc's testing suite is really cool!! mentioned this PR in #829, as there might be something that we can consolidate in the future with the testnode package, but I would need to take a much deeper look.


// SetupWithGenesisValSet initializes a new SimApp with a validator set and genesis accounts
// that also act as delegators. For simplicity, each validator is bonded with a delegation
// of one consensus engine unit (10^6) in the default token of the simapp from first genesis
Copy link
Member

Choose a reason for hiding this comment

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

[non blocking question]

For simplicity, each validator is bonded with a delegation
// of one consensus engine unit (10^6)

does this depend on the power reduction passed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so. Honestly I'm not sure. I didn't write it and it doesn't really affect the test

@cmwaters cmwaters dismissed stale reviews from evan-forbes and rootulp via 1afd56f March 14, 2023 08:28
@MSevey MSevey requested a review from a team March 14, 2023 08:29
@cmwaters cmwaters merged commit 953860c into main Mar 15, 2023
@cmwaters cmwaters deleted the cal/tokenfilter-test branch March 15, 2023 14:15
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.

Integration test for IBC connections
3 participants