Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Test pallet order#112

Merged
claravanstaden merged 4 commits intosnowbridgefrom
test-pallet-order
Feb 16, 2024
Merged

Test pallet order#112
claravanstaden merged 4 commits intosnowbridgefrom
test-pallet-order

Conversation

@claravanstaden
Copy link
Copy Markdown
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
@codecov
Copy link
Copy Markdown

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
Copy Markdown

@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.

let mut found_outbound_digest = false;
for digest_item in digest_items {
match digest_item {
DigestItem::Other(_) => found_outbound_digest = true,
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

@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
@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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants