-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/add-foundry
- Loading branch information
Showing
7 changed files
with
33,334 additions
and
23 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
334 changes: 321 additions & 13 deletions
334
generated-types/bindings/contracts/l1/lightlinkportal/LightLinkPortal.go
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { ethers } from "hardhat"; | ||
import { expect } from "chai"; | ||
import type { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers"; | ||
import { pushRandomHeader, setupCanonicalStateChain } from "../../lib/chain"; | ||
import { | ||
LightLinkPortal, | ||
L1CrossDomainMessenger, | ||
} from "../../../typechain-types"; | ||
import { proxyDeployAndInitialize } from "../../../scripts/hardhat/lib/deploy"; | ||
import { l1 } from "../../../typechain-types/contracts"; | ||
|
||
describe("L1CrossDomainMessenger", function () { | ||
let lightLinkPortal: LightLinkPortal; | ||
let l1CrossDomainMessenger: L1CrossDomainMessenger; | ||
let owner: HardhatEthersSigner, _chain: any; | ||
|
||
beforeEach(async function () { | ||
[owner] = await ethers.getSigners(); | ||
|
||
// - LightLinkPortal | ||
const lightLinkPortalDeployment = await proxyDeployAndInitialize( | ||
owner, | ||
await ethers.getContractFactory("LightLinkPortal"), | ||
[ethers.ZeroAddress, ethers.ZeroAddress], | ||
); | ||
lightLinkPortal = lightLinkPortalDeployment.contract as LightLinkPortal; | ||
|
||
// - L1CrossDomainMessenger | ||
const l1CrossDomainMessengerDeployment = await proxyDeployAndInitialize( | ||
owner, | ||
await ethers.getContractFactory("L1CrossDomainMessenger"), | ||
[lightLinkPortalDeployment.address], | ||
); | ||
|
||
l1CrossDomainMessenger = | ||
l1CrossDomainMessengerDeployment.contract as L1CrossDomainMessenger; | ||
}); | ||
|
||
describe("Deployment", function () { | ||
it("Should set the right LightLinkPortal", async function () { | ||
expect(await l1CrossDomainMessenger.PORTAL()).to.equal( | ||
await lightLinkPortal.getAddress(), | ||
); | ||
}); | ||
|
||
it("Should not be allowed to initialize twice", async function () { | ||
await expect( | ||
l1CrossDomainMessenger | ||
.connect(owner) | ||
.getFunction("initialize") | ||
.send(await lightLinkPortal.getAddress()), | ||
).to.be.revertedWithCustomError( | ||
l1CrossDomainMessenger, | ||
"InvalidInitialization", | ||
); | ||
}); | ||
}); | ||
|
||
// Internal | ||
// describe("gasPayingToken", function () { | ||
// it("Should return ETHER address and decimals 18", async function () { | ||
// expect( await l1CrossDomainMessenger. | ||
// l1CrossDomainMessenger. | ||
// .connect(owner) | ||
// .getFunction("gasPayingToken") | ||
// .send(), | ||
// ).to.be.equal("0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"); | ||
// }); | ||
// }); | ||
}); |