Skip to content

Commit

Permalink
sdk: fix linting
Browse files Browse the repository at this point in the history
Fix linting issues in the SDK. Ran `yarn lint --fix` and
committed the diff.
  • Loading branch information
tynes committed Mar 28, 2023
1 parent 1169788 commit 6fcdeaa
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions packages/sdk/src/cross-chain-messenger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1004,18 +1004,23 @@ export class CrossChainMessenger {
*/
public async getChallengePeriodSeconds(): Promise<number> {
if (!this.bedrock) {
return (await this.contracts.l1.StateCommitmentChain.FRAUD_PROOF_WINDOW()).toNumber()
return (
await this.contracts.l1.StateCommitmentChain.FRAUD_PROOF_WINDOW()
).toNumber()
}

const oracleVersion = await this.contracts.l1.L2OutputOracle.version()
const challengePeriod = oracleVersion === '1.0.0'
// The ABI in the SDK does not contain FINALIZATION_PERIOD_SECONDS
// in OptimismPortal, so making an explicit call instead.
? BigNumber.from(await this.contracts.l1.OptimismPortal.provider.call({
to: this.contracts.l1.OptimismPortal.address,
data: '0xf4daa291' // FINALIZATION_PERIOD_SECONDS
}))
: await this.contracts.l1.L2OutputOracle.FINALIZATION_PERIOD_SECONDS()
const challengePeriod =
oracleVersion === '1.0.0'
? // The ABI in the SDK does not contain FINALIZATION_PERIOD_SECONDS
// in OptimismPortal, so making an explicit call instead.
BigNumber.from(
await this.contracts.l1.OptimismPortal.provider.call({
to: this.contracts.l1.OptimismPortal.address,
data: '0xf4daa291', // FINALIZATION_PERIOD_SECONDS
})
)
: await this.contracts.l1.L2OutputOracle.FINALIZATION_PERIOD_SECONDS()
return challengePeriod.toNumber()
}

Expand Down

0 comments on commit 6fcdeaa

Please sign in to comment.