diff --git a/ethereum/ts-scripts/helpers/deployments.ts b/ethereum/ts-scripts/helpers/deployments.ts index 724d0f4..a3f4b65 100644 --- a/ethereum/ts-scripts/helpers/deployments.ts +++ b/ethereum/ts-scripts/helpers/deployments.ts @@ -30,10 +30,9 @@ export async function deployRelayProviderImplementation( //@ts-ignore const factory = new ethers.ContractFactory(contractInterface, bytecode, signer) const contract = await factory.deploy() - return await contract.deployed().then((result) => { - console.log("Successfully deployed contract at " + result.address) - return { address: result.address, chainId: chain.chainId } - }) + const result = await contract.deployed() + console.log("Successfully deployed contract at " + result.address) + return { address: result.address, chainId: chain.chainId } } export async function deployRelayProviderSetup(chain: ChainInfo): Promise { @@ -44,10 +43,9 @@ export async function deployRelayProviderSetup(chain: ChainInfo): Promise { - console.log("Successfully deployed contract at " + result.address) - return { address: result.address, chainId: chain.chainId } - }) + const result = await contract.deployed() + console.log("Successfully deployed contract at " + result.address) + return { address: result.address, chainId: chain.chainId } } export async function deployRelayProviderProxy( chain: ChainInfo, @@ -70,10 +68,9 @@ export async function deployRelayProviderProxy( ]) const contract = await factory.deploy(relayProviderSetupAddress, encodedData) - return await contract.deployed().then((result) => { - console.log("Successfully deployed contract at " + result.address) - return { address: result.address, chainId: chain.chainId } - }) + const result = await contract.deployed() + console.log("Successfully deployed contract at " + result.address) + return { address: result.address, chainId: chain.chainId } } export async function deployMockIntegration(chain: ChainInfo): Promise { @@ -87,10 +84,9 @@ export async function deployMockIntegration(chain: ChainInfo): Promise { - console.log("Successfully deployed contract at " + result.address) - return { address: result.address, chainId: chain.chainId } - }) + const result = await contract.deployed() + console.log("Successfully deployed contract at " + result.address) + return { address: result.address, chainId: chain.chainId } } export async function deployCoreRelayerLibrary(chain: ChainInfo): Promise { @@ -101,10 +97,9 @@ export async function deployCoreRelayerLibrary(chain: ChainInfo): Promise { - console.log("Successfully deployed contract at " + result.address) - return { address: result.address, chainId: chain.chainId } - }) + const result = await contract.deployed() + console.log("Successfully deployed contract at " + result.address) + return { address: result.address, chainId: chain.chainId } } export async function deployCoreRelayerImplementation( @@ -135,10 +130,9 @@ export async function deployCoreRelayerImplementation( signer ) const contract = await factory.deploy() - return await contract.deployed().then((result) => { - console.log("Successfully deployed contract at " + result.address) - return { address: result.address, chainId: chain.chainId } - }) + const result = await contract.deployed() + console.log("Successfully deployed contract at " + result.address) + return { address: result.address, chainId: chain.chainId } } export async function deployCoreRelayerSetup(chain: ChainInfo): Promise { console.log("deployCoreRelayerSetup " + chain.chainId) @@ -148,10 +142,9 @@ export async function deployCoreRelayerSetup(chain: ChainInfo): Promise { - console.log("Successfully deployed contract at " + result.address) - return { address: result.address, chainId: chain.chainId } - }) + const result = await contract.deployed() + console.log("Successfully deployed contract at " + result.address) + return { address: result.address, chainId: chain.chainId } } export async function deployCoreRelayerProxy( chain: ChainInfo, @@ -184,10 +177,9 @@ export async function deployCoreRelayerProxy( ]) const contract = await factory.deploy(coreRelayerSetupAddress, encodedData) - return await contract.deployed().then((result) => { - console.log("Successfully deployed contract at " + result.address) - return { address: result.address, chainId: chain.chainId } - }) + const result = await contract.deployed() + console.log("Successfully deployed contract at " + result.address) + return { address: result.address, chainId: chain.chainId } } function link(bytecode: string, libName: String, libAddress: string) { //This doesn't handle the libName, because Forge embed a psuedonym into the bytecode, like diff --git a/ethereum/ts-scripts/mockIntegration/messageTest.ts b/ethereum/ts-scripts/mockIntegration/messageTest.ts index 194b691..9543f93 100644 --- a/ethereum/ts-scripts/mockIntegration/messageTest.ts +++ b/ethereum/ts-scripts/mockIntegration/messageTest.ts @@ -154,10 +154,10 @@ export async function encodeEmitterAddress( emitterAddressStr: string ): Promise { if (myChainId === wh.CHAIN_ID_SOLANA || myChainId === wh.CHAIN_ID_PYTHNET) { - return await wh.getEmitterAddressSolana(emitterAddressStr) + return wh.getEmitterAddressSolana(emitterAddressStr) } if (wh.isTerraChain(myChainId)) { - return await wh.getEmitterAddressTerra(emitterAddressStr) + return wh.getEmitterAddressTerra(emitterAddressStr) } if (wh.isEVMChain(myChainId)) { return wh.getEmitterAddressEth(emitterAddressStr) diff --git a/relayer_engine/src/plugin/src/plugin.ts b/relayer_engine/src/plugin/src/plugin.ts index 6642719..afd602a 100644 --- a/relayer_engine/src/plugin/src/plugin.ts +++ b/relayer_engine/src/plugin/src/plugin.ts @@ -442,18 +442,18 @@ export class GenericRelayerPlugin implements Plugin { (log) => log.args.sequence.toString() === sequence.toString() ) if (log) { - return await log.getTransactionReceipt() + return log.getTransactionReceipt() } } try { - return await retryAsyncUntilDefined( + return retryAsyncUntilDefined( async () => { const paginatedLogs = await coreWHContract.queryFilter(filter, -50) const log = paginatedLogs.find( (log) => log.args.sequence.toString() === sequence.toString() ) if (log) { - return await log.getTransactionReceipt() + return log.getTransactionReceipt() } return undefined }, @@ -517,14 +517,13 @@ export class GenericRelayerPlugin implements Plugin { const payload = this.parseWorkflowPayload(workflow) switch (payload.payloadId) { case RelayerPayloadId.Delivery: - if(payload.deliveryInstructionsContainer.sufficientlyFunded) { - - return await this.handleDeliveryWorkflow(payload, execute) + if (payload.deliveryInstructionsContainer.sufficientlyFunded) { + return this.handleDeliveryWorkflow(payload, execute) } this.logger.info("Delivery instruction is not sufficiently funded") - return + return case RelayerPayloadId.Redelivery: - return await this.handleRedeliveryWorkflow(payload, execute) + return this.handleRedeliveryWorkflow(payload, execute) } } @@ -560,7 +559,7 @@ export class GenericRelayerPlugin implements Plugin { return } - relayProvider + await relayProvider .deliverSingle(input, { value: budget, gasLimit: 3000000 }) .then((x) => x.wait()) @@ -604,7 +603,7 @@ export class GenericRelayerPlugin implements Plugin { relayerRefundAddress: wallet.address, } - relayProvider + await relayProvider .redeliverSingle(input, { value: budget, gasLimit: 3000000 }) .then((x) => x.wait())