Skip to content

Commit

Permalink
chore: renames L2ToL1MessageClassic to Child/ParentChain (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
douglance authored Mar 14, 2024
1 parent e1a4c24 commit 551ba58
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 114 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export { InboxTools } from './lib/inbox/inbox'
export { EventFetcher } from './lib/utils/eventFetcher'
export { ArbitrumProvider } from './lib/utils/arbProvider'
export * as constants from './lib/dataEntities/constants'
export { L2ToL1MessageStatus } from './lib/dataEntities/message'
export { ChildToParentMessageStatus } from './lib/dataEntities/message'
export {
RetryableData,
RetryableDataTools,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/dataEntities/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export enum InboxMessageKind {
L2MessageType_signedTx = 4,
}

export enum L2ToL1MessageStatus {
export enum ChildToParentMessageStatus {
/**
* ArbSys.sendTxToL1 called, but assertion not yet confirmed
*/
Expand Down
17 changes: 8 additions & 9 deletions src/lib/message/L2ToL1Message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
} from '../abi/ArbSys'
import { isDefined } from '../utils/lib'
import { EventArgs } from '../dataEntities/event'
import { L2ToL1MessageStatus as ChildToParentChainMessageStatus } from '../dataEntities/message'
import { ChildToParentMessageStatus } from '../dataEntities/message'
import { getChildChain } from '../dataEntities/networks'
import { ArbSdkError } from '../dataEntities/errors'

Expand Down Expand Up @@ -160,7 +160,7 @@ export class ChildToParentMessage {
const logQueries = []
if (classicFilter.fromBlock !== classicFilter.toBlock) {
logQueries.push(
classic.L2ToL1MessageClassic.getL2ToL1Events(
classic.ChildToParentMessageClassic.getChildToParentEvents(
childChainProvider,
classicFilter,
position,
Expand Down Expand Up @@ -195,7 +195,7 @@ export class ChildToParentMessage {
* Provides read-only access for Chain-to-ParentChain-messages
*/
export class ChildToParentMessageReader extends ChildToParentMessage {
private readonly classicReader?: classic.L2ToL1MessageReaderClassic
private readonly classicReader?: classic.ChildToParentMessageReaderClassic
private readonly nitroReader?: nitro.ChildToParentChainMessageReaderNitro

constructor(
Expand All @@ -204,7 +204,7 @@ export class ChildToParentMessageReader extends ChildToParentMessage {
) {
super()
if (this.isClassic(event)) {
this.classicReader = new classic.L2ToL1MessageReaderClassic(
this.classicReader = new classic.ChildToParentMessageReaderClassic(
parentChainProvider,
event.batchNumber,
event.indexInBatch
Expand Down Expand Up @@ -232,7 +232,7 @@ export class ChildToParentMessageReader extends ChildToParentMessage {
*/
public async status(
childChainProvider: Provider
): Promise<ChildToParentChainMessageStatus> {
): Promise<ChildToParentMessageStatus> {
// can we create an ChildToParentmessage here, we need to - the constructor is what we need
if (this.nitroReader)
return await this.nitroReader.status(childChainProvider)
Expand All @@ -250,8 +250,7 @@ export class ChildToParentMessageReader extends ChildToParentMessage {
childChainProvider: Provider,
retryDelay = 500
): Promise<
| ChildToParentChainMessageStatus.EXECUTED
| ChildToParentChainMessageStatus.CONFIRMED
ChildToParentMessageStatus.EXECUTED | ChildToParentMessageStatus.CONFIRMED
> {
if (this.nitroReader)
return this.nitroReader.waitUntilReadyToExecute(
Expand Down Expand Up @@ -284,7 +283,7 @@ export class ChildToParentMessageReader extends ChildToParentMessage {
* Provides read and write access for Chain-to-ParentChain-messages
*/
export class ChildToParentMessageWriter extends ChildToParentMessageReader {
private readonly classicWriter?: classic.L2ToL1MessageWriterClassic
private readonly classicWriter?: classic.ChildToParentMessageWriterClassic
private readonly nitroWriter?: nitro.ChildToParentChainMessageWriterNitro

/**
Expand All @@ -302,7 +301,7 @@ export class ChildToParentMessageWriter extends ChildToParentMessageReader {
super(parentChainProvider ?? parentChainSigner.provider!, event)

if (this.isClassic(event)) {
this.classicWriter = new classic.L2ToL1MessageWriterClassic(
this.classicWriter = new classic.ChildToParentMessageWriterClassic(
parentChainSigner,
event.batchNumber,
event.indexInBatch,
Expand Down
Loading

0 comments on commit 551ba58

Please sign in to comment.