From ec5d836c2a0a67cdd86bea9ee5e0827026d3473b Mon Sep 17 00:00:00 2001 From: cuteolaf Date: Mon, 6 May 2024 12:36:01 -0700 Subject: [PATCH 1/7] update origins & tracks (#111) --- runtime/regionx/src/governance/origins.rs | 3 +-- runtime/regionx/src/governance/tracks.rs | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/runtime/regionx/src/governance/origins.rs b/runtime/regionx/src/governance/origins.rs index 5ee5694c..d366bcec 100644 --- a/runtime/regionx/src/governance/origins.rs +++ b/runtime/regionx/src/governance/origins.rs @@ -15,7 +15,6 @@ pub use pallet_custom_origins::*; -// TODO: investigate warning #[allow(unused_imports)] #[frame_support::pallet] pub mod pallet_custom_origins { @@ -117,7 +116,7 @@ pub mod pallet_custom_origins { SmallTipper = 500 * REGX, BigTipper = 2000 * REGX, SmallSpender = 50_000 * REGX, - MediumSpender = 100_000 * REGX, + MediumSpender = 200_000 * REGX, BigSpender = 500_000 * REGX, } } diff --git a/runtime/regionx/src/governance/tracks.rs b/runtime/regionx/src/governance/tracks.rs index 0cb4a0a7..497bbdd3 100644 --- a/runtime/regionx/src/governance/tracks.rs +++ b/runtime/regionx/src/governance/tracks.rs @@ -181,7 +181,7 @@ impl pallet_referenda::TracksInfo for DelegatedReferendaTr _ => Err(()), } } else { - // Treasury is only controlable with native tokens. + // Treasury is only controllable with native tokens. Err(()) } } @@ -197,7 +197,7 @@ impl pallet_referenda::TracksInfo for NativeReferendaTrack } fn track_for(id: &Self::RuntimeOrigin) -> Result { if let Ok(_system_origin) = frame_system::RawOrigin::try_from(id.clone()) { - // Root is the only avaialable origin for relay chain asset holders. + // Root is the only available origin for relay chain asset holders. Err(()) } else if let Ok(custom_origin) = origins::Origin::try_from(id.clone()) { match custom_origin { From 42d4e469034516586d42420368097404aa089612 Mon Sep 17 00:00:00 2001 From: cuteolaf Date: Mon, 6 May 2024 12:44:44 -0700 Subject: [PATCH 2/7] use typescript for e2e tests (#110) --- .gitignore | 1 + e2e_tests/{common.js => common.ts} | 12 ++- e2e_tests/fee-payment/custom.js | 73 ------------------- e2e_tests/fee-payment/custom.ts | 73 +++++++++++++++++++ e2e_tests/fee-payment/native.js | 18 ----- e2e_tests/fee-payment/native.ts | 18 +++++ e2e_tests/governance/delegated.js | 52 ------------- e2e_tests/governance/delegated.ts | 52 +++++++++++++ e2e_tests/governance/native.js | 35 --------- e2e_tests/governance/native.ts | 35 +++++++++ e2e_tests/package.json | 6 +- e2e_tests/tsconfig.json | 15 ++++ zombienet_tests/0002-native-fee-payment.zndsl | 2 +- zombienet_tests/0003-custom-fee-payment.zndsl | 2 +- .../0004-delegated-governance.zndsl | 2 +- zombienet_tests/0005-native-governance.zndsl | 2 +- 16 files changed, 210 insertions(+), 188 deletions(-) rename e2e_tests/{common.js => common.ts} (72%) delete mode 100644 e2e_tests/fee-payment/custom.js create mode 100644 e2e_tests/fee-payment/custom.ts delete mode 100644 e2e_tests/fee-payment/native.js create mode 100644 e2e_tests/fee-payment/native.ts delete mode 100644 e2e_tests/governance/delegated.js create mode 100644 e2e_tests/governance/delegated.ts delete mode 100644 e2e_tests/governance/native.js create mode 100644 e2e_tests/governance/native.ts create mode 100644 e2e_tests/tsconfig.json diff --git a/.gitignore b/.gitignore index ca01b4c0..6bacf47e 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ bin/ node_modules **/package-lock.json +**/build \ No newline at end of file diff --git a/e2e_tests/common.js b/e2e_tests/common.ts similarity index 72% rename from e2e_tests/common.js rename to e2e_tests/common.ts index 0e5df279..04391000 100644 --- a/e2e_tests/common.js +++ b/e2e_tests/common.ts @@ -1,6 +1,10 @@ -const RELAY_ASSET_ID = 1; +import { ApiPromise } from "@polkadot/api"; +import { SubmittableExtrinsic, SignerOptions } from "@polkadot/api/types"; +import { KeyringPair } from "@polkadot/keyring/types"; -async function submitExtrinsic(signer, call, options) { +const RELAY_ASSET_ID = 1; + +async function submitExtrinsic(signer: KeyringPair, call: SubmittableExtrinsic<"promise">, options: Partial): Promise { return new Promise(async (resolve, reject) => { const unsub = await call.signAndSend(signer, options, (result) => { console.log(`Current status is ${result.status}`); @@ -23,7 +27,7 @@ async function submitExtrinsic(signer, call, options) { }); } -async function setupRelayAsset(api, signer) { +async function setupRelayAsset(api: ApiPromise, signer: KeyringPair) { const assetMetadata = { decimals: 12, name: "ROC", @@ -50,4 +54,4 @@ async function setupRelayAsset(api, signer) { await submitExtrinsic(signer, sudoCall, {}); } -module.exports = { submitExtrinsic, setupRelayAsset, RELAY_ASSET_ID } +export { submitExtrinsic, setupRelayAsset, RELAY_ASSET_ID } diff --git a/e2e_tests/fee-payment/custom.js b/e2e_tests/fee-payment/custom.js deleted file mode 100644 index 6f4d90f9..00000000 --- a/e2e_tests/fee-payment/custom.js +++ /dev/null @@ -1,73 +0,0 @@ -const { ApiPromise, WsProvider, Keyring } = require("@polkadot/api"); -const { submitExtrinsic, setupRelayAsset, RELAY_ASSET_ID } = require("../common"); - -async function run(nodeName, networkInfo, _jsArgs) { - const { wsUri: regionXUri } = networkInfo.nodesByName[nodeName]; - const { wsUri: rococoUri } = networkInfo.nodesByName["rococo-validator01"]; - - const rococoApi = await ApiPromise.create({provider: new WsProvider(rococoUri)}); - const regionXApi = await ApiPromise.create({ - provider: new WsProvider(regionXUri), - signedExtensions: { - ChargeAssetTxPayment: { - extrinsic: { - tip: "Compact", - assetId: "Option", - }, - payload: {}, - }, - }, - }); - - // account to submit tx - const keyring = new zombie.Keyring({ type: "sr25519" }); - const alice = keyring.addFromUri("//Alice"); - - const setXcmVersion = rococoApi.tx.xcmPallet.forceDefaultXcmVersion([3]); - await submitExtrinsic(alice, rococoApi.tx.sudo.sudo(setXcmVersion), {}); - - await setupRelayAsset(regionXApi, alice); - - const receiverKeypair = new Keyring(); - receiverKeypair.addFromAddress(alice.address); - - const feeAssetItem = 0; - const weightLimit = "Unlimited"; - const reserveTransfer = rococoApi.tx.xcmPallet.limitedReserveTransferAssets( - { V3: { parents: 0, interior: { X1: { Parachain: 2000 } } } }, //dest - { - V3: { - parents: 0, - interior: { - X1: { - AccountId32: { - chain: "Any", - id: receiverKeypair.pairs[0].publicKey, - }, - }, - }, - }, - }, //beneficiary - { - V3: [ - { - id: { - Concrete: { parents: 0, interior: "Here" }, - }, - fun: { - Fungible: 10n ** 9n, - }, - }, - ], - }, //asset - feeAssetItem, - weightLimit, - ); - await submitExtrinsic(alice, reserveTransfer, {}); - - // Try to pay for fees with relay chain asset. - const remarkCall = regionXApi.tx.system.remark("0x44"); - await submitExtrinsic(alice, remarkCall, { assetId: RELAY_ASSET_ID }); -} - -module.exports = { run }; diff --git a/e2e_tests/fee-payment/custom.ts b/e2e_tests/fee-payment/custom.ts new file mode 100644 index 00000000..78c59e13 --- /dev/null +++ b/e2e_tests/fee-payment/custom.ts @@ -0,0 +1,73 @@ +import { ApiPromise, WsProvider, Keyring } from "@polkadot/api"; +import { submitExtrinsic, setupRelayAsset, RELAY_ASSET_ID } from "../common"; + +async function run(nodeName: string, networkInfo: any, _jsArgs: any) { + const { wsUri: regionXUri } = networkInfo.nodesByName[nodeName]; + const { wsUri: rococoUri } = networkInfo.nodesByName["rococo-validator01"]; + + const rococoApi = await ApiPromise.create({ provider: new WsProvider(rococoUri) }); + const regionXApi = await ApiPromise.create({ + provider: new WsProvider(regionXUri), + signedExtensions: { + ChargeAssetTxPayment: { + extrinsic: { + tip: "Compact", + assetId: "Option", + }, + payload: {}, + }, + }, + }); + + // account to submit tx + const keyring = new Keyring({ type: "sr25519" }); + const alice = keyring.addFromUri("//Alice"); + + const setXcmVersion = rococoApi.tx.xcmPallet.forceDefaultXcmVersion([3]); + await submitExtrinsic(alice, rococoApi.tx.sudo.sudo(setXcmVersion), {}); + + await setupRelayAsset(regionXApi, alice); + + const receiverKeypair = new Keyring(); + receiverKeypair.addFromAddress(alice.address); + + const feeAssetItem = 0; + const weightLimit = "Unlimited"; + const reserveTransfer = rococoApi.tx.xcmPallet.limitedReserveTransferAssets( + { V3: { parents: 0, interior: { X1: { Parachain: 2000 } } } }, //dest + { + V3: { + parents: 0, + interior: { + X1: { + AccountId32: { + chain: "Any", + id: receiverKeypair.pairs[0].publicKey, + }, + }, + }, + }, + }, //beneficiary + { + V3: [ + { + id: { + Concrete: { parents: 0, interior: "Here" }, + }, + fun: { + Fungible: 10n ** 9n, + }, + }, + ], + }, //asset + feeAssetItem, + weightLimit + ); + await submitExtrinsic(alice, reserveTransfer, {}); + + // Try to pay for fees with relay chain asset. + const remarkCall = regionXApi.tx.system.remark("0x44"); + await submitExtrinsic(alice, remarkCall, { assetId: RELAY_ASSET_ID }); +} + +export { run }; diff --git a/e2e_tests/fee-payment/native.js b/e2e_tests/fee-payment/native.js deleted file mode 100644 index 6598e5c9..00000000 --- a/e2e_tests/fee-payment/native.js +++ /dev/null @@ -1,18 +0,0 @@ -const { ApiPromise, WsProvider } = require("@polkadot/api"); -const { submitExtrinsic } = require("../common"); - -async function run(nodeName, networkInfo, _jsArgs) { - const { wsUri } = networkInfo.nodesByName[nodeName]; - const api = await ApiPromise.create({provider: new WsProvider(wsUri)}); - - // account to submit tx - const keyring = new zombie.Keyring({ type: "sr25519" }); - const alice = keyring.addFromUri("//Alice"); - const bob = keyring.addFromUri("//Bob"); - - const call = api.tx.balances.transferKeepAlive(bob.address, 10n**6n); - const sudo = api.tx.sudo.sudo(call); - await submitExtrinsic(alice, sudo, {}); -} - -module.exports = { run }; diff --git a/e2e_tests/fee-payment/native.ts b/e2e_tests/fee-payment/native.ts new file mode 100644 index 00000000..b4fef856 --- /dev/null +++ b/e2e_tests/fee-payment/native.ts @@ -0,0 +1,18 @@ +import { ApiPromise, Keyring, WsProvider } from "@polkadot/api"; +import { submitExtrinsic } from "../common"; + +async function run(nodeName: string, networkInfo: any, _jsArgs: any) { + const { wsUri } = networkInfo.nodesByName[nodeName]; + const api = await ApiPromise.create({ provider: new WsProvider(wsUri) }); + + // account to submit tx + const keyring = new Keyring({ type: "sr25519" }); + const alice = keyring.addFromUri("//Alice"); + const bob = keyring.addFromUri("//Bob"); + + const call = api.tx.balances.transferKeepAlive(bob.address, 10n ** 6n); + const sudo = api.tx.sudo.sudo(call); + await submitExtrinsic(alice, sudo, {}); +} + +export { run }; diff --git a/e2e_tests/governance/delegated.js b/e2e_tests/governance/delegated.js deleted file mode 100644 index aa073d57..00000000 --- a/e2e_tests/governance/delegated.js +++ /dev/null @@ -1,52 +0,0 @@ -const { ApiPromise, WsProvider, Keyring } = require("@polkadot/api"); -const { submitExtrinsic, setupRelayAsset, RELAY_ASSET_ID } = require("../common"); - -const PREIMAGE_HASH = "0xb8375f7ca0c64a384f2dd643a0d520977f3aae06e64afb8c960891eee5147bd1"; - -async function run(nodeName, networkInfo, _jsArgs) { - const { wsUri } = networkInfo.nodesByName[nodeName]; - const api = await ApiPromise.create({ - provider: new WsProvider(wsUri), - signedExtensions: { - ChargeAssetTxPayment: { - extrinsic: { - tip: "Compact", - assetId: "Option", - }, - payload: {}, - }, - }, - }); - - // account to submit tx - const keyring = new Keyring({ type: "sr25519" }); - const alice = keyring.addFromUri("//Alice"); - const anna = keyring.addFromUri("//Anna"); - - await setupRelayAsset(api, alice); - - const giveBalanceCall = api.tx.tokens.setBalance(anna.address, RELAY_ASSET_ID, 10n ** 18n, 0); - await submitExtrinsic(alice, api.tx.sudo.sudo(giveBalanceCall), {}); - - const remarkCallBytes = api.tx.system.remark("hey").toU8a(); - await submitExtrinsic(alice, api.tx.preimage.notePreimage(remarkCallBytes), {}); - - const submitProposal = api.tx.delegatedReferenda.submit( - { system: "Root" }, - { Lookup: { hash: PREIMAGE_HASH, len: remarkCallBytes.length } }, - { After: 5 }, - ); - await submitExtrinsic(anna, submitProposal, { assetId: RELAY_ASSET_ID }); - - const placeDeposit = api.tx.delegatedReferenda.placeDecisionDeposit(0); - await submitExtrinsic(anna, placeDeposit, { assetId: RELAY_ASSET_ID }); - - const voteCall = api.tx.delegatedConvictionVoting.vote(0, { - // Voting with relay chain tokens. We know this is true; otherwise, this call - // would fail, given that Anna doesn't have 10^16 RegionX tokens. - Standard: { vote: { aye: true, conviction: "None" }, balance: 10n ** 16n }, - }); - await submitExtrinsic(anna, voteCall, { assetId: RELAY_ASSET_ID }); -} - -module.exports = { run }; diff --git a/e2e_tests/governance/delegated.ts b/e2e_tests/governance/delegated.ts new file mode 100644 index 00000000..960428f6 --- /dev/null +++ b/e2e_tests/governance/delegated.ts @@ -0,0 +1,52 @@ +import { ApiPromise, WsProvider, Keyring } from "@polkadot/api"; +import { submitExtrinsic, setupRelayAsset, RELAY_ASSET_ID } from "../common"; + +const PREIMAGE_HASH = "0xb8375f7ca0c64a384f2dd643a0d520977f3aae06e64afb8c960891eee5147bd1"; + +async function run(nodeName: string, networkInfo: any, _jsArgs: any) { + const { wsUri } = networkInfo.nodesByName[nodeName]; + const api = await ApiPromise.create({ + provider: new WsProvider(wsUri), + signedExtensions: { + ChargeAssetTxPayment: { + extrinsic: { + tip: "Compact", + assetId: "Option", + }, + payload: {}, + }, + }, + }); + + // account to submit tx + const keyring = new Keyring({ type: "sr25519" }); + const alice = keyring.addFromUri("//Alice"); + const anna = keyring.addFromUri("//Anna"); + + await setupRelayAsset(api, alice); + + const giveBalanceCall = api.tx.tokens.setBalance(anna.address, RELAY_ASSET_ID, 10n ** 18n, 0); + await submitExtrinsic(alice, api.tx.sudo.sudo(giveBalanceCall), {}); + + const remarkCallBytes = api.tx.system.remark("hey").toU8a(); + await submitExtrinsic(alice, api.tx.preimage.notePreimage(remarkCallBytes), {}); + + const submitProposal = api.tx.delegatedReferenda.submit( + { system: "Root" }, + { Lookup: { hash: PREIMAGE_HASH, len: remarkCallBytes.length } }, + { After: 5 } + ); + await submitExtrinsic(anna, submitProposal, { assetId: RELAY_ASSET_ID }); + + const placeDeposit = api.tx.delegatedReferenda.placeDecisionDeposit(0); + await submitExtrinsic(anna, placeDeposit, { assetId: RELAY_ASSET_ID }); + + const voteCall = api.tx.delegatedConvictionVoting.vote(0, { + // Voting with relay chain tokens. We know this is true; otherwise, this call + // would fail, given that Anna doesn't have 10^16 RegionX tokens. + Standard: { vote: { aye: true, conviction: "None" }, balance: 10n ** 16n }, + }); + await submitExtrinsic(anna, voteCall, { assetId: RELAY_ASSET_ID }); +} + +export { run }; diff --git a/e2e_tests/governance/native.js b/e2e_tests/governance/native.js deleted file mode 100644 index d2b33318..00000000 --- a/e2e_tests/governance/native.js +++ /dev/null @@ -1,35 +0,0 @@ -const { ApiPromise, WsProvider, Keyring } = require("@polkadot/api"); -const { submitExtrinsic, setupRelayAsset } = require("../common"); - -const PREIMAGE_HASH = "0x0ccf4369e9a9f88f035828ba0dd5da645d5c0fa7baa86bdc8d7a80c183ab84c9"; - -async function run(nodeName, networkInfo, _jsArgs) { - const { wsUri } = networkInfo.nodesByName[nodeName]; - const api = await ApiPromise.create({provider: new WsProvider(wsUri)}); - - // account to submit tx - const keyring = new Keyring({ type: "sr25519" }); - const alice = keyring.addFromUri("//Alice"); - - await setupRelayAsset(api, alice); - - const spendCallBytes = api.tx.treasury.spendLocal(10n**6n, alice.address).toU8a(); - await submitExtrinsic(alice, api.tx.preimage.notePreimage(spendCallBytes), {}); - - const submitProposal = api.tx.nativeReferenda.submit( - { Origins: "SmallTipper" }, - { Lookup: { hash: PREIMAGE_HASH, len: spendCallBytes.length } }, - { After: 5 }, - ); - await submitExtrinsic(alice, submitProposal, {}); - - const placeDeposit = api.tx.nativeReferenda.placeDecisionDeposit(0); - await submitExtrinsic(alice, placeDeposit, {}); - - const voteCall = api.tx.nativeConvictionVoting.vote(0, { - Standard: { vote: { aye: true, conviction: "None" }, balance: 10n ** 16n }, - }); - await submitExtrinsic(alice, voteCall, {}); -} - -module.exports = { run }; diff --git a/e2e_tests/governance/native.ts b/e2e_tests/governance/native.ts new file mode 100644 index 00000000..40c78e7d --- /dev/null +++ b/e2e_tests/governance/native.ts @@ -0,0 +1,35 @@ +import { ApiPromise, WsProvider, Keyring } from "@polkadot/api"; +import { submitExtrinsic, setupRelayAsset } from "../common"; + +const PREIMAGE_HASH = "0x0ccf4369e9a9f88f035828ba0dd5da645d5c0fa7baa86bdc8d7a80c183ab84c9"; + +async function run(nodeName: string, networkInfo: any, _jsArgs: any) { + const { wsUri } = networkInfo.nodesByName[nodeName]; + const api = await ApiPromise.create({ provider: new WsProvider(wsUri) }); + + // account to submit tx + const keyring = new Keyring({ type: "sr25519" }); + const alice = keyring.addFromUri("//Alice"); + + await setupRelayAsset(api, alice); + + const spendCallBytes = api.tx.treasury.spendLocal(10n ** 6n, alice.address).toU8a(); + await submitExtrinsic(alice, api.tx.preimage.notePreimage(spendCallBytes), {}); + + const submitProposal = api.tx.nativeReferenda.submit( + { Origins: "SmallTipper" }, + { Lookup: { hash: PREIMAGE_HASH, len: spendCallBytes.length } }, + { After: 5 } + ); + await submitExtrinsic(alice, submitProposal, {}); + + const placeDeposit = api.tx.nativeReferenda.placeDecisionDeposit(0); + await submitExtrinsic(alice, placeDeposit, {}); + + const voteCall = api.tx.nativeConvictionVoting.vote(0, { + Standard: { vote: { aye: true, conviction: "None" }, balance: 10n ** 16n }, + }); + await submitExtrinsic(alice, voteCall, {}); +} + +export { run }; diff --git a/e2e_tests/package.json b/e2e_tests/package.json index 48b819dc..7ddd3a57 100644 --- a/e2e_tests/package.json +++ b/e2e_tests/package.json @@ -4,12 +4,14 @@ "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "build": "npx tsc --outDir build > /dev/null" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { - "@polkadot/api": "^11.0.1" + "@polkadot/api": "^11.0.2", + "@polkadot/keyring": "^12.6.2", + "typescript": "^5.4.5" } } diff --git a/e2e_tests/tsconfig.json b/e2e_tests/tsconfig.json new file mode 100644 index 00000000..e399350e --- /dev/null +++ b/e2e_tests/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "module": "commonjs", + "outDir": "build", + "target": "ES2020", + "strict": true, + "esModuleInterop": true + }, + "include": [ + "**/*.ts" + ], + "exclude": [ + "node_modules" + ] + } \ No newline at end of file diff --git a/zombienet_tests/0002-native-fee-payment.zndsl b/zombienet_tests/0002-native-fee-payment.zndsl index e87c365e..7eaae633 100644 --- a/zombienet_tests/0002-native-fee-payment.zndsl +++ b/zombienet_tests/0002-native-fee-payment.zndsl @@ -7,4 +7,4 @@ bob: is up alice: parachain 2000 is registered within 225 seconds -regionx-collator01: js-script ../e2e_tests/fee-payment/native.js return is 0 within 200 seconds +regionx-collator01: js-script ../e2e_tests/build/fee-payment/native.js return is 0 within 200 seconds diff --git a/zombienet_tests/0003-custom-fee-payment.zndsl b/zombienet_tests/0003-custom-fee-payment.zndsl index 3ed50752..75ec1d28 100644 --- a/zombienet_tests/0003-custom-fee-payment.zndsl +++ b/zombienet_tests/0003-custom-fee-payment.zndsl @@ -7,4 +7,4 @@ rococo-validator02: is up rococo-validator01: parachain 2000 is registered within 225 seconds -regionx-collator01: js-script ../e2e_tests/fee-payment/custom.js return is 0 within 400 seconds +regionx-collator01: js-script ../e2e_tests/build/fee-payment/custom.js return is 0 within 400 seconds diff --git a/zombienet_tests/0004-delegated-governance.zndsl b/zombienet_tests/0004-delegated-governance.zndsl index f81632ce..4c63880c 100644 --- a/zombienet_tests/0004-delegated-governance.zndsl +++ b/zombienet_tests/0004-delegated-governance.zndsl @@ -7,4 +7,4 @@ rococo-validator02: is up rococo-validator01: parachain 2000 is registered within 225 seconds -regionx-collator01: js-script ../e2e_tests/governance/delegated.js return is 0 within 400 seconds +regionx-collator01: js-script ../e2e_tests/build/governance/delegated.js return is 0 within 400 seconds diff --git a/zombienet_tests/0005-native-governance.zndsl b/zombienet_tests/0005-native-governance.zndsl index 896b4767..3830e72c 100644 --- a/zombienet_tests/0005-native-governance.zndsl +++ b/zombienet_tests/0005-native-governance.zndsl @@ -7,4 +7,4 @@ rococo-validator02: is up rococo-validator01: parachain 2000 is registered within 225 seconds -regionx-collator01: js-script ../e2e_tests/governance/native.js return is 0 within 400 seconds +regionx-collator01: js-script ../e2e_tests/build/governance/native.js return is 0 within 400 seconds From 24f7120e722ea9e17f8641a15549a0f3c22f772b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 19:42:42 -0700 Subject: [PATCH 3/7] Bump serde from 1.0.198 to 1.0.200 (#108) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.198 to 1.0.200. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.198...v1.0.200) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cuteolaf --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 29f202f0..ce8563c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11292,9 +11292,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.198" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f" dependencies = [ "serde_derive", ] @@ -11310,9 +11310,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.198" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index c37a292b..3e1de9fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ repository = "https://github.com/RegionX-Labs/RegionX-Node" edition = "2021" [workspace.dependencies] -serde = { version = "1.0.198", default-features = false } +serde = { version = "1.0.200", default-features = false } sha2 = { version = "0.10.8", default-features = false } clap = { version = "4.5.4" } futures = { version = "0.3.29" } From 20dd179980f37f70d93218e243e2230a4dae3881 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 19:43:16 -0700 Subject: [PATCH 4/7] Bump codecov/codecov-action from 4.0.1 to 4.3.1 (#107) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.0.1 to 4.3.1. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v4.0.1...v4.3.1) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cuteolaf --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 80753161..b60b522b 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -43,7 +43,7 @@ jobs: --exclude-files **/mock.rs **/weights/* **/weights.rs \ --out xml - - uses: codecov/codecov-action@v4.0.1 + - uses: codecov/codecov-action@v4.3.1 with: token: ${{ secrets.CODECOV_TOKEN }} slug: RegionX-Labs/RegionX-Node From 06380ab1fcb8cf61b91932906de0aad199fda032 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 19:43:33 -0700 Subject: [PATCH 5/7] Bump color-print from 0.3.5 to 0.3.6 (#97) Bumps [color-print](https://gitlab.com/dajoha/color-print) from 0.3.5 to 0.3.6. - [Commits](https://gitlab.com/dajoha/color-print/compare/v0.3.5...v0.3.6) --- updated-dependencies: - dependency-name: color-print dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cuteolaf --- Cargo.lock | 10 +++++----- Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ce8563c6..59fb3433 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1226,23 +1226,23 @@ dependencies = [ [[package]] name = "color-print" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a858372ff14bab9b1b30ea504f2a4bc534582aee3e42ba2d41d2a7baba63d5d" +checksum = "1ee543c60ff3888934877a5671f45494dd27ed4ba25c6670b9a7576b7ed7a8c0" dependencies = [ "color-print-proc-macro", ] [[package]] name = "color-print-proc-macro" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e37866456a721d0a404439a1adae37a31be4e0055590d053dfe6981e05003f" +checksum = "77ff1a80c5f3cb1ca7c06ffdd71b6a6dd6d8f896c42141fbd43f50ed28dcdb93" dependencies = [ "nom", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.53", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 3e1de9fc..852bba5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ sha2 = { version = "0.10.8", default-features = false } clap = { version = "4.5.4" } futures = { version = "0.3.29" } jsonrpsee = { version = "0.16.3" } -color-print = "0.3.4" +color-print = "0.3.6" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false } hex-literal = { version = "0.4.1" } log = { version = "0.4.20", default-features = false } From 104ce549c9660a3dd3d76da8a795626b9e9b8aa5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 19:43:46 -0700 Subject: [PATCH 6/7] Bump docker/setup-buildx-action from 1 to 3 (#95) Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1 to 3. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/v1...v3) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: cuteolaf --- .github/workflows/smoke.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index 16a38d63..39626cc6 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - uses: ./.github/actions/setup From 3f119436bb1f214ec0f174fddebd366e456e2433 Mon Sep 17 00:00:00 2001 From: cuteolaf Date: Mon, 6 May 2024 23:55:42 -0700 Subject: [PATCH 7/7] Update readme & zombienet test scripts (#112) * update readme * update tests * fix description(zombienet test scripts) --- README.md | 12 ++++++++++++ pallets/regions/README.md | 8 ++++---- zombienet_tests/0004-delegated-governance.zndsl | 2 +- zombienet_tests/0005-native-governance.zndsl | 2 +- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cd0e92c5..b715bdb7 100644 --- a/README.md +++ b/README.md @@ -38,4 +38,16 @@ ``` zombienet-linux -p native test ./zombienet_tests/0003-custom-fee-payment.zndsl + ``` + + - delegated governance(relay chain token holders) + + ``` + zombienet-linux -p native test ./zombienet_tests/0004-delegated-governance.zndsl + ``` + + - native governance(RegionX token holders) + + ``` + zombienet-linux -p native test ./zombienet_tests/0005-native-governance.zndsl ``` \ No newline at end of file diff --git a/pallets/regions/README.md b/pallets/regions/README.md index 942d348a..f863f50b 100644 --- a/pallets/regions/README.md +++ b/pallets/regions/README.md @@ -6,9 +6,9 @@ The path for transferring a region to the RegionX chain is as follows: 1. A user goes to the CoreHub frontend and initiates a cross-chain region transfer. This triggers a `limited_reserve_transfer_assets` call on the Coretime chain, where the asset is specified as a non-fungible asset with the `Index` set to the encoded `RegionId`. -2. Upon receipt on the RegionX parachain, the XCM executor calls the RegionX `AssetTransactor`(yet to be implemented). The `AssetTransactor` handles the incoming region by making a call to the region pallet, specifically the `mint_into` function, where it passes the encoded `RegionId` as the item identifier. +2. Upon receipt on the RegionX parachain, the XCM executor calls the RegionX `AssetTransactor`(yet to be implemented). The `AssetTransactor` handles the incoming region by making a call to the **region** pallet, specifically the `mint_into` function, where it passes the encoded `RegionId` as the item identifier. -3. At this point, the RegionX chain can construct the `RegionId` from the encoded ID. However, it's still missing the region record since that's not part of the ID. mint_into makes a calls the `do_request_region_record` function, which sends an ISMP GET request to fetch the associated data from the Coretime chain. +3. At this point, the RegionX chain can construct the `RegionId` from the encoded ID. However, it's still missing the region record since that's not part of the ID. `mint_into` makes a calls the `do_request_region_record` function, which sends an ISMP GET request to fetch the associated data from the Coretime chain. 4. The ISMP pallet emits a GET request event, which the frontend has been waiting for so far. When the frontend detects a GET request event which contains the region Id of the region the user transferred, it reads the region record from the Coretime chain along with its state proof. @@ -16,6 +16,6 @@ The path for transferring a region to the RegionX chain is as follows: 6. The ISMP pallet verifies the result by checking the proof against the Coretime chain state root, which it obtains from the relay chain. -7. Upon successful validation, the ISMP pallet calls the on_response function implemented in the region pallet, passing the response as an argument. +7. Upon successful validation, the ISMP pallet calls the `on_response` function implemented in the **region** pallet, passing the response as an argument. -8. The region pallet attempts to decode the record and the associated RegionId and writes the region data do the state. +8. The **region** pallet attempts to decode the record and the associated RegionId and writes the region data do the state. diff --git a/zombienet_tests/0004-delegated-governance.zndsl b/zombienet_tests/0004-delegated-governance.zndsl index 4c63880c..3c286414 100644 --- a/zombienet_tests/0004-delegated-governance.zndsl +++ b/zombienet_tests/0004-delegated-governance.zndsl @@ -1,4 +1,4 @@ -Description: Native currency fee payment +Description: Governance by relay chain token holders Network: ./0004-delegated-governance.toml Creds: config diff --git a/zombienet_tests/0005-native-governance.zndsl b/zombienet_tests/0005-native-governance.zndsl index 3830e72c..ee0c02b8 100644 --- a/zombienet_tests/0005-native-governance.zndsl +++ b/zombienet_tests/0005-native-governance.zndsl @@ -1,4 +1,4 @@ -Description: Native currency fee payment +Description: Governance by RegionX token holders Network: ./0005-native-governance.toml Creds: config