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

imp: fixed multi-chain support and added tests #215

Merged
merged 23 commits into from
Jan 16, 2025
Merged

Conversation

srdtrk
Copy link
Member

@srdtrk srdtrk commented Jan 15, 2025

Description

closes: #59
closes: #216


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.

  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Wrote unit and integration tests.
  • Added relevant natspec and godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

Copy link

codecov bot commented Jan 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.69%. Comparing base (2e5ded2) to head (dc06031).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #215   +/-   ##
=======================================
  Coverage   98.68%   98.69%           
=======================================
  Files          11       11           
  Lines         531      535    +4     
=======================================
+ Hits          524      528    +4     
  Misses          7        7           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@srdtrk srdtrk marked this pull request as ready for review January 15, 2025 13:06
@srdtrk srdtrk changed the title test(e2e): added multi-chain tests imp: fixed multi-chain support and added tests Jan 15, 2025
Copy link
Contributor

@gjermundgaraba gjermundgaraba left a comment

Choose a reason for hiding this comment

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

Mostly just some small adjustments I'd like. The setup and everything looks very good 🚀

ChannelId: ibctesting.FirstChannelID,
CounterpartyChannelId: s.TendermintLightClientID,
Signer: simdUser.FormattedAddress(),
CounterpartyChannelId: ibctesting.FirstClientID,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm OK with hardcoding these, but let's not use these constants. They only make sense in a tendermint-only world. If we are going to use constants we should define some that have clearer names, because this is very hard to read and understand if it is actually correct.

Copy link
Member Author

@srdtrk srdtrk Jan 16, 2025

Choose a reason for hiding this comment

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

I think it is fine for now. We can rethink it in a refactor PR

e2e/interchaintestv8/multichain_test.go Outdated Show resolved Hide resolved
}))

s.Require().True(s.Run("Deploy ethereum contracts with SimdA client", func() {
os.Setenv(testvalues.EnvKeyTendermintRPC, simdA.GetHostRPCAddress())
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is easy to pull out into a helper function somewhere, it might be useful since we have the same code multiple places now.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd say it is not easy. Maybe in a future refactor PR, we can think about how to organize a lot of this better

transferCoin := sdk.NewCoin(simdA.Config().Denom, sdkmath.NewIntFromBigInt(transferAmount))
denomOnEthereum := transfertypes.NewDenom(transferCoin.Denom, transfertypes.NewHop(packet.Payloads[0].DestPort, packet.DestChannel))

ibcERC20Addr, err := s.ics20Contract.IbcERC20Contract(nil, denomOnEthereum.IBCDenom())
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you rename this so we don't have ibcERC20Addr and ibcERC20Address

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll rename it but same thing shows up in other tests as well, it's a short lived variable.

@@ -233,14 +233,18 @@ contract ICS20Transfer is

address erc20Address;
if (originatorChainIsSource) {
// we are the source of this token, so the denom should be the contract address
erc20Address = ICS20Lib.mustHexStringToAddress(packetData.denom);
bool isERC20Address;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a test that catches this so we both document the behavior and make sure there are no regressions on this?

Copy link
Member Author

@srdtrk srdtrk Jan 16, 2025

Choose a reason for hiding this comment

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

I actually wanna revisit this code and potentially change it. I'll create an issue for this as I believe likely the same issue which effects ibc-go also might be effecting this repo. And this should begin a new design discussion which should be out of scope for this PR. Therefore the issue I will create is going to:

Copy link
Member Author

Choose a reason for hiding this comment

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

@srdtrk srdtrk merged commit e792331 into main Jan 16, 2025
58 checks passed
@srdtrk srdtrk deleted the serdar/59-multi-chain-e2e branch January 16, 2025 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants