Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavBreadless committed Aug 21, 2024
1 parent 7ef7a6d commit c1675c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions l1-contracts/deploy-scripts/Gateway.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ contract GatewayScript is Script {
}

function registerGateway() public {
IStateTransitionManager stm = IStateTransitionManager(config.stateTransitionProxy);
Ownable ownable = Ownable(config.stateTransitionProxy);
IBridgehub bridgehub = IBridgehub(config.bridgehub);
Ownable ownable = Ownable(config.bridgehub);
vm.prank(ownable.owner());
stm.registerSettlementLayer(config.gatewayChainId, true);
bridgehub.registerSettlementLayer(config.gatewayChainId, true);
// bytes memory data = abi.encodeCall(stm.registerSettlementLayer, (config.chainChainId, true));
// Utils.executeUpgrade({
// _governor: ownable.owner(),
Expand Down
3 changes: 1 addition & 2 deletions l1-contracts/scripts/sync-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,13 @@ async function registerSLContractsOnL1(deployer: Deployer) {

console.log(`Gateway chain Id: ${chainId}`);

const l1STM = deployer.stateTransitionManagerContract(deployer.deployWallet);
const l1Bridgehub = deployer.bridgehubContract(deployer.deployWallet);
console.log(deployer.addresses.StateTransition.StateTransitionProxy);
const gatewayAddress = await l1STM.getHyperchain(chainId);
// this script only works when owner is the deployer
console.log("Registering Gateway chain id on the STM");
const receipt1 = await deployer.executeUpgrade(
l1STM.address,
l1Bridgehub.address,
0,
l1Bridgehub.interface.encodeFunctionData("registerSettlementLayer", [chainId, true])
);
Expand Down
6 changes: 3 additions & 3 deletions l1-contracts/src.ts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1123,9 +1123,9 @@ export class Deployer {
}

public async registerSettlementLayer() {
const stm = this.stateTransitionManagerContract(this.deployWallet);
const calldata = stm.interface.encodeFunctionData("registerSettlementLayer", [this.chainId, true]);
await this.executeUpgrade(this.addresses.StateTransition.StateTransitionProxy, 0, calldata);
const bridgehub = this.bridgehubContract(this.deployWallet);
const calldata = bridgehub.interface.encodeFunctionData("registerSettlementLayer", [this.chainId, true]);
await this.executeUpgrade(this.addresses.Bridgehub.BridgehubProxy, 0, calldata);
if (this.verbose) {
console.log("Gateway registered");
}
Expand Down

0 comments on commit c1675c3

Please sign in to comment.