From 0a82199e890690a4be3596054f70d5d71b72f412 Mon Sep 17 00:00:00 2001 From: Milap Sheth Date: Tue, 27 Aug 2024 05:15:31 +0400 Subject: [PATCH] prettier --- common/utils.js | 5 +++-- sui/deploy-contract.js | 5 ++++- sui/gateway.js | 22 +++++++++++----------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/common/utils.js b/common/utils.js index 4d51ba8e..3ffc004c 100644 --- a/common/utils.js +++ b/common/utils.js @@ -10,7 +10,7 @@ const readlineSync = require('readline-sync'); const { CosmWasmClient } = require('@cosmjs/cosmwasm-stargate'); const { ethers } = require('hardhat'); const { - utils: { keccak256, defaultAbiCoder }, + utils: { keccak256, hexlify, defaultAbiCoder }, } = ethers; const { normalizeBech32 } = require('@cosmjs/encoding'); @@ -389,8 +389,9 @@ async function getDomainSeparator(config, chain, options) { } const expectedDomainSeparator = calculateDomainSeparator(chain.axelarId, routerAddress, chainId); + if (options.domainSeparator === 'offline') { - printInfo('Computed domain separator offline') + printInfo('Computed domain separator offline'); return expectedDomainSeparator; } diff --git a/sui/deploy-contract.js b/sui/deploy-contract.js index ff9cba48..fd8b454e 100644 --- a/sui/deploy-contract.js +++ b/sui/deploy-contract.js @@ -327,7 +327,10 @@ const GATEWAY_CMD_OPTIONS = [ new Option('--minimumRotationDelay ', 'minium delay for signer rotations (in second)') .argParser((val) => parseInt(val) * 1000) .default(24 * 60 * 60), - new Option('--domainSeparator ', 'domain separator (pass in the keccak256 hash value OR "offline" meaning that its computed locally)'), + new Option( + '--domainSeparator ', + 'domain separator (pass in the keccak256 hash value OR "offline" meaning that its computed locally)', + ), new Option('--nonce ', 'nonce for the signer (defaults to HashZero)'), new Option('--previousSigners ', 'number of previous signers to retain').default('15'), ]; diff --git a/sui/gateway.js b/sui/gateway.js index 9646e746..7425b786 100644 --- a/sui/gateway.js +++ b/sui/gateway.js @@ -215,7 +215,7 @@ async function approve(keypair, client, config, chain, contractConfig, args, opt async function submitProof(keypair, client, config, chain, contractConfig, args, options) { const packageId = contractConfig.address; - const [ multisigSessionId ] = args; + const [multisigSessionId] = args; const { payload, status } = await getMultisigProof(config, chain.axelarId, multisigSessionId); if (!status.completed) { @@ -243,16 +243,16 @@ async function submitProof(keypair, client, config, chain, contractConfig, args, ], }); } else if (payload.messages) { - printInfo('Submitting approve_messages'); - - tx.moveCall({ - target: `${packageId}::gateway::approve_messages`, - arguments: [ - tx.object(contractConfig.objects.Gateway), - tx.pure(bcs.vector(bcs.u8()).serialize(new Uint8Array(executeData.payload)).toBytes()), - tx.pure(bcs.vector(bcs.u8()).serialize(new Uint8Array(executeData.proof)).toBytes()), - ], - }); + printInfo('Submitting approve_messages'); + + tx.moveCall({ + target: `${packageId}::gateway::approve_messages`, + arguments: [ + tx.object(contractConfig.objects.Gateway), + tx.pure(bcs.vector(bcs.u8()).serialize(new Uint8Array(executeData.payload)).toBytes()), + tx.pure(bcs.vector(bcs.u8()).serialize(new Uint8Array(executeData.proof)).toBytes()), + ], + }); } else { throw new Error(`Unknown payload type: ${payload}`); }