Skip to content

Commit

Permalink
chore: rename chain to network on bridgers (#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
douglance authored Jul 10, 2024
1 parent 60f6a01 commit da6d81a
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 92 deletions.
21 changes: 12 additions & 9 deletions src/lib/assetBridger/assetBridger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,34 @@ export abstract class AssetBridger<DepositParams, WithdrawParams> {
/**
* In case of a chain that uses ETH as its native/gas token, this is either `undefined` or the zero address
*
* In case of a chain that uses an ERC-20 token from the parent chain as its native/gas token, this is the address of said token on the parent chain
* In case of a chain that uses an ERC-20 token from the parent network as its native/gas token, this is the address of said token on the parent network
*/
public readonly nativeToken?: string

public constructor(public readonly childChain: ArbitrumNetwork) {
this.nativeToken = childChain.nativeToken
public constructor(public readonly childNetwork: ArbitrumNetwork) {
this.nativeToken = childNetwork.nativeToken
}

/**
* Check the signer/provider matches the parentChain, throws if not
* Check the signer/provider matches the parent network, throws if not
* @param sop
*/
protected async checkParentChain(sop: SignerOrProvider): Promise<void> {
protected async checkParentNetwork(sop: SignerOrProvider): Promise<void> {
await SignerProviderUtils.checkNetworkMatches(
sop,
this.childChain.parentChainId
this.childNetwork.parentChainId
)
}

/**
* Check the signer/provider matches the childChain, throws if not
* Check the signer/provider matches the child network, throws if not
* @param sop
*/
protected async checkChildChain(sop: SignerOrProvider): Promise<void> {
await SignerProviderUtils.checkNetworkMatches(sop, this.childChain.chainId)
protected async checkChildNetwork(sop: SignerOrProvider): Promise<void> {
await SignerProviderUtils.checkNetworkMatches(
sop,
this.childNetwork.chainId
)
}

/**
Expand Down
Loading

0 comments on commit da6d81a

Please sign in to comment.