From c626c34534e2ae1d4e81c210a25ad575e5c7372f Mon Sep 17 00:00:00 2001 From: Doug Lance Date: Fri, 6 Oct 2023 16:14:05 -0400 Subject: [PATCH] chore: rename L2Transaction to parent/child --- src/lib/message/L2Transaction.ts | 26 +++++++++++++------------- tests/integration/eth.test.ts | 2 +- tests/integration/testHelpers.ts | 4 +++- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/lib/message/L2Transaction.ts b/src/lib/message/L2Transaction.ts index 30804921bb..ff4ce9bb54 100644 --- a/src/lib/message/L2Transaction.ts +++ b/src/lib/message/L2Transaction.ts @@ -25,11 +25,11 @@ import { SignerOrProvider, } from '../dataEntities/signerOrProvider' import { - ChildToParentMessageReader as L2ToL1MessageReader, - ChildToParentMessageReaderOrWriter as L2ToL1MessageReaderOrWriter, - ChildToParentMessage as L2ToL1Message, - ChildToParentMessageWriter as L2ToL1MessageWriter, - ChildToParentTransactionEvent as L2ToL1TransactionEvent, + ChildToParentMessageReader, + ChildToParentMessageReaderOrWriter, + ChildToParentMessage, + ChildToParentMessageWriter, + ChildToParentTransactionEvent, } from './L2ToL1Message' import { ArbSys__factory } from '../abi/factories/ArbSys__factory' import { ArbRetryableTx__factory } from '../abi/factories/ArbRetryableTx__factory' @@ -91,10 +91,10 @@ export class L2TransactionReceipt implements TransactionReceipt { } /** - * Get an L2ToL1TxEvent events created by this transaction + * Get an ChildToParentTxEvent events created by this transaction * @returns */ - public getL2ToL1Events(): L2ToL1TransactionEvent[] { + public getChildToParentEvents(): ChildToParentTransactionEvent[] { const classicLogs = parseTypedLogs( ArbSys__factory, this.logs, @@ -116,17 +116,17 @@ export class L2TransactionReceipt implements TransactionReceipt { * Get any l2-to-l1-messages created by this transaction * @param l2SignerOrProvider */ - public async getL2ToL1Messages( + public async getChildToParentMessages( l1SignerOrProvider: T - ): Promise[]> - public async getL2ToL1Messages( + ): Promise[]> + public async getChildToParentMessages( l1SignerOrProvider: T - ): Promise { + ): Promise { const provider = SignerProviderUtils.getProvider(l1SignerOrProvider) if (!provider) throw new ArbSdkError('Signer not connected to provider.') - return this.getL2ToL1Events().map(log => - L2ToL1Message.fromEvent(l1SignerOrProvider, log) + return this.getChildToParentEvents().map(log => + ChildToParentMessage.fromEvent(l1SignerOrProvider, log) ) } diff --git a/tests/integration/eth.test.ts b/tests/integration/eth.test.ts index 2d565e274b..41fe7d4269 100644 --- a/tests/integration/eth.test.ts +++ b/tests/integration/eth.test.ts @@ -226,7 +226,7 @@ describe('Ether', async () => { ) const withdrawMessage = ( - await withdrawEthRec.getL2ToL1Messages(l1Signer) + await withdrawEthRec.getChildToParentMessages(l1Signer) )[0] expect( withdrawMessage, diff --git a/tests/integration/testHelpers.ts b/tests/integration/testHelpers.ts index 39459ca46b..70caabb5d0 100644 --- a/tests/integration/testHelpers.ts +++ b/tests/integration/testHelpers.ts @@ -103,7 +103,9 @@ export const withdrawToken = async (params: WithdrawalParams) => { const withdrawRec = await withdrawRes.wait() expect(withdrawRec.status).to.equal(1, 'initiate token withdraw txn failed') - const message = (await withdrawRec.getL2ToL1Messages(params.l1Signer))[0] + const message = ( + await withdrawRec.getChildToParentMessages(params.l1Signer) + )[0] expect(message, 'withdraw message not found').to.exist const messageStatus = await message.status(params.l2Signer.provider!)