Skip to content

Commit

Permalink
ISMP init (#47)
Browse files Browse the repository at this point in the history
* ismp init

* lint fix
  • Loading branch information
Szegoo committed May 26, 2024
1 parent 4f1e352 commit 1d82166
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
11 changes: 10 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
],
"rules": {
"prettier/prettier": "error",
"@typescript-eslint/no-explicit-any": "warn"
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": [
"error",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
]
}
}
8 changes: 8 additions & 0 deletions src/regionx/index.init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ export async function regionxInit(relayEndpoint: string, regionxEndpoint: string
await force(regionxApi, giveBalanceCall);
await transferRelayTokensToRegionX(100n * 10n ** 12n, regionxAccount, relayApi, alice);
}

await ismpAddParachain(regionxApi);
}

async function ismpAddParachain(api: ApiPromise) {
log("Adding coretime chain to ismp para list");
const addParaCall = api.tx.ismpParachain.addParachain([1005]);
return force(api, addParaCall);
}

async function setupRelayAsset(api: ApiPromise) {
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function submitExtrinsic(
options: Partial<SignerOptions>
): Promise<void> {
try {
return new Promise((resolve, reject) => {
return new Promise((resolve, _reject) => {
const unsub = call.signAndSend(signer, options, (result) => {
console.log(`Current status is ${result.status}`);
if (result.status.isInBlock) {
Expand All @@ -41,7 +41,7 @@ export async function submitExtrinsic(
} else if (result.isError) {
console.log("Transaction error");
unsub.then();
return reject();
return resolve();
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion zombienet/network.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ addToGenesis = false
name = "regionx-collator01"
command = "./bin/regionx-node"
ws_port = 9920
args = [ "--log=xcm=trace,regions=trace" ]
args = [ "--enable-offchain-indexing true --log=xcm=trace,regions=trace,ismp=trace" ]

0 comments on commit 1d82166

Please sign in to comment.