Skip to content

Commit

Permalink
chore: rename L2Transaction to parent/child
Browse files Browse the repository at this point in the history
  • Loading branch information
douglance committed Oct 6, 2023
1 parent 634eb46 commit c626c34
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
26 changes: 13 additions & 13 deletions src/lib/message/L2Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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,
Expand All @@ -116,17 +116,17 @@ export class L2TransactionReceipt implements TransactionReceipt {
* Get any l2-to-l1-messages created by this transaction
* @param l2SignerOrProvider
*/
public async getL2ToL1Messages<T extends SignerOrProvider>(
public async getChildToParentMessages<T extends SignerOrProvider>(
l1SignerOrProvider: T
): Promise<L2ToL1MessageReaderOrWriter<T>[]>
public async getL2ToL1Messages<T extends SignerOrProvider>(
): Promise<ChildToParentMessageReaderOrWriter<T>[]>
public async getChildToParentMessages<T extends SignerOrProvider>(
l1SignerOrProvider: T
): Promise<L2ToL1MessageReader[] | L2ToL1MessageWriter[]> {
): Promise<ChildToParentMessageReader[] | ChildToParentMessageWriter[]> {
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)
)
}

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/eth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ describe('Ether', async () => {
)

const withdrawMessage = (
await withdrawEthRec.getL2ToL1Messages(l1Signer)
await withdrawEthRec.getChildToParentMessages(l1Signer)
)[0]
expect(
withdrawMessage,
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/testHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!)
Expand Down

0 comments on commit c626c34

Please sign in to comment.