Skip to content

Add integration tests for the contract upgrade#1749

Merged
yrong merged 15 commits intomainfrom
ron/integration-test-upgrade-202603
Mar 24, 2026
Merged

Add integration tests for the contract upgrade#1749
yrong merged 15 commits intomainfrom
ron/integration-test-upgrade-202603

Conversation

@yrong
Copy link
Copy Markdown
Contributor

@yrong yrong commented Mar 17, 2026

Contract

  • BeefyClient: 0x7cfc5C8b341991993080Af67D940B6aD19a010E1
  • Gateway: 0x36e74FCAAcb07773b144Ca19Ef2e32Fc972aC50b
  • Gateway code hash: 0xe3cfcc0042ad4c819c627fb2a84ba0822d67747a8618a4e1c4eb0c5112b17903

Preimage

➜  control git:(ron/integration-test-upgrade-202603) ✗ cargo run --release --features polkadot --bin snowbridge-preimage -- --format hex upgrade-202603

Preimage Hash: 0xd96bca57bceb4bcb60aed68b6e844a1b86800b8705f172afc3812305b98a883d
Preimage Size: 90
0x1f0005010100a90f050c2f000006020102a7d7d589700101530036e74fcaacb07773b144ca19ef2e32fc972ac50be3cfcc0042ad4c819c627fb2a84ba0822d67747a8618a4e1c4eb0c5112b179030100a0860100000000002000

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.90%. Comparing base (f1ec8a4) to head (714b565).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1749   +/-   ##
=======================================
  Coverage   76.90%   76.90%           
=======================================
  Files          24       24           
  Lines         983      983           
  Branches      186      186           
=======================================
  Hits          756      756           
  Misses        203      203           
  Partials       24       24           
Flag Coverage Δ
solidity 76.90% <ø> (ø)

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yrong yrong changed the title Add integration tests for the 202603 contract upgrade Add integration tests for the contract upgrade Mar 17, 2026
@yrong yrong marked this pull request as ready for review March 18, 2026 10:15
Comment on lines +101 to +102
"1000": "https://polkadot-asset-hub-rpc.polkadot.io",
"1002": "https://polkadot-bridge-hub-rpc.polkadot.io",
Copy link
Copy Markdown
Contributor Author

@yrong yrong Mar 18, 2026

Choose a reason for hiding this comment

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

I encountered an issue where a V2 transfer from AH to Ethereum fails using Dwellir endpoints (although the dry run succeeds), but works when switching to Parity endpoints.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is fine, but we cannot use https, we must use wss. This is because there is an issue with @polkadot/api where https does not receive event notifications for tx finalized which we use.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines 16 to +30
@@ -27,8 +27,8 @@ import {
Command,
TokenInfo,
MintForeignTokenParams
} from "../../src/v1/Types.sol";
import {MultiAddress, multiAddressFromBytes32} from "../../src/v1/MultiAddress.sol";
} from "../src/v1/Types.sol";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can simplify to:

import {                                                                                                                                                                 
      UpgradeParams, SetOperatingModeParams, OperatingMode,
      RegisterForeignTokenParams, ChannelID, ParaID,                                                                                                                       
      InboundMessage, Command, TokenInfo, MintForeignTokenParams                                                                                                           
  } from "../src/v1/Types.sol";

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread .github/workflows/control.yml
Comment on lines +54 to +73
function selectFork24677447() public {
vm.createSelectFork(
"https://virtual.mainnet.eu.rpc.tenderly.co/a2b5dc8d-c06a-40a9-b893-d86dc7c9ecd4",
24_677_447
);
}

function selectFork24681921() public {
vm.createSelectFork(
"https://virtual.mainnet.eu.rpc.tenderly.co/390efc23-bb26-460c-b641-b5275f790bd7",
24_681_921
);
}

function selectFork24683314() public {
vm.createSelectFork(
"https://virtual.mainnet.eu.rpc.tenderly.co/61589e0a-d204-449b-b095-64366ea949cb",
24_683_314
);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we only need a single tenderly virtual testnet for these forks, by passing a different blocknumber to vm.createSelectFork.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@yrong yrong requested a review from vgeddes March 20, 2026 11:18
@yrong yrong merged commit 1201293 into main Mar 24, 2026
6 checks passed
@yrong yrong deleted the ron/integration-test-upgrade-202603 branch March 24, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants