Skip to content

Commit

Permalink
feat(scripts): Ensure chopsticks compatability by passing nonce manually
Browse files Browse the repository at this point in the history
  • Loading branch information
wottpal committed Jul 30, 2024
1 parent 32960f4 commit ab64a72
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 20 deletions.
17 changes: 11 additions & 6 deletions scripts/deploy/deployFeeCalculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ export const deployFeeCalculator: DeployFn<FeeCalculatorArgs> = async (
customArgs,
)
const { abi, wasm } = await getDeploymentData('azns_fee_calculator')
const nonce = await api.rpc.system.accountNextIndex(account.address)

return await deployContract(api, account, abi, wasm, 'new', [
args.admin,
args.maxRegistrationDuration,
args.commonPrice,
args.pricePoints,
])
return await deployContract(
api,
account,
abi,
wasm,
'new',
[args.admin, args.maxRegistrationDuration, args.commonPrice, args.pricePoints],
undefined,
{ nonce },
)
}
22 changes: 16 additions & 6 deletions scripts/deploy/deployNameChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,21 @@ export const deployNameChecker: DeployFn<NameCheckerArgs> = async (
customArgs,
)
const { abi, wasm } = await getDeploymentData('azns_name_checker')
const nonce = await api.rpc.system.accountNextIndex(account.address)

return await deployContract(api, account, abi, wasm, 'new', [
args.admin,
args.allowedLength,
args.allowedUnicodeRanges,
args.disallowedUnicodeRangesForEdges,
])
return await deployContract(
api,
account,
abi,
wasm,
'new',
[
args.admin,
args.allowedLength,
args.allowedUnicodeRanges,
args.disallowedUnicodeRangesForEdges,
],
undefined,
{ nonce },
)
}
18 changes: 11 additions & 7 deletions scripts/deploy/deployRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ export const deployRegistry: DeployFn<RegistryArgs> = async ({ api, account }, c
customArgs,
)
const { abi, wasm } = await getDeploymentData('azns_registry')
const nonce = await api.rpc.system.accountNextIndex(account.address)

return await deployContract(api, account, abi, wasm, 'new', [
args.admin,
args.nameCheckerAddress,
args.feeCalculatorAddress,
args.tld,
args.baseUri,
])
return await deployContract(
api,
account,
abi,
wasm,
'new',
[args.admin, args.nameCheckerAddress, args.feeCalculatorAddress, args.tld, args.baseUri],
undefined,
{ nonce },
)
}
3 changes: 2 additions & 1 deletion scripts/deploy/deployRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ export const deployRouter: DeployFn<RouterArgs> = async ({ api, account }, custo
customArgs,
)
const { abi, wasm } = await getDeploymentData('azns_router')
const nonce = await api.rpc.system.accountNextIndex(account.address)

return await deployContract(api, account, abi, wasm, 'new', [args.admin])
return await deployContract(api, account, abi, wasm, 'new', [args.admin], undefined, { nonce })
}

/**
Expand Down

0 comments on commit ab64a72

Please sign in to comment.