Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Change SA for Rococo/Statemine_1000 + removed CheckedExtrinsic (#2627)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkontur authored May 23, 2023
1 parent 415dd81 commit ab2fd8b
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 33 deletions.
3 changes: 1 addition & 2 deletions parachains/runtimes/assets/westmint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,7 @@ pub type SignedExtra = (
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;

/// Migrations to apply on runtime upgrade.
pub type Migrations = ();

Expand Down
2 changes: 0 additions & 2 deletions parachains/runtimes/contracts/contracts-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ pub type SignedExtra = (
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;

pub type Migrations = (pallet_contracts::Migration<Runtime>,);

Expand Down
2 changes: 0 additions & 2 deletions parachains/runtimes/starters/seedling/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,6 @@ pub type SignedExtra = (
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;

/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Expand Down
2 changes: 0 additions & 2 deletions parachains/runtimes/starters/shell/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,6 @@ pub type SignedExtra = DisallowSigned;
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Runtime,
Expand Down
3 changes: 0 additions & 3 deletions parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ pub type SignedExtra = (
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;

/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;

pub type Migrations =
(pallet_balances::migration::MigrateToTrackInactive<Runtime, xcm_config::CheckingAccount>,);

Expand Down
2 changes: 0 additions & 2 deletions parachains/runtimes/testing/rococo-parachain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,6 @@ pub type SignedExtra = (
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Runtime,
Expand Down
42 changes: 22 additions & 20 deletions scripts/bridges_rococo_wococo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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::<UniversalLocation, [u8; 32]>::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"

Expand Down Expand Up @@ -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::<UniversalLocation, [u8; 32]>::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 \
Expand All @@ -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
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions scripts/generate_hex_encoded_call/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())));
}

Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit ab2fd8b

Please sign in to comment.