diff --git a/integration-tests/xcm-test/package.json b/integration-tests/xcm-test/package.json index 2f889cac..090d8beb 100644 --- a/integration-tests/xcm-test/package.json +++ b/integration-tests/xcm-test/package.json @@ -11,8 +11,8 @@ ], "scripts": { "test:call": "jest call.spec.ts", - "test:call:update": "jest --updateSnapshot call.spec.ts", - "test:e2e": "jest e2e.spec.ts" + "test:e2e": "jest --forceExit e2e.spec.ts", + "test:exec": "jest --forceExit exec.spec.ts" }, "devDependencies": { "@acala-network/chopsticks-testing": "1.0.1" diff --git a/integration-tests/xcm-test/src/__db__/metadata.db.json b/integration-tests/xcm-test/src/__db__/metadata.db.json new file mode 100644 index 00000000..334628b4 --- /dev/null +++ b/integration-tests/xcm-test/src/__db__/metadata.db.json @@ -0,0 +1,666 @@ +{ + "acala-hydration-aca": { + "updated": 1733052045002, + "destination": { + "fee": "0.008078835878", + "feeAsset": "ACA", + "feeNative": "8078835878" + } + }, + "acala-hydration-ldot": { + "updated": 1733052058146, + "destination": { + "fee": "0.0008920718", + "feeAsset": "LDOT", + "feeNative": "8920718" + } + }, + "ajuna-hydration-ajun": { + "updated": 1733052065923, + "destination": { + "fee": "0.000067081566", + "feeAsset": "AJUN", + "feeNative": "67081566" + } + }, + "assethub-hydration-dot": { + "updated": 1733052086375, + "destination": { + "fee": "0.0001195269", + "feeAsset": "DOT", + "feeNative": "1195269" + } + }, + "assethub-hydration-usdt": { + "updated": 1733052090985, + "destination": { + "fee": "0.001087", + "feeAsset": "USDT", + "feeNative": "1087" + } + }, + "assethub-hydration-usdc": { + "updated": 1733052095664, + "destination": { + "fee": "0.001088", + "feeAsset": "USDC", + "feeNative": "1088" + } + }, + "assethub-hydration-pink": { + "updated": 1733052100268, + "destination": { + "fee": "0.02", + "feeAsset": "USDT", + "feeNative": "20000" + } + }, + "assethub-hydration-ded": { + "updated": 1733052104969, + "destination": { + "fee": "0.02", + "feeAsset": "USDT", + "feeNative": "20000" + } + }, + "assethub-hydration-dota": { + "updated": 1733052109544, + "destination": { + "fee": "0.02", + "feeAsset": "USDT", + "feeNative": "20000" + } + }, + "assethub-polkadot-dot": { + "updated": 1733052116191, + "destination": { + "fee": "0.0021267087", + "feeAsset": "DOT", + "feeNative": "21267087" + } + }, + "assethub-moonbeam-usdt": { + "updated": 1733052129281, + "destination": { + "fee": "0.083585", + "feeAsset": "USDT", + "feeNative": "83585" + } + }, + "assethub-moonbeam-usdc": { + "updated": 1733052140315, + "destination": { + "fee": "10", + "feeAsset": "USDC", + "feeNative": "10000000" + } + }, + "assethub-bifrost-usdt": { + "updated": 1733052203313, + "destination": { + "fee": "0.056145", + "feeAsset": "USDT", + "feeNative": "56145" + } + }, + "assethub-bifrost-usdc": { + "updated": 1733052209041, + "destination": { + "fee": "0.056145", + "feeAsset": "USDC", + "feeNative": "56145" + } + }, + "astar-hydration-astr": { + "updated": 1733052220933, + "destination": { + "fee": "0.010478314008834501", + "feeAsset": "ASTR", + "feeNative": "10478314008834501" + } + }, + "astar-hydration-dot": { + "updated": 1733052227760, + "destination": { + "fee": "0.0442526198", + "feeAsset": "DOT", + "feeNative": "442526198" + } + }, + "bifrost-hydration-bnc": { + "updated": 1733052237876, + "destination": { + "fee": "0.002850509311", + "feeAsset": "BNC", + "feeNative": "2850509311" + } + }, + "bifrost-hydration-vdot": { + "updated": 1733052245509, + "destination": { + "fee": "0.0000693933", + "feeAsset": "vDOT", + "feeNative": "693933" + } + }, + "bifrost-hydration-vastr": { + "updated": 1733052258967, + "destination": { + "fee": "0.008951224627863061", + "feeAsset": "vASTR", + "feeNative": "8951224627863061" + } + }, + "bifrost-hydration-dot": { + "updated": 1733052267141, + "destination": { + "fee": "0.0442526313", + "feeAsset": "DOT", + "feeNative": "442526313" + } + }, + "bifrost-polkadot-dot": { + "updated": 1733052271107, + "destination": { + "fee": "0.0021232099", + "feeAsset": "DOT", + "feeNative": "21232099" + } + }, + "bifrost-assethub-pink": { + "updated": 1733052277851, + "destination": { + "fee": "0.18", + "feeAsset": "USDT", + "feeNative": "180000" + } + }, + "bifrost-assethub-usdt": { + "updated": 1733052282055, + "destination": { + "fee": "0.03219", + "feeAsset": "USDT", + "feeNative": "32190" + } + }, + "bifrost-assethub-usdc": { + "updated": 1733052286595, + "destination": { + "fee": "0.032621", + "feeAsset": "USDC", + "feeNative": "32621" + } + }, + "centrifuge-hydration-cfg": { + "updated": 1733052294872, + "destination": { + "fee": "0.002058201047786664", + "feeAsset": "CFG", + "feeNative": "2058201047786664" + } + }, + "crust-hydration-cru": { + "updated": 1733052316482, + "destination": { + "fee": "0.001231657586", + "feeAsset": "CRU", + "feeNative": "1231657586" + } + }, + "darwinia-hydration-ring": { + "updated": 1733052336352, + "destination": { + "fee": "0.419631906530614329", + "feeAsset": "RING", + "feeNative": "419631906530614329" + } + }, + "hydration-acala-aca": { + "updated": 1733052342909, + "destination": { + "fee": "0.0074712", + "feeAsset": "ACA", + "feeNative": "7471200000" + } + }, + "hydration-acala-ldot": { + "updated": 1733052348280, + "destination": { + "fee": "0.0005854634", + "feeAsset": "LDOT", + "feeNative": "5854634" + } + }, + "hydration-ajuna-ajun": { + "updated": 1733052353339, + "destination": { + "fee": "0.00028", + "feeAsset": "AJUN", + "feeNative": "280000000" + } + }, + "hydration-assethub-dot": { + "updated": 1733052358712, + "destination": { + "fee": "0.1814465", + "feeAsset": "DOT", + "feeNative": "1814465000" + } + }, + "hydration-assethub-usdt": { + "updated": 1733052362542, + "destination": { + "fee": "0.032191", + "feeAsset": "USDT", + "feeNative": "32191" + } + }, + "hydration-assethub-usdc": { + "updated": 1733052366338, + "destination": { + "fee": "0.032621", + "feeAsset": "USDC", + "feeNative": "32621" + } + }, + "hydration-assethub-pink": { + "updated": 1733052370082, + "destination": { + "fee": "0.18", + "feeAsset": "USDT", + "feeNative": "180000" + } + }, + "hydration-assethub-ded": { + "updated": 1733052373807, + "destination": { + "fee": "0.18", + "feeAsset": "USDT", + "feeNative": "180000" + } + }, + "hydration-assethub-dota": { + "updated": 1733052377427, + "destination": { + "fee": "0.18", + "feeAsset": "USDT", + "feeNative": "180000" + } + }, + "hydration-assethub-wud": { + "updated": 1733052381415, + "destination": { + "fee": "0.18", + "feeAsset": "USDT", + "feeNative": "180000" + } + }, + "hydration-astar-astr": { + "updated": 1733052387334, + "destination": { + "fee": "0.038541720104787343", + "feeAsset": "ASTR", + "feeNative": "38541720104787343" + } + }, + "hydration-astar-dot": { + "updated": 1733052393001, + "destination": { + "fee": "0.0442215927", + "feeAsset": "DOT", + "feeNative": "442215927" + } + }, + "hydration-bifrost-bnc": { + "updated": 1733052400688, + "destination": { + "fee": "0.149429366457", + "feeAsset": "BNC", + "feeNative": "149429366457" + } + }, + "hydration-bifrost-vdot": { + "updated": 1733052405398, + "destination": { + "fee": "0.0034644245", + "feeAsset": "vDOT", + "feeNative": "34644245" + } + }, + "hydration-bifrost-vastr": { + "updated": 1733052411250, + "destination": { + "fee": "0.701812389625", + "feeAsset": "vASTR", + "feeNative": "701812389625000000" + } + }, + "hydration-bifrost-dot": { + "updated": 1733052417963, + "destination": { + "fee": "0.0503237563", + "feeAsset": "DOT", + "feeNative": "503237563" + } + }, + "hydration-centrifuge-cfg": { + "updated": 1733052423604, + "destination": { + "fee": "0.0064296", + "feeAsset": "CFG", + "feeNative": "6429600000000000" + } + }, + "hydration-crust-cru": { + "updated": 1733052428766, + "destination": { + "fee": "0.04", + "feeAsset": "CRU", + "feeNative": "40000000000" + } + }, + "hydration-darwinia-ring": { + "updated": 1733052438257, + "destination": { + "fee": "0.040188403234362692", + "feeAsset": "RING", + "feeNative": "40188403234362692" + } + }, + "hydration-interlay-ibtc": { + "updated": 1733052460853, + "destination": { + "fee": "0.00000063", + "feeAsset": "IBTC", + "feeNative": "63" + } + }, + "hydration-interlay-intr": { + "updated": 1733052465574, + "destination": { + "fee": "0.0019213457", + "feeAsset": "INTR", + "feeNative": "19213457" + } + }, + "hydration-interlay-dot": { + "updated": 1733052472738, + "destination": { + "fee": "0.045934345", + "feeAsset": "DOT", + "feeNative": "459343450" + } + }, + "hydration-interlay-hdx": { + "updated": 1733052477039, + "destination": { + "fee": "0.405777777777", + "feeAsset": "HDX", + "feeNative": "405777777777" + } + }, + "hydration-kilt-kilt": { + "updated": 1733052485143, + "destination": { + "fee": "0.000000000027609", + "feeAsset": "KILT", + "feeNative": "27609" + } + }, + "hydration-moonbeam-hdx": { + "updated": 1733052497109, + "destination": { + "fee": "3.488962557199", + "feeAsset": "HDX", + "feeNative": "3488962557199" + } + }, + "hydration-moonbeam-glmr": { + "updated": 1733052509129, + "destination": { + "fee": "0.0095040525", + "feeAsset": "GLMR", + "feeNative": "9504052500000000" + } + }, + "hydration-moonbeam-dot": { + "updated": 1733052521428, + "destination": { + "fee": "0.0513335994", + "feeAsset": "DOT", + "feeNative": "513335994" + } + }, + "hydration-moonbeam-dai_mwh": { + "updated": 1733052549864, + "destination": { + "fee": "0.08", + "feeAsset": "GLMR", + "feeNative": "80000000000000000" + } + }, + "hydration-moonbeam-usdc_mwh": { + "updated": 1733052580192, + "destination": { + "fee": "0.08", + "feeAsset": "GLMR", + "feeNative": "80000000000000000" + } + }, + "hydration-moonbeam-usdt_mwh": { + "updated": 1733052616013, + "destination": { + "fee": "0.08", + "feeAsset": "GLMR", + "feeNative": "80000000000000000" + } + }, + "hydration-moonbeam-wbtc_mwh": { + "updated": 1733052640488, + "destination": { + "fee": "0.08", + "feeAsset": "GLMR", + "feeNative": "80000000000000000" + } + }, + "hydration-moonbeam-weth_mwh": { + "updated": 1733052670217, + "destination": { + "fee": "0.08", + "feeAsset": "GLMR", + "feeNative": "80000000000000000" + } + }, + "hydration-mythos-myth": { + "updated": 1733052676814, + "destination": { + "fee": "0.262144", + "feeAsset": "MYTH", + "feeNative": "262144000000000000" + } + }, + "hydration-polkadot-dot": { + "updated": 1733052680598, + "destination": { + "fee": "0.0021232099", + "feeAsset": "DOT", + "feeNative": "21232099" + } + }, + "hydration-pendulum-pen": { + "updated": 1733052698653, + "destination": { + "fee": "1", + "feeAsset": "PEN", + "feeNative": "1000000000000" + } + }, + "hydration-subsocial-sub": { + "updated": 1733052713080, + "destination": { + "fee": "0.64", + "feeAsset": "SUB", + "feeNative": "6400000000" + } + }, + "hydration-unique-unq": { + "updated": 1733052722275, + "destination": { + "fee": "0", + "feeAsset": "UNQ", + "feeNative": "0" + } + }, + "hydration-zeitgeist-ztg": { + "updated": 1733052727901, + "destination": { + "fee": "0.0064296", + "feeAsset": "ZTG", + "feeNative": "64296000" + } + }, + "hydration-zeitgeist-glmr": { + "updated": 1733052740699, + "destination": { + "fee": "0.0062726556", + "feeAsset": "GLMR", + "feeNative": "6272655600000000" + } + }, + "hydration-zeitgeist-usdc_mwh": { + "updated": 1733052753318, + "destination": { + "fee": "0.1", + "feeAsset": "GLMR", + "feeNative": "100000000000000000" + } + }, + "kilt-hydration-kilt": { + "updated": 1733052758512, + "destination": { + "fee": "0.005859321444802", + "feeAsset": "KILT", + "feeNative": "5859321444802" + } + }, + "interlay-hydration-intr": { + "updated": 1733052764018, + "destination": { + "fee": "0.058615515", + "feeAsset": "INTR", + "feeNative": "586155150" + } + }, + "interlay-hydration-ibtc": { + "updated": 1733052769063, + "destination": { + "fee": "0.01137864", + "feeAsset": "INTR", + "feeNative": "113786400" + } + }, + "interlay-hydration-dot": { + "updated": 1733052775210, + "destination": { + "fee": "0.044252679", + "feeAsset": "DOT", + "feeNative": "442526790" + } + }, + "interlay-hydration-hdx": { + "updated": 1733052780380, + "destination": { + "fee": "0.062262236086", + "feeAsset": "HDX", + "feeNative": "62262236086" + } + }, + "mythos-hydration-myth": { + "updated": 1733052785382, + "destination": { + "fee": "0.00309415802553245", + "feeAsset": "MYTH", + "feeNative": "3094158025532450" + } + }, + "mythos-assethub-myth": { + "updated": 1733052788075, + "destination": { + "fee": "0.045957304441075014", + "feeAsset": "MYTH", + "feeNative": "45957304441075014" + } + }, + "pendulum-hydration-pen": { + "updated": 1733052796768, + "destination": { + "fee": "0.014885684029", + "feeAsset": "PEN", + "feeNative": "14885684029" + } + }, + "polkadot-hydration-dot": { + "updated": 1733052801864, + "destination": { + "fee": "0.0001196119", + "feeAsset": "DOT", + "feeNative": "1196119" + } + }, + "polkadot-bifrost-dot": { + "updated": 1733052805886, + "destination": { + "fee": "0.0061906729", + "feeAsset": "DOT", + "feeNative": "61906729" + } + }, + "polkadot-assethub-dot": { + "updated": 1733052808886, + "destination": { + "fee": "0.0017965", + "feeAsset": "DOT", + "feeNative": "17965000" + } + }, + "subsocial-hydration-sub": { + "updated": 1733052814849, + "destination": { + "fee": "0.6530672671", + "feeAsset": "SUB", + "feeNative": "6530672671" + } + }, + "unique-hydration-unq": { + "updated": 1733052824284, + "destination": { + "fee": "0.13710473938737098", + "feeAsset": "UNQ", + "feeNative": "137104739387370980" + } + }, + "zeitgeist-hydration-ztg": { + "updated": 1733052829260, + "destination": { + "fee": "0.0619517587", + "feeAsset": "ZTG", + "feeNative": "619517587" + } + }, + "zeitgeist-hydration-glmr": { + "updated": 1733052843040, + "destination": { + "fee": "0.00791297870452645", + "feeAsset": "GLMR", + "feeNative": "7912978704526450" + } + }, + "zeitgeist-hydration-usdc_mwh": { + "updated": 1733052864479, + "destination": { + "fee": "0.1", + "feeAsset": "GLMR", + "feeNative": "100000000000000000" + } + } +} \ No newline at end of file diff --git a/integration-tests/xcm-test/src/__snapshots__/e2e.spec.ts.snap b/integration-tests/xcm-test/src/__snapshots__/e2e.spec.ts.snap index 294634bd..e1807ce8 100644 --- a/integration-tests/xcm-test/src/__snapshots__/e2e.spec.ts.snap +++ b/integration-tests/xcm-test/src/__snapshots__/e2e.spec.ts.snap @@ -1,5 +1,586 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Wallet with XCM config should result in valid Polkadot transfer for Acala -> Hydration ACA [aca] transfer 1`] = ` +Array [ + "acala-hydration-aca", + "0xf8043600000000a0724e18090000000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Acala -> Hydration LDOT [ldot] transfer 1`] = ` +Array [ + "acala-hydration-ldot", + "0xf8043600000300e8764817000000000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Ajuna -> Hydration AJUN [ajun] transfer 1`] = ` +Array [ + "ajuna-hydration-ajun", + "0xf40423000000a0724e18090000000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for AssetHub -> Bifrost USDC [usdc] transfer 1`] = ` +Array [ + "assethub-bifrost-usdc", + "0x0901041f0803010100b91f030001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0304000002043205e51400025a62020000000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for AssetHub -> Bifrost USDT [usdt] transfer 1`] = ` +Array [ + "assethub-bifrost-usdt", + "0x0901041f0803010100b91f030001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0304000002043205011f00025a62020000000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for AssetHub -> Hydration DED [ded] transfer 1`] = ` +Array [ + "assethub-hydration-ded", + "0x4101041f0803010100c91f030001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee030800000204320578000700e8764817000002043205011f00823801000100000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for AssetHub -> Hydration DOT [dot] transfer 1`] = ` +Array [ + "assethub-hydration-dot", + "0xfc041f0803010100c91f030001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0304000100000700e87648170000000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for AssetHub -> Hydration DOTA [dota] transfer 1`] = ` +Array [ + "assethub-hydration-dota", + "0x3901041f0803010100c91f030001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee03080000020432054800821a0600000002043205011f00823801000100000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for AssetHub -> Hydration PINK [pink] transfer 1`] = ` +Array [ + "assethub-hydration-pink", + "0x4101041f0803010100c91f030001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee03080000020432055c000700e8764817000002043205011f00823801000100000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for AssetHub -> Hydration USDC [usdc] transfer 1`] = ` +Array [ + "assethub-hydration-usdc", + "0x0901041f0803010100c91f030001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0304000002043205e51400025a62020000000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for AssetHub -> Hydration USDT [usdt] transfer 1`] = ` +Array [ + "assethub-hydration-usdt", + "0x0901041f0803010100c91f030001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0304000002043205011f00025a62020000000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for AssetHub -> Moonbeam USDC [usdc] transfer 1`] = ` +Array [ + "assethub-moonbeam-usdc", + "0xd8041f0803010100511f0300010300f24ff3a9cf04c71dbc94d0b566f7a27b94566cac0304000002043205e51400025a62020000000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for AssetHub -> Moonbeam USDT [usdt] transfer 1`] = ` +Array [ + "assethub-moonbeam-usdt", + "0xd8041f0803010100511f0300010300f24ff3a9cf04c71dbc94d0b566f7a27b94566cac0304000002043205011f00025a62020000000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for AssetHub -> Polkadot DOT [dot] transfer 1`] = ` +Array [ + "assethub-polkadot-dot", + "0xf0041f09010100010001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0104000100000700e87648170000000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Astar -> Hydration ASTR [astr] transfer 1`] = ` +Array [ + "astar-hydration-astr", + "0x050104330203010100c91f030001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee030400000000130000e8890423c78a00000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Astar -> Hydration DOT [dot] transfer 1`] = ` +Array [ + "astar-hydration-dot", + "0x3101043700ffffffffffffffffffffffffffffffff00e8764817000000000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Bifrost -> AssetHub PINK [pink] transfer 1`] = ` +Array [ + "bifrost-assethub-pink", + "0x4d01044605030800010300a10f0432055c000700e876481700010300a10f043205011f0082fc0a000100000003010200a10f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Bifrost -> AssetHub USDC [usdc] transfer 1`] = ` +Array [ + "bifrost-assethub-usdc", + "0x0901044605030400010300a10f043205e51400025a62020000000003010200a10f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Bifrost -> AssetHub USDT [usdt] transfer 1`] = ` +Array [ + "bifrost-assethub-usdt", + "0x0901044605030400010300a10f043205011f00025a62020000000003010200a10f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Bifrost -> Hydration BNC [bnc] transfer 1`] = ` +Array [ + "bifrost-hydration-bnc", + "0xf8044600000100a0724e18090000000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Bifrost -> Hydration DOT [dot] transfer 1`] = ` +Array [ + "bifrost-hydration-dot", + "0xf8044600080000e8764817000000000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Bifrost -> Hydration vASTR [vastr] transfer 1`] = ` +Array [ + "bifrost-hydration-vastr", + "0xf804460009030000e8890423c78a000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Bifrost -> Hydration vDOT [vdot] transfer 1`] = ` +Array [ + "bifrost-hydration-vdot", + "0xf8044600090000e8764817000000000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Bifrost -> Polkadot DOT [dot] transfer 1`] = ` +Array [ + "bifrost-polkadot-dot", + "0xec044600080000e87648170000000000000000000000030101010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Centrifuge -> Hydration CFG [cfg] transfer 1`] = ` +Array [ + "centrifuge-hydration-cfg", + "0xf4047c00000000e8890423c78a000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Crust network -> Hydration CRU [cru] transfer 1`] = ` +Array [ + "crust-hydration-cru", + "0xf4047d000000a0724e18090000000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Darwinia -> Hydration RING [ring] transfer 1`] = ` +Array [ + "darwinia-hydration-ring", + "0xf4042e00000000e8890423c78a000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Acala ACA [aca] transfer 1`] = ` +Array [ + "hydration-acala-aca", + "0x0101048900a3420f0000a0724e18090000000000000000000003010200411f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Acala LDOT [ldot] transfer 1`] = ` +Array [ + "hydration-acala-ldot", + "0x0101048900a4420f0000e8764817000000000000000000000003010200411f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Ajuna AJUN [ajun] transfer 1`] = ` +Array [ + "hydration-ajuna-ajun", + "0x01010489002000000000a0724e180900000000000000000000030102000d20010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> AssetHub DED [ded] transfer 1`] = ` +Array [ + "hydration-assethub-ded", + "0x4d01048905030800010300a10f04320578000700e876481700010300a10f043205011f0082fc0a000100000003010200a10f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> AssetHub DOT [dot] transfer 1`] = ` +Array [ + "hydration-assethub-dot", + "0x0d01046b0d04010100a10f04040100000700e8764817020401000204040d01000001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> AssetHub DOTA [dota] transfer 1`] = ` +Array [ + "hydration-assethub-dota", + "0x4501048905030800010300a10f0432054800821a060000010300a10f043205011f0082fc0a000100000003010200a10f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> AssetHub PINK [pink] transfer 1`] = ` +Array [ + "hydration-assethub-pink", + "0x4d01048905030800010300a10f0432055c000700e876481700010300a10f043205011f0082fc0a000100000003010200a10f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> AssetHub USDC [usdc] transfer 1`] = ` +Array [ + "hydration-assethub-usdc", + "0xf40489010300010300a10f043205e51400025a620203010200a10f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> AssetHub USDT [usdt] transfer 1`] = ` +Array [ + "hydration-assethub-usdt", + "0xf40489010300010300a10f043205011f00025a620203010200a10f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> AssetHub WUD [wud] transfer 1`] = ` +Array [ + "hydration-assethub-wud", + "0x5901048905030800010300a10f043205011f0082fc0a0000010300a10f043205a6e90100000700e87648170000000003010200a10f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Astar ASTR [astr] transfer 1`] = ` +Array [ + "hydration-astar-astr", + "0x0101048900090000000000e8890423c78a000000000000000003010200591f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Astar DOT [dot] transfer 1`] = ` +Array [ + "hydration-astar-dot", + "0x01010489000500000000e8764817000000000000000000000003010200591f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Bifrost BNC [bnc] transfer 1`] = ` +Array [ + "hydration-bifrost-bnc", + "0x01010489000e00000000a0724e18090000000000000000000003010200b91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Bifrost DOT [dot] transfer 1`] = ` +Array [ + "hydration-bifrost-dot", + "0x01010489000500000000e8764817000000000000000000000003010200b91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Bifrost vASTR [vastr] transfer 1`] = ` +Array [ + "hydration-bifrost-vastr", + "0x0101048900210000000000e8890423c78a000000000000000003010200b91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Bifrost vDOT [vdot] transfer 1`] = ` +Array [ + "hydration-bifrost-vdot", + "0x01010489000f00000000e8764817000000000000000000000003010200b91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Centrifuge CFG [cfg] transfer 1`] = ` +Array [ + "hydration-centrifuge-cfg", + "0x01010489000d0000000000e8890423c78a000000000000000003010200bd1f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Crust network CRU [cru] transfer 1`] = ` +Array [ + "hydration-crust-cru", + "0x01010489001b00000000a0724e18090000000000000000000003010200611f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Darwinia RING [ring] transfer 1`] = ` +Array [ + "hydration-darwinia-ring", + "0xd00489001f0000000000e8890423c78a000000000000000003010200f91f0300f24ff3a9cf04c71dbc94d0b566f7a27b94566cac00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Interlay DOT [dot] transfer 1`] = ` +Array [ + "hydration-interlay-dot", + "0x01010489000500000000e8764817000000000000000000000003010200c11f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Interlay HDX [hdx] transfer 1`] = ` +Array [ + "hydration-interlay-hdx", + "0x01010489000000000000a0724e18090000000000000000000003010200c11f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Interlay IBTC [ibtc] transfer 1`] = ` +Array [ + "hydration-interlay-ibtc", + "0x01010489000b00000000ca9a3b00000000000000000000000003010200c11f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Interlay INTR [intr] transfer 1`] = ` +Array [ + "hydration-interlay-intr", + "0x01010489001100000000e8764817000000000000000000000003010200c11f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Kilt KILT [kilt] transfer 1`] = ` +Array [ + "hydration-kilt-kilt", + "0x01010489001c0000000000c16ff28623000000000000000000030102009920010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Moonbeam DAI [dai_mwh] transfer 1`] = ` +Array [ + "hydration-moonbeam-dai_mwh", + "0x350104890408120000000000e8890423c78a0000000000000000100000000000087e93371c0100000000000000000100000003010200511f0300f24ff3a9cf04c71dbc94d0b566f7a27b94566cac00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Moonbeam DOT [dot] transfer 1`] = ` +Array [ + "hydration-moonbeam-dot", + "0xd00489000500000000e8764817000000000000000000000003010200511f0300f24ff3a9cf04c71dbc94d0b566f7a27b94566cac00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Moonbeam GLMR [glmr] transfer 1`] = ` +Array [ + "hydration-moonbeam-glmr", + "0xd0048900100000000000e8890423c78a000000000000000003010200511f0300f24ff3a9cf04c71dbc94d0b566f7a27b94566cac00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Moonbeam HDX [hdx] transfer 1`] = ` +Array [ + "hydration-moonbeam-hdx", + "0xd00489000000000000a0724e18090000000000000000000003010200511f0300f24ff3a9cf04c71dbc94d0b566f7a27b94566cac00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Moonbeam USDC [usdc_mwh] transfer 1`] = ` +Array [ + "hydration-moonbeam-usdc_mwh", + "0x3501048904081500000080969800000000000000000000000000100000000000087e93371c0100000000000000000100000003010200511f0300f24ff3a9cf04c71dbc94d0b566f7a27b94566cac00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Moonbeam USDT [usdt_mwh] transfer 1`] = ` +Array [ + "hydration-moonbeam-usdt_mwh", + "0x3501048904081700000080969800000000000000000000000000100000000000087e93371c0100000000000000000100000003010200511f0300f24ff3a9cf04c71dbc94d0b566f7a27b94566cac00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Moonbeam WBTC [wbtc_mwh] transfer 1`] = ` +Array [ + "hydration-moonbeam-wbtc_mwh", + "0x3501048904081300000000ca9a3b000000000000000000000000100000000000087e93371c0100000000000000000100000003010200511f0300f24ff3a9cf04c71dbc94d0b566f7a27b94566cac00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Moonbeam WETH [weth_mwh] transfer 1`] = ` +Array [ + "hydration-moonbeam-weth_mwh", + "0x350104890408140000000000e8890423c78a0000000000000000100000000000087e93371c0100000000000000000100000003010200511f0300f24ff3a9cf04c71dbc94d0b566f7a27b94566cac00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Mythos MYTH [myth] transfer 1`] = ` +Array [ + "hydration-mythos-myth", + "0xd00489001e0000000000e8890423c78a000000000000000003010200a5340300f24ff3a9cf04c71dbc94d0b566f7a27b94566cac00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Pendulum PEN [pen] transfer 1`] = ` +Array [ + "hydration-pendulum-pen", + "0x010104890091420f0000a0724e18090000000000000000000003010200b920010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Polkadot DOT [dot] transfer 1`] = ` +Array [ + "hydration-polkadot-dot", + "0xf40489000500000000e87648170000000000000000000000030101010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Subsocial SUB [sub] transfer 1`] = ` +Array [ + "hydration-subsocial-sub", + "0x01010489001800000000e8764817000000000000000000000003010200d520010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Unique network UNQ [unq] transfer 1`] = ` +Array [ + "hydration-unique-unq", + "0x0101048900190000000000e8890423c78a000000000000000003010200d51f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Zeitgeist GLMR [glmr] transfer 1`] = ` +Array [ + "hydration-zeitgeist-glmr", + "0x0101048900100000000000e8890423c78a000000000000000003010200b120010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Zeitgeist USDC [usdc_mwh] transfer 1`] = ` +Array [ + "hydration-zeitgeist-usdc_mwh", + "0x65010489040815000000809698000000000000000000000000001000000000008a5d7845630100000000000000000100000003010200b120010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Hydration -> Zeitgeist ZTG [ztg] transfer 1`] = ` +Array [ + "hydration-zeitgeist-ztg", + "0x01010489000c00000000e8764817000000000000000000000003010200b120010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Interlay -> Hydration DOT [dot] transfer 1`] = ` +Array [ + "interlay-hydration-dot", + "0xf8045e00000000e8764817000000000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Interlay -> Hydration HDX [hdx] transfer 1`] = ` +Array [ + "interlay-hydration-hdx", + "0x0501045e00010d00000000a0724e18090000000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Interlay -> Hydration IBTC [ibtc] transfer 1`] = ` +Array [ + "interlay-hydration-ibtc", + "0xf8045e00000100ca9a3b00000000000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Interlay -> Hydration INTR [intr] transfer 1`] = ` +Array [ + "interlay-hydration-intr", + "0xf8045e00000200e8764817000000000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Kilt -> Hydration KILT [kilt] transfer 1`] = ` +Array [ + "kilt-hydration-kilt", + "0x050104530803010100c91f030001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0304000000000f0000c16ff286230000000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Mythos -> AssetHub MYTH [myth] transfer 1`] = ` +Array [ + "mythos-assethub-myth", + "0x0501041f0904010100a10f040001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0404000000130000e8890423c78a0000000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Mythos -> Hydration MYTH [myth] transfer 1`] = ` +Array [ + "mythos-hydration-myth", + "0x0901041f0803010100c91f030001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee030400000000130000e8890423c78a0000000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Pendulum -> Hydration PEN [pen] transfer 1`] = ` +Array [ + "pendulum-hydration-pen", + "0xf40436000000a0724e18090000000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Polkadot -> AssetHub DOT [dot] transfer 1`] = ` +Array [ + "polkadot-assethub-dot", + "0xfc04630903000100a10f030001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0304000000000700e87648170000000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Polkadot -> Bifrost DOT [dot] transfer 1`] = ` +Array [ + "polkadot-bifrost-dot", + "0xfc04630803000100b91f030001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0304000000000700e87648170000000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Polkadot -> Hydration DOT [dot] transfer 1`] = ` +Array [ + "polkadot-hydration-dot", + "0xfc04630803000100c91f030001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0304000000000700e87648170000000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Subsocial -> Hydration SUB [sub] transfer 1`] = ` +Array [ + "subsocial-hydration-sub", + "0xfc041f0803010100c91f030001010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee0304000000000700e87648170000000000", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Unique network -> Hydration UNQ [unq] transfer 1`] = ` +Array [ + "unique-hydration-unq", + "0x0101042600000000000000e8890423c78a000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Zeitgeist -> Hydration GLMR [glmr] transfer 1`] = ` +Array [ + "zeitgeist-hydration-glmr", + "0x0501047e0005030000000000e8890423c78a000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Zeitgeist -> Hydration USDC [usdc_mwh] transfer 1`] = ` +Array [ + "zeitgeist-hydration-usdc_mwh", + "0x6d01047e0408050100000080969800000000000000000000000000050300000000008a5d7845630100000000000000000100000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + +exports[`Wallet with XCM config should result in valid Polkadot transfer for Zeitgeist -> Hydration ZTG [ztg] transfer 1`] = ` +Array [ + "zeitgeist-hydration-ztg", + "0xf4047e000400e8764817000000000000000000000003010200c91f010088dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee00", +] +`; + exports[`Wallet with XCM config should result in valid transfer for Ajuna -> Hydration AJUN [ajun] transfer 1`] = ` Array [ "ajuna-hydration-ajun", diff --git a/integration-tests/xcm-test/src/call.spec.ts b/integration-tests/xcm-test/src/call.spec.ts index 739f6773..256b7e31 100644 --- a/integration-tests/xcm-test/src/call.spec.ts +++ b/integration-tests/xcm-test/src/call.spec.ts @@ -3,8 +3,9 @@ import { Wallet } from '@galacticcouncil/xcm-sdk'; import console from 'console'; -import { setup, xcm } from './mock'; -import { getRouteInfo } from './utils'; +import { setup, xcm } from './ctx/call'; + +import { getRouteInfo } from './utils/route'; const jestConsole = console; @@ -12,29 +13,29 @@ const { configService, init } = setup; const { runXcm } = xcm; const getPolkadotChains = () => { - const blacklist: string[] = ['acala-evm', 'nodle']; + const skipFor: string[] = ['acala-evm', 'nodle']; const chains = Array.from(configService.chains.values()) .filter( (c) => c.ecosystem === ChainEcosystem.Polkadot || c.ecosystem === ChainEcosystem.Ethereum ) - .filter((c) => !blacklist.includes(c.key)); + .filter((c) => !skipFor.includes(c.key)); return { - blacklist, + skipFor, chains, }; }; const getKusamaChains = () => { - const blacklist: string[] = []; + const skipFor: string[] = []; const chains = Array.from(configService.chains.values()) .filter((c) => c.ecosystem === ChainEcosystem.Kusama) - .filter((c) => !blacklist.includes(c.key)); + .filter((c) => !skipFor.includes(c.key)); return { - blacklist, + skipFor, chains, }; }; @@ -69,10 +70,10 @@ describe('Wallet with XCM config', () => { const { chain, routes } = config; for (const route of Array.from(routes.values())) { - const { blacklist } = polkadot; + const { skipFor } = polkadot; const { destination } = route; - if (blacklist.includes(destination.chain.key)) { + if (skipFor.includes(destination.chain.key)) { continue; } @@ -102,10 +103,10 @@ describe('Wallet with XCM config', () => { const { chain, routes } = config; for (const route of Array.from(routes.values())) { - const { blacklist } = kusama; + const { skipFor } = kusama; const { destination } = route; - if (blacklist.includes(destination.chain.key)) { + if (skipFor.includes(destination.chain.key)) { continue; } diff --git a/integration-tests/xcm-test/src/mock/account.ts b/integration-tests/xcm-test/src/ctx/call/account.ts similarity index 100% rename from integration-tests/xcm-test/src/mock/account.ts rename to integration-tests/xcm-test/src/ctx/call/account.ts diff --git a/integration-tests/xcm-test/src/mock/amount.ts b/integration-tests/xcm-test/src/ctx/call/amount.ts similarity index 100% rename from integration-tests/xcm-test/src/mock/amount.ts rename to integration-tests/xcm-test/src/ctx/call/amount.ts diff --git a/integration-tests/xcm-test/src/mock/index.ts b/integration-tests/xcm-test/src/ctx/call/index.ts similarity index 100% rename from integration-tests/xcm-test/src/mock/index.ts rename to integration-tests/xcm-test/src/ctx/call/index.ts diff --git a/integration-tests/xcm-test/src/mock/setup.ts b/integration-tests/xcm-test/src/ctx/call/setup.ts similarity index 100% rename from integration-tests/xcm-test/src/mock/setup.ts rename to integration-tests/xcm-test/src/ctx/call/setup.ts diff --git a/integration-tests/xcm-test/src/mock/xcm.ts b/integration-tests/xcm-test/src/ctx/call/xcm.ts similarity index 98% rename from integration-tests/xcm-test/src/mock/xcm.ts rename to integration-tests/xcm-test/src/ctx/call/xcm.ts index 676ac34e..0309304f 100644 --- a/integration-tests/xcm-test/src/mock/xcm.ts +++ b/integration-tests/xcm-test/src/ctx/call/xcm.ts @@ -11,7 +11,7 @@ import { import { getAddress } from './account'; import { getAmount } from './amount'; -import { getRouteKey } from '../utils'; +import { getRouteKey } from '../../utils/route'; const BALANCE = 10; const FEE = 0.1; diff --git a/integration-tests/xcm-test/src/e2e/account.ts b/integration-tests/xcm-test/src/ctx/e2e/account.ts similarity index 100% rename from integration-tests/xcm-test/src/e2e/account.ts rename to integration-tests/xcm-test/src/ctx/e2e/account.ts diff --git a/integration-tests/xcm-test/src/e2e/amount.ts b/integration-tests/xcm-test/src/ctx/e2e/amount.ts similarity index 100% rename from integration-tests/xcm-test/src/e2e/amount.ts rename to integration-tests/xcm-test/src/ctx/e2e/amount.ts diff --git a/integration-tests/xcm-test/src/e2e/events.ts b/integration-tests/xcm-test/src/ctx/e2e/events.ts similarity index 97% rename from integration-tests/xcm-test/src/e2e/events.ts rename to integration-tests/xcm-test/src/ctx/e2e/events.ts index 89699d95..6ad1bd2c 100644 --- a/integration-tests/xcm-test/src/e2e/events.ts +++ b/integration-tests/xcm-test/src/ctx/e2e/events.ts @@ -5,7 +5,7 @@ import type { import type { AnyJson } from '@polkadot/types-codec/types'; import { ApiPromise } from '@polkadot/api'; -import { findNestedKey } from '../utils'; +import { findNestedKey } from '../../utils/json'; export function checkIfFailed(api: ApiPromise, events: EventRecord[]): boolean { return events.some(({ event: { method, section, data } }) => { diff --git a/integration-tests/xcm-test/src/e2e/hooks/index.ts b/integration-tests/xcm-test/src/ctx/e2e/hooks/index.ts similarity index 100% rename from integration-tests/xcm-test/src/e2e/hooks/index.ts rename to integration-tests/xcm-test/src/ctx/e2e/hooks/index.ts diff --git a/integration-tests/xcm-test/src/e2e/hooks/moonbeam.ts b/integration-tests/xcm-test/src/ctx/e2e/hooks/moonbeam.ts similarity index 97% rename from integration-tests/xcm-test/src/e2e/hooks/moonbeam.ts rename to integration-tests/xcm-test/src/ctx/e2e/hooks/moonbeam.ts index f5f1e918..b474fbb2 100644 --- a/integration-tests/xcm-test/src/e2e/hooks/moonbeam.ts +++ b/integration-tests/xcm-test/src/ctx/e2e/hooks/moonbeam.ts @@ -5,7 +5,7 @@ import { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import { decodeFunctionData } from 'viem'; -import { jsonFormatter } from '../../utils'; +import { jsonFormatter } from '../../../utils/route'; const NATIVE = '0x0000000000000000000000000000000000000802'; const FOREIGN_PREFIX = '0xffffffff'; diff --git a/integration-tests/xcm-test/src/e2e/index.ts b/integration-tests/xcm-test/src/ctx/e2e/index.ts similarity index 100% rename from integration-tests/xcm-test/src/e2e/index.ts rename to integration-tests/xcm-test/src/ctx/e2e/index.ts diff --git a/integration-tests/xcm-test/src/e2e/network.ts b/integration-tests/xcm-test/src/ctx/e2e/network.ts similarity index 100% rename from integration-tests/xcm-test/src/e2e/network.ts rename to integration-tests/xcm-test/src/ctx/e2e/network.ts diff --git a/integration-tests/xcm-test/src/e2e/setup.ts b/integration-tests/xcm-test/src/ctx/e2e/setup.ts similarity index 100% rename from integration-tests/xcm-test/src/e2e/setup.ts rename to integration-tests/xcm-test/src/ctx/e2e/setup.ts diff --git a/integration-tests/xcm-test/src/e2e/storage.ts b/integration-tests/xcm-test/src/ctx/e2e/storage.ts similarity index 68% rename from integration-tests/xcm-test/src/e2e/storage.ts rename to integration-tests/xcm-test/src/ctx/e2e/storage.ts index ddcb4794..728fde27 100644 --- a/integration-tests/xcm-test/src/e2e/storage.ts +++ b/integration-tests/xcm-test/src/ctx/e2e/storage.ts @@ -7,6 +7,7 @@ import { import { ApiPromise } from '@polkadot/api'; import { getAccount } from './account'; +import { jsonFormatter } from '../../utils/json'; const BALANCE = 1000n; @@ -14,7 +15,7 @@ export const initStorage = async (api: ApiPromise, chain: Parachain) => { const chainDecimals = api.registry.chainDecimals[0]; const chainAssets = Array.from(chain.assetsData.values()); - const system = { + let storage = { System: { Account: populateSystem(chain, chainDecimals), }, @@ -22,28 +23,45 @@ export const initStorage = async (api: ApiPromise, chain: Parachain) => { // Single asset (system only) if (chainAssets.length === 1) { - return system; + return storage; } + /* if (chain.key === 'moonbeam') { + storage = Object.assign( + { + EVM: { + AccountStorages: populateErc20(chain, chainAssets, chainDecimals), + }, + }, + storage + ); + } */ + if (useTokensPallet(api)) { - return { - ...system, - Tokens: { - Accounts: populateTokens(chain, chainAssets, chainDecimals), + storage = Object.assign( + { + Tokens: { + Accounts: populateTokens(chain, chainAssets, chainDecimals), + }, }, - }; + storage + ); } if (useAssetsPallet(api)) { - return { - ...system, - Assets: { - Account: populateAssets(chain, chainAssets, chainDecimals), + storage = Object.assign( + { + Assets: { + Account: populateAssets(chain, chainAssets, chainDecimals), + }, }, - }; + storage + ); } - return system; + //console.log(JSON.stringify(storage, jsonFormatter, 2)); + + return storage; }; const useAssetsPallet = (api: ApiPromise): boolean => { @@ -68,6 +86,24 @@ const useNormalizedBalance = ( return assetMinFmt > assetBalance ? assetMinFmt + assetBalance : assetBalance; }; +const populateErc20 = ( + chain: Parachain, + assets: ParachainAssetData[], + decimals: number +) => { + const acc = getAccount(chain); + return assets + .filter((a) => a.asset.key.toString().endsWith('_mwh')) + .map((a) => { + const assetId = chain.getBalanceAssetId(a.asset); + const balance = useNormalizedBalance(chain, decimals, a.asset); + return [ + [assetId, acc.address], + `0x${balance.toString(16).toUpperCase()}`, + ]; + }); +}; + const populateAssets = ( chain: Parachain, assets: ParachainAssetData[], diff --git a/integration-tests/xcm-test/src/e2e/types.ts b/integration-tests/xcm-test/src/ctx/e2e/types.ts similarity index 100% rename from integration-tests/xcm-test/src/e2e/types.ts rename to integration-tests/xcm-test/src/ctx/e2e/types.ts diff --git a/integration-tests/xcm-test/src/e2e/xcm.ts b/integration-tests/xcm-test/src/ctx/e2e/xcm.ts similarity index 91% rename from integration-tests/xcm-test/src/e2e/xcm.ts rename to integration-tests/xcm-test/src/ctx/e2e/xcm.ts index afd01b50..7fc66515 100644 --- a/integration-tests/xcm-test/src/e2e/xcm.ts +++ b/integration-tests/xcm-test/src/ctx/e2e/xcm.ts @@ -23,7 +23,7 @@ import { } from './xcm.utils'; import { SetupCtx } from './types'; -import { getRouteKey } from '../utils'; +import { getRouteKey } from '../../utils/route'; const TRANSFER_AMOUNT = '10'; @@ -38,9 +38,10 @@ export const runXcm = ( networks: SetupCtx[]; wallet: Wallet; }>, - options: { skip?: boolean } = {} + options: { skip?: boolean; sync?: boolean } = {} ) => { const itfn = options.skip ? it.skip : it; + const shouldSync = options.sync || false; itfn( name, async () => { @@ -68,6 +69,7 @@ export const runXcm = ( let extrinsic; if (calldata.type === CallType.Evm && chain.key === 'moonbeam') { + return; // Skipped for now extrinsic = moonbeam.toTransferExtrinsic( srcNetwork.api, @@ -98,7 +100,8 @@ export const runXcm = ( await destNetwork.chain.newBlock(); const destEvents = await destNetwork.api.query.system.events(); expect(checkIfProcessed(destEvents)).toBeTruthy(); - expect([key, calldata.data]).toMatchSnapshot(); + + shouldSync && expect([key, calldata.data]).toMatchSnapshot(); const postTransfer = await getTransfer( wallet, @@ -113,14 +116,15 @@ export const runXcm = ( postTransfer ); - report.set(key, { - updated: Date.now(), - destination: { - fee: destinationFee.delta, - feeAsset: destinationFee.asset, - feeNative: destinationFee.deltaBn, - }, - }); + shouldSync && + report.set(key, { + updated: Date.now(), + destination: { + fee: destinationFee.delta, + feeAsset: destinationFee.asset, + feeNative: destinationFee.deltaBn, + }, + }); console.table( [ diff --git a/integration-tests/xcm-test/src/e2e/xcm.utils.ts b/integration-tests/xcm-test/src/ctx/e2e/xcm.utils.ts similarity index 100% rename from integration-tests/xcm-test/src/e2e/xcm.utils.ts rename to integration-tests/xcm-test/src/ctx/e2e/xcm.utils.ts diff --git a/integration-tests/xcm-test/src/e2e.spec.ts b/integration-tests/xcm-test/src/e2e.spec.ts index 8977c805..1ec8ca43 100644 --- a/integration-tests/xcm-test/src/e2e.spec.ts +++ b/integration-tests/xcm-test/src/e2e.spec.ts @@ -7,9 +7,10 @@ import { Wallet } from '@galacticcouncil/xcm-sdk'; import console from 'console'; -import { setup, network, xcm, SetupCtx } from './e2e'; -import { getRouteInfo } from './utils'; -import { write, loadExisting } from './file'; +import { setup, network, xcm, SetupCtx } from './ctx/e2e'; + +import { getRouteInfo } from './utils/route'; +import { write, loadExisting } from './utils/file'; const jestConsole = console; const DB = 'metadata.db.json'; @@ -18,16 +19,27 @@ const { configService, initWithCtx } = setup; const { createNetworks } = network; const { runXcm } = xcm; +/** + * Supported polkadot consensus ctx. + * + * Constraints: + * 1) Bridge transfers are not executed. + * 2) Acala EVM is skipped (testing chain) + * 2) Nodle is skipped (unstable rpc's) + * 3) Phala is skipped (unstable rpc's) + * + * @returns chains execution ctx + */ const getPolkadotChains = () => { const bridge: string[] = ['ethereum']; - const blacklist: string[] = bridge.concat(['acala-evm', 'nodle']); + const skipFor: string[] = bridge.concat(['acala-evm', 'nodle', 'phala']); const chains: Parachain[] = Array.from(configService.chains.values()) .filter((c) => c instanceof Parachain) .filter((c) => c.ecosystem === ChainEcosystem.Polkadot) - .filter((c) => !blacklist.includes(c.key)); + .filter((c) => !skipFor.includes(c.key)); return { - blacklist, + skipFor, bridge, chains, }; @@ -67,14 +79,15 @@ describe('Wallet with XCM config', () => { const { chain, routes } = config; for (const route of Array.from(routes.values())) { - const { blacklist } = polkadot; - const { destination } = route; + const { skipFor } = polkadot; + const { source, destination } = route; - if (blacklist.includes(destination.chain.key)) { + if (skipFor.includes(destination.chain.key)) { continue; } const isContractTransfer = !!route.contract; + const isAcalaErc20Transfer = source.asset.key.endsWith('_awh'); const info = getRouteInfo(chain, route); runXcm( @@ -93,7 +106,8 @@ describe('Wallet with XCM config', () => { }; }, { - skip: isContractTransfer, + skip: isContractTransfer || isAcalaErc20Transfer, + sync: true, } ); } diff --git a/integration-tests/xcm-test/src/exec.spec.ts b/integration-tests/xcm-test/src/exec.spec.ts new file mode 100644 index 00000000..87cd52ed --- /dev/null +++ b/integration-tests/xcm-test/src/exec.spec.ts @@ -0,0 +1,103 @@ +import { + ConfigBuilder, + Parachain, + SubstrateApis, +} from '@galacticcouncil/xcm-core'; +import { Wallet } from '@galacticcouncil/xcm-sdk'; + +import console from 'console'; + +import { setup, network, xcm, SetupCtx } from './ctx/e2e'; + +import { parseArgs } from './utils/cmd'; +import { write, loadExisting } from './utils/file'; +import { getRouteInfo } from './utils/route'; + +const jestConsole = console; +const DB = 'metadata.db.json'; + +const { configService, initWithCtx } = setup; +const { createNetworks } = network; +const { runXcm } = xcm; + +const getKey = () => { + const args = process.argv.slice(2); + const params = parseArgs(args); + const key = params['key']; + + if (!key) { + console.error( + 'Please specify transfer key.\n Example: npm run test:exec -- -key hydration-assethub-ded' + ); + process.exit(1); + } + + return key; +}; + +describe('Wallet with XCM config', () => { + jest.setTimeout(3 * 60 * 1000); // Execution time <= 3 min + + let wallet: Wallet; + let networks: SetupCtx[] = []; + + const reportCtx = loadExisting(DB); + + const key = getKey(); + const [srcChainKey, destChainKey, assetKey] = key.split('-'); + const relay = configService.getChain('polkadot'); + const srcChain = configService.getChain(srcChainKey); + const destChain = configService.getChain(destChainKey); + const asset = configService.getAsset(assetKey); + + beforeAll(async () => { + global.console = console; + networks = await createNetworks([ + srcChain, + destChain, + relay, + ] as Parachain[]); + const ctx = networks.find((n) => n.config.key === 'hydration')!; + wallet = await initWithCtx(ctx); + }); + + afterAll(async () => { + global.console = jestConsole; + await SubstrateApis.getInstance().release(); + await Promise.all(networks.map((network) => network.teardown())); + write(reportCtx, DB); + }); + + it('is defined', () => { + expect(configService).toBeDefined(); + }); + + describe('should result in valid Polkadot transfer for', () => { + const transfer = ConfigBuilder(configService) + .assets() + .asset(asset) + .source(srcChain) + .destination(destChain) + .build(); + + const { chain, route } = transfer.origin; + const info = getRouteInfo(chain, route); + + runXcm( + `${info} transfer`, + async () => { + return { + chain: chain, + route: route, + }; + }, + async () => { + return { + report: new Map(), + networks: networks, + wallet: wallet, + }; + } + ); + }); +}); diff --git a/integration-tests/xcm-test/src/utils/cmd.ts b/integration-tests/xcm-test/src/utils/cmd.ts new file mode 100644 index 00000000..5b882694 --- /dev/null +++ b/integration-tests/xcm-test/src/utils/cmd.ts @@ -0,0 +1,13 @@ +const PARAM_PREFIX = '-'; + +export const parseArgs = (args: string[]) => { + const parsedArgs: { [key: string]: string } = {}; + + args.forEach((arg, i) => { + if (arg.startsWith(PARAM_PREFIX)) { + const key = arg.replace(PARAM_PREFIX, ''); + parsedArgs[key] = args[++i]; + } + }); + return parsedArgs; +}; diff --git a/integration-tests/xcm-test/src/file.ts b/integration-tests/xcm-test/src/utils/file.ts similarity index 94% rename from integration-tests/xcm-test/src/file.ts rename to integration-tests/xcm-test/src/utils/file.ts index e09ba0eb..4f4d575f 100644 --- a/integration-tests/xcm-test/src/file.ts +++ b/integration-tests/xcm-test/src/utils/file.ts @@ -1,6 +1,6 @@ import { readFileSync, writeFileSync } from 'fs'; -import { jsonFormatter } from './utils'; +import { jsonFormatter } from './json'; const DB_PATH = './src/__db__/'; diff --git a/integration-tests/xcm-test/src/utils/json.ts b/integration-tests/xcm-test/src/utils/json.ts new file mode 100644 index 00000000..84978154 --- /dev/null +++ b/integration-tests/xcm-test/src/utils/json.ts @@ -0,0 +1,14 @@ +export const jsonFormatter = (_: any, nestedValue: any) => { + return typeof nestedValue === 'bigint' ? nestedValue.toString() : nestedValue; +}; + +export const findNestedKey = (obj: any, keyToFind: any) => { + const foundObj: any[] = []; + JSON.stringify(obj, (_, nestedValue) => { + if (nestedValue && nestedValue[keyToFind]) { + foundObj.push(nestedValue); + } + return nestedValue; + }); + return foundObj[0]; +}; diff --git a/integration-tests/xcm-test/src/utils.ts b/integration-tests/xcm-test/src/utils/route.ts similarity index 57% rename from integration-tests/xcm-test/src/utils.ts rename to integration-tests/xcm-test/src/utils/route.ts index 4b96303a..9a83c05c 100644 --- a/integration-tests/xcm-test/src/utils.ts +++ b/integration-tests/xcm-test/src/utils/route.ts @@ -1,7 +1,5 @@ import { AnyChain, AssetRoute } from '@galacticcouncil/xcm-core'; -import { writeFileSync } from 'fs'; - export const getRouteKey = (chain: AnyChain, route: AssetRoute) => { const { source, destination } = route; return [chain.key, destination.chain.key, source.asset.key].join('-'); @@ -20,18 +18,3 @@ export const getRouteInfo = (chain: AnyChain, route: AssetRoute) => { `[${transferAsset.key}]`, ].join(' '); }; - -export const jsonFormatter = (_: any, nestedValue: any) => { - return typeof nestedValue === 'bigint' ? nestedValue.toString() : nestedValue; -}; - -export const findNestedKey = (obj: any, keyToFind: any) => { - const foundObj: any[] = []; - JSON.stringify(obj, (_, nestedValue) => { - if (nestedValue && nestedValue[keyToFind]) { - foundObj.push(nestedValue); - } - return nestedValue; - }); - return foundObj[0]; -};