-
Notifications
You must be signed in to change notification settings - Fork 108
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
Set gateway on start-up #1054
Set gateway on start-up #1054
Conversation
758f9c2
to
9384c1e
Compare
echo "Setting gateway contract" | ||
local storage_key=$(echo $GATEWAY_STORAGE_KEY | cut -c3-) | ||
local gateway=$(echo $GATEWAY_PROXY_CONTRACT | cut -c3-) | ||
local transact_call="0x00040440"$storage_key"50"$gateway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! I would assume it's a System::set_storage()
call and just curious how to generate the storage_key
here, any script for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So basically I modified this unit test to print it out:
The generation of this key is stable across all runtimes:
https://github.com/Snowfork/polkadot-sdk/blob/alistair/gateway-in-storage/substrate/frame/support/src/lib.rs#L333
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@@ -68,6 +68,7 @@ async fn send_token_to_penpal() { | |||
weth.address(), | |||
PENPAL_PARA_ID, | |||
i_gateway::MultiAddress { kind: 1, data: FERDIE.into() }, | |||
4_000_000_000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
4dd7640
to
d642e31
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1054 +/- ##
=======================================
Coverage 81.29% 81.29%
=======================================
Files 54 54
Lines 2240 2240
Branches 71 71
=======================================
Hits 1821 1821
Misses 402 402
Partials 17 17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Polkadot-sdk: Snowfork/polkadot-sdk#66