From ab2fd8b1703bc8045043899b413999a443260495 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Tue, 23 May 2023 21:32:47 +0200 Subject: [PATCH] Change SA for Rococo/Statemine_1000 + removed `CheckedExtrinsic` (#2627) --- .../runtimes/assets/westmint/src/lib.rs | 3 +- .../contracts/contracts-rococo/src/lib.rs | 2 - .../runtimes/starters/seedling/src/lib.rs | 2 - parachains/runtimes/starters/shell/src/lib.rs | 2 - parachains/runtimes/testing/penpal/src/lib.rs | 3 -- .../testing/rococo-parachain/src/lib.rs | 2 - scripts/bridges_rococo_wococo.sh | 42 ++++++++++--------- scripts/generate_hex_encoded_call/index.js | 2 + 8 files changed, 25 insertions(+), 33 deletions(-) diff --git a/parachains/runtimes/assets/westmint/src/lib.rs b/parachains/runtimes/assets/westmint/src/lib.rs index d4c714b0fa6..510a9a0e564 100644 --- a/parachains/runtimes/assets/westmint/src/lib.rs +++ b/parachains/runtimes/assets/westmint/src/lib.rs @@ -773,8 +773,7 @@ pub type SignedExtra = ( /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; -/// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; + /// Migrations to apply on runtime upgrade. pub type Migrations = (); diff --git a/parachains/runtimes/contracts/contracts-rococo/src/lib.rs b/parachains/runtimes/contracts/contracts-rococo/src/lib.rs index 4266a4219e8..32bd748d803 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/lib.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/lib.rs @@ -94,8 +94,6 @@ pub type SignedExtra = ( /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; -/// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; pub type Migrations = (pallet_contracts::Migration,); diff --git a/parachains/runtimes/starters/seedling/src/lib.rs b/parachains/runtimes/starters/seedling/src/lib.rs index e99ead3a9d6..53179bad0e5 100644 --- a/parachains/runtimes/starters/seedling/src/lib.rs +++ b/parachains/runtimes/starters/seedling/src/lib.rs @@ -226,8 +226,6 @@ pub type SignedExtra = ( /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; -/// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< diff --git a/parachains/runtimes/starters/shell/src/lib.rs b/parachains/runtimes/starters/shell/src/lib.rs index fc87a26f8ee..cbd9185b3bc 100644 --- a/parachains/runtimes/starters/shell/src/lib.rs +++ b/parachains/runtimes/starters/shell/src/lib.rs @@ -257,8 +257,6 @@ pub type SignedExtra = DisallowSigned; /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; -/// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, diff --git a/parachains/runtimes/testing/penpal/src/lib.rs b/parachains/runtimes/testing/penpal/src/lib.rs index 8e06d986df7..4fa161138fd 100644 --- a/parachains/runtimes/testing/penpal/src/lib.rs +++ b/parachains/runtimes/testing/penpal/src/lib.rs @@ -123,9 +123,6 @@ pub type SignedExtra = ( pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; -/// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; - pub type Migrations = (pallet_balances::migration::MigrateToTrackInactive,); diff --git a/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/parachains/runtimes/testing/rococo-parachain/src/lib.rs index bd3e2ede318..8923d1c7cae 100644 --- a/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ b/parachains/runtimes/testing/rococo-parachain/src/lib.rs @@ -612,8 +612,6 @@ pub type SignedExtra = ( /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; -/// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< Runtime, diff --git a/scripts/bridges_rococo_wococo.sh b/scripts/bridges_rococo_wococo.sh index 3d18ba49c0f..2d918e244a9 100755 --- a/scripts/bridges_rococo_wococo.sh +++ b/scripts/bridges_rococo_wococo.sh @@ -7,6 +7,17 @@ STATEMINE_ACCOUNT_SEED_FOR_LOCAL="//Alice" # AccountId: [212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130, 44, 133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125] WOCKMINT_ACCOUNT_ADDRESS_FOR_LOCAL="5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" +# SovereignAccount for `MultiLocation { parents: 2, interior: X2(GlobalConsensus(Rococo), Parachain(1000)) }` => 5CfNu7eH3SJvqqPt3aJh38T8dcFvhGzEohp9tsd41ANhXDnQ +# +# use sp_core::crypto::Ss58Codec; +# println!("{}", +# frame_support::sp_runtime::AccountId32::new( +# GlobalConsensusParachainConvertsFor::::convert_ref( +# MultiLocation { parents: 2, interior: X2(GlobalConsensus(Kusama), Parachain(1000)) }).unwrap() +# ).to_ss58check_with_version(42_u16.into()) +# ); +ROCOCO_STATEMINE_1000_SOVEREIGN_ACCOUNT="5CfNu7eH3SJvqqPt3aJh38T8dcFvhGzEohp9tsd41ANhXDnQ" + # Address: GegTpZJMyzkntLN7NJhRfHDk4GWukLbGSsag6PHrLSrCK4h ROCKMINE2_ACCOUNT_SEED_FOR_ROCOCO="scatter feed race company oxygen trip extra elbow slot bundle auto canoe" @@ -597,19 +608,10 @@ case "$1" in 1014 \ "Rococo" \ 1000 - # drip SovereignAccount for `MultiLocation { parents: 2, interior: X2(GlobalConsensus(Rococo), Parachain(1000)) }` => 5CfNu7eH3SJvqqPt3aJh38T8dcFvhGzEohp9tsd41ANhXDnQ - # - # use sp_core::crypto::Ss58Codec; - # println!("{}", - # frame_support::sp_runtime::AccountId32::new( - # GlobalConsensusParachainConvertsFor::::convert_ref( - # MultiLocation { parents: 2, interior: X2(GlobalConsensus(Kusama), Parachain(1000)) }).unwrap() - # ).to_ss58check_with_version(42_u16.into()) - # ); transfer_balance \ "ws://127.0.0.1:9010" \ "//Alice" \ - "5CfNu7eH3SJvqqPt3aJh38T8dcFvhGzEohp9tsd41ANhXDnQ" \ + "$ROCOCO_STATEMINE_1000_SOVEREIGN_ACCOUNT" \ $((1000000000 + 50000000000 * 20)) # ExistentialDeposit + maxTargetLocationFee * 20 # create foreign assets for native Statemine token (yes, Kusama, because we are using Statemine runtime on rococo) force_create_foreign_asset \ @@ -618,7 +620,7 @@ case "$1" in 1000 \ "ws://127.0.0.1:9010" \ "Kusama" \ - "5CfNu7eH3SJvqqPt3aJh38T8dcFvhGzEohp9tsd41ANhXDnQ" + "$ROCOCO_STATEMINE_1000_SOVEREIGN_ACCOUNT" ;; remove-assets-transfer-from-statemine-local) ensure_polkadot_js_api @@ -637,14 +639,6 @@ case "$1" in "$WOCKMINT_ACCOUNT_ADDRESS_FOR_LOCAL" \ "Wococo" ;; - transfer-asset-from-statemine-rococo) - ensure_polkadot_js_api - transfer_asset_via_bridge \ - "wss://ws-rococo-rockmine2-collator-node-0.parity-testnet.parity.io" \ - "$ROCKMINE2_ACCOUNT_SEED_FOR_ROCOCO" \ - "$WOCKMINT_ACCOUNT_ADDRESS_FOR_ROCOCO" \ - "Wococo" - ;; ping-via-bridge-from-statemine-local) ensure_polkadot_js_api ping_via_bridge \ @@ -653,6 +647,14 @@ case "$1" in "$WOCKMINT_ACCOUNT_ADDRESS_FOR_LOCAL" \ "Wococo" ;; + transfer-asset-from-statemine-rococo) + ensure_polkadot_js_api + transfer_asset_via_bridge \ + "wss://ws-rococo-rockmine2-collator-node-0.parity-testnet.parity.io" \ + "$ROCKMINE2_ACCOUNT_SEED_FOR_ROCOCO" \ + "$WOCKMINT_ACCOUNT_ADDRESS_FOR_ROCOCO" \ + "Wococo" + ;; ping-via-bridge-from-statemine-rococo) ensure_polkadot_js_api ping_via_bridge \ @@ -665,7 +667,7 @@ case "$1" in transfer_balance \ "ws://127.0.0.1:9010" \ "//Alice" \ - "5CfNu7eH3SJvqqPt3aJh38T8dcFvhGzEohp9tsd41ANhXDnQ" \ + "$ROCOCO_STATEMINE_1000_SOVEREIGN_ACCOUNT" \ $((1000000000 + 50000000000 * 20)) ;; stop) diff --git a/scripts/generate_hex_encoded_call/index.js b/scripts/generate_hex_encoded_call/index.js index b135622c335..25e094df905 100644 --- a/scripts/generate_hex_encoded_call/index.js +++ b/scripts/generate_hex_encoded_call/index.js @@ -17,6 +17,7 @@ async function connect(endpoint, types = {}) { function writeHexEncodedBytesToOutput(method, outputFile) { console.log("Payload (hex): ", method.toHex()); console.log("Payload (bytes): ", Array.from(method.toU8a())); + console.log("Payload (plain): ", JSON.stringify(method)); fs.writeFileSync(outputFile, JSON.stringify(Array.from(method.toU8a()))); } @@ -91,6 +92,7 @@ function removeExporterConfig(endpoint, outputFile, bridgedNetwork) { } function forceCreateAsset(endpoint, outputFile, assetId, assetOwnerAccountId, isSufficient, minBalance) { + var isSufficient = isSufficient == "true" ? true : false; console.log(`Generating forceCreateAsset from RPC endpoint: ${endpoint} to outputFile: ${outputFile} based on assetId: ${assetId}, assetOwnerAccountId: ${assetOwnerAccountId}, isSufficient: ${isSufficient}, minBalance: ${minBalance}`); connect(endpoint) .then((api) => {