Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kovalgek committed Jan 14, 2025
1 parent 26615fa commit 9c9f3d7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions utils/optimism/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from "../../typechain";
import addresses from "./addresses";
import contracts from "./contracts";
import deploymentAll from "./deployment";
import deployLidoOPStackBridge from "./deployAll";
import testingUtils from "../testing";
import { BridgingManagement } from "../bridging-management";
import network, { SignerOrProvider } from "../network";
Expand Down Expand Up @@ -232,6 +232,11 @@ async function deployTestBridge(
const ethDeployer = testingUtils.accounts.deployer(ethProvider);
const optDeployer = testingUtils.accounts.deployer(optProvider);

const crossDomainAddresses = addresses();
if (!crossDomainAddresses.L1CrossDomainMessenger || !crossDomainAddresses.L2CrossDomainMessenger) {
throw new Error('CrossDomainMessenger addresses are not defined');
}

const l1TokenRebasable = await new StETHStub__factory(ethDeployer).deploy(
l1TokenRebasableName,
l1TokenRebasableSymbol
Expand All @@ -251,21 +256,23 @@ async function deployTestBridge(
lastProcessingRefSlot
);

const [ethDeployScript, optDeployScript] = await deploymentAll()
const [ethDeployScript, optDeployScript] = await deployLidoOPStackBridge(true)
.deployAllScript(
{
l1TokenNonRebasable: l1TokenNonRebasable.address,
l1TokenRebasable: l1TokenRebasable.address,
accountingOracle: accountingOracle.address,
l2GasLimitForPushingTokenRate: l2GasLimitForPushingTokenRate,
lido: lido,
l1CrossDomainMessenger: crossDomainAddresses.L1CrossDomainMessenger,

deployer: ethDeployer,
admins: { proxy: ethDeployer.address, bridge: ethDeployer.address },
deployOffset: 0
},
{
tokenRateOracle: {
admin: optDeployer.address,
tokenRateOutdatedDelay: tokenRateOutdatedDelay,
maxAllowedL2ToL1ClockLag: maxAllowedL2ToL1ClockLag,
maxAllowedTokenRateDeviationPerDayBp: maxAllowedTokenRateDeviationPerDay,
Expand All @@ -274,6 +281,7 @@ async function deployTestBridge(
tokenRate: tokenRate,
l1Timestamp: l1TokenRateUpdate
},
l2CrossDomainMessenger: crossDomainAddresses.L2CrossDomainMessenger,
l2TokenNonRebasable: {
name: l2TokenNonRebasable.name,
symbol: l2TokenNonRebasable.symbol,
Expand All @@ -296,6 +304,10 @@ async function deployTestBridge(
await ethDeployScript.run();
await optDeployScript.run();

if (!ethDeployScript.tokenRateNotifierImplAddress || !ethDeployScript.opStackTokenRatePusherImplAddress) {
throw new Error('Token rate notifier addresses are not defined');
}

const tokenRateNotifier = TokenRateNotifier__factory.connect(
ethDeployScript.tokenRateNotifierImplAddress,
ethProvider
Expand Down

0 comments on commit 9c9f3d7

Please sign in to comment.