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 pallet order #112

Merged
merged 4 commits into from
Feb 16, 2024
Merged

Test pallet order #112

merged 4 commits into from
Feb 16, 2024

Conversation

claravanstaden
Copy link
Collaborator

@claravanstaden claravanstaden commented Feb 8, 2024

Adds a test to verify that the Ethereum Outbound Queue digest is in contained in a block.

I used @yrong's PR https://github.com/Snowfork/snowbridge/pull/1126/files to use the pallet order to finalize the blocks. I verified if I change the runtime pallet order so that the MessageQueue pallet is before the EthereumOutboundQueue pallet, the test fails.

@claravanstaden claravanstaden marked this pull request as ready for review February 9, 2024 09:30
Copy link

codecov bot commented Feb 9, 2024

Codecov Report

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

❗ No coverage uploaded for pull request base (snowbridge@2536e78). Click here to learn what that means.

Files Patch % Lines
bridges/snowbridge/runtime/test-common/src/lib.rs 0.00% 37 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             snowbridge     #112   +/-   ##
=============================================
  Coverage              ?   40.50%           
=============================================
  Files                 ?       51           
  Lines                 ?     3335           
  Branches              ?        0           
=============================================
  Hits                  ?     1351           
  Misses                ?     1984           
  Partials              ?        0           
Flag Coverage Δ
rust 40.50% <0.00%> (?)

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

@alistair-singh alistair-singh left a comment

Choose a reason for hiding this comment

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

Just some comments to help my understanding of the test. But looks good.

bridges/snowbridge/runtime/test-common/src/lib.rs Outdated Show resolved Hide resolved
let mut found_outbound_digest = false;
for digest_item in digest_items {
match digest_item {
DigestItem::Other(_) => found_outbound_digest = true,

Choose a reason for hiding this comment

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

So we assert that the message is queued on a block and then the DigestItem exists in the next block. This test asserts that the pallet order is correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, so if the pallet order is incorrect (i.e. the MessageQueue pallet is before the EthereumOutboundQueue pallet in the construct_runtime macro), our message digest won't be found. I tested this locally, works nicely.

Copy link

@yrong yrong left a comment

Choose a reason for hiding this comment

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

+1

@claravanstaden claravanstaden merged commit bc607a0 into snowbridge Feb 16, 2024
9 checks passed
@claravanstaden claravanstaden deleted the test-pallet-order branch February 16, 2024 12:36
@claravanstaden claravanstaden restored the test-pallet-order branch February 19, 2024 09:30
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.

4 participants