Skip to content

Commit

Permalink
feat: add substrate account option to pallet setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
AtelyPham committed Oct 24, 2024
1 parent 066d0ae commit 2d538e9
Showing 1 changed file with 42 additions and 23 deletions.
65 changes: 42 additions & 23 deletions tools/scripts/setupMultiAssetDelegationPallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ const argv = yargs(process.argv.slice(2))
desc: 'The EVM account that will be funded with pallet assets',
requiresArg: false,
},
substrateAccount: {
type: 'string',
desc: 'The substrate account that will funded with the pallet assets',
requiresArg: false,
},
})
.parseSync();

Expand Down Expand Up @@ -128,29 +133,43 @@ await batchTxes([
),
]);

info('Minting asests to Alice and Bob...');
await batchTxes([
api.tx.assets.mint(
tgTEST.id,
ALICE_SUDO.address,
parseUnits(MINT_AMOUNT, tgTEST.decimals),
),
api.tx.assets.mint(
tgtTNT.id,
ALICE_SUDO.address,
parseUnits(MINT_AMOUNT, tgtTNT.decimals),
),
api.tx.assets.mint(
tgTEST.id,
BOB.address,
parseUnits(MINT_AMOUNT, tgTEST.decimals),
),
api.tx.assets.mint(
tgtTNT.id,
BOB.address,
parseUnits(MINT_AMOUNT, tgtTNT.decimals),
),
]);
info('Minting asests to accounts...');
await batchTxes(
[
api.tx.assets.mint(
tgTEST.id,
ALICE_SUDO.address,
parseUnits(MINT_AMOUNT, tgTEST.decimals),
),
api.tx.assets.mint(
tgtTNT.id,
ALICE_SUDO.address,
parseUnits(MINT_AMOUNT, tgtTNT.decimals),
),
api.tx.assets.mint(
tgTEST.id,
BOB.address,
parseUnits(MINT_AMOUNT, tgTEST.decimals),
),
api.tx.assets.mint(
tgtTNT.id,
BOB.address,
parseUnits(MINT_AMOUNT, tgtTNT.decimals),
),
argv.substrateAccount &&
api.tx.assets.mint(
tgTEST.id,
argv.substrateAccount,
parseUnits(MINT_AMOUNT, tgTEST.decimals),
),
argv.substrateAccount &&
api.tx.assets.mint(
tgtTNT.id,
argv.substrateAccount,
parseUnits(MINT_AMOUNT, tgtTNT.decimals),
),
].filter((tx) => tx !== undefined),
);
success('Assets created and minted successfully!');

if (argv.evmAccount) {
Expand Down

0 comments on commit 2d538e9

Please sign in to comment.