Skip to content

Commit

Permalink
chore: unwrap args
Browse files Browse the repository at this point in the history
  • Loading branch information
npty committed Aug 1, 2024
1 parent d670f2c commit 6670bfa
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions sui/deploy-contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ const supportedPackages = PACKAGE_DIRS.map((dir) => ({
* Define post-deployment functions for each supported package below.
*/

async function postDeployGasService(published, args) {
const { chain } = args;
async function postDeployGasService(published, keypair, client, config, chain, options ) {
const [gasCollectorCapObjectId, gasServiceObjectId] = getObjectIdsByObjectTypes(published.publishTxn, [
`${published.packageId}::gas_service::GasCollectorCap`,
`${published.packageId}::gas_service::GasService`,
Expand All @@ -91,9 +90,7 @@ async function postDeployGasService(published, args) {
};
}

async function postDeployTest(published, args) {
const { chain, config, options } = args;
const [keypair, client] = getWallet(chain, options);
async function postDeployTest(published, keypair, client, config, chain, options ) {
const relayerDiscovery = config.sui.contracts.AxelarGateway?.objects?.RelayerDiscovery;

const [singletonObjectId] = getObjectIdsByObjectTypes(published.publishTxn, [`${published.packageId}::test::Singleton`]);
Expand All @@ -111,8 +108,7 @@ async function postDeployTest(published, args) {
printInfo('Register transaction', registerTx.digest);
}

async function postDeployOperators(published, args) {
const { chain } = args;
async function postDeployOperators(published, keypair, client, config, chain, options ) {
const [operatorsObjectId, ownerCapObjectId] = getObjectIdsByObjectTypes(published.publishTxn, [
`${published.packageId}::operators::Operators`,
`${published.packageId}::operators::OwnerCap`,
Expand All @@ -123,8 +119,7 @@ async function postDeployOperators(published, args) {
};
}

async function postDeployAxelarGateway(published, args) {
const { keypair, client, config, chain, options } = args;
async function postDeployAxelarGateway(published, keypair, client, config, chain, options ) {
const { packageId, publishTxn } = published;
const { minimumRotationDelay, policy, previousSigners } = options;
const operator = options.operator || keypair.toSuiAddress();
Expand Down Expand Up @@ -211,7 +206,7 @@ async function deploy(keypair, client, supportedContract, config, chain, options

// Execute post-deployment function
const executePostDeploymentFn = PACKAGE_MAPPING.POST_DEPLOY_FUNCTIONS[packageName];
executePostDeploymentFn(published, { keypair, client, config, chain, options });
executePostDeploymentFn(published, keypair, client, config, chain, options );

printInfo(`${packageName} Configuration Updated`, JSON.stringify(chain.contracts[packageName], null, 2));
}
Expand Down

0 comments on commit 6670bfa

Please sign in to comment.