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

Refactoring Inbound fixture #1125

Merged
merged 18 commits into from
Jan 26, 2024
Merged

Refactoring Inbound fixture #1125

merged 18 commits into from
Jan 26, 2024

Conversation

yrong
Copy link
Contributor

@yrong yrong commented Jan 23, 2024

Requires: Snowfork/polkadot-sdk#106

Refactoring inbound fixtures to a separate crate and reuse it in emulated tests.

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (ef3d640) 75.95% compared to head (ed8b564) 75.77%.

Files Patch % Lines
...n/pallets/inbound-queue/fixtures/src/send_token.rs 0.00% 3 Missing ⚠️
...llets/inbound-queue/fixtures/src/register_token.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1125      +/-   ##
==========================================
- Coverage   75.95%   75.77%   -0.19%     
==========================================
  Files          58       60       +2     
  Lines        2458     2464       +6     
  Branches       72       72              
==========================================
  Hits         1867     1867              
- Misses        574      580       +6     
  Partials       17       17              
Flag Coverage Δ
rust 74.83% <0.00%> (-0.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Collaborator

@vgeddes vgeddes left a comment

Choose a reason for hiding this comment

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

I would prefer a separate crate Ron, even if its just a single file. As we have seen, feature gating introduces a lot of complexity.

Over time we will need to add many fixtures for different messages coming from Ethereum. So could end up being more than a single file.

use sp_std::vec;

#[derive(Clone, RuntimeDebug)]
pub struct InboundQueueTest {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lets rename this to the describe the message content, ie RegisterAsset, SendToken, etc.

Copy link
Contributor Author

@yrong yrong Jan 23, 2024

Choose a reason for hiding this comment

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

@yrong yrong marked this pull request as ready for review January 24, 2024 07:02
Copy link
Contributor

@claravanstaden claravanstaden 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, @yrong! 🥳

relayer/cmd/generate_beacon_data.go Show resolved Hide resolved
relayer/cmd/generate_beacon_data.go Outdated Show resolved Hide resolved
relayer/cmd/generate_beacon_data.go Show resolved Hide resolved
relayer/cmd/generate_beacon_data.go Show resolved Hide resolved
relayer/cmd/generate_beacon_data.go Outdated Show resolved Hide resolved
relayer/cmd/generate_beacon_data.go Outdated Show resolved Hide resolved
smoketest/src/helper.rs Show resolved Hide resolved
Copy link
Contributor

@claravanstaden claravanstaden left a comment

Choose a reason for hiding this comment

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

🚢

use snowbridge_core::inbound::{Log, Message, Proof};
use sp_std::vec;

pub type SendToken = InboundQueueFixture;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think its a bit unnecessary to add this alias for each fixture.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should rather add a doc comment (only if necessary - the function name may be enough) saying that the returned fixture contains a send token message.

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, the function name should be enough. Alias removed in 7faa581

@yrong yrong merged commit 3b17d2a into main Jan 26, 2024
7 checks passed
@yrong yrong deleted the ron/refactoring-inbound-fixture branch January 26, 2024 02: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.

3 participants