mirror of
https://github.com/vacp2p/linea-monorepo.git
synced 2026-01-09 04:08:01 -05:00
* first pass contracts and makefile cleanup * remove unused 4844 test files * Remove Goerli references * lint fixing * lint fixing * remove more Goerli references * correct folder paths for L2 service tests * fix pathing and hardhat version * reinstate deleted file * correct file pathing
26 lines
965 B
TypeScript
26 lines
965 B
TypeScript
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
import { expect } from "chai";
|
|
import { TestUtils } from "../../typechain-types";
|
|
import { deployFromFactory } from "../common/deployment";
|
|
import { generateKeccak256, generateRandomBytes } from "../common/helpers";
|
|
|
|
describe("Utils Library", () => {
|
|
let contract: TestUtils;
|
|
|
|
async function deployTestUtilsFixture() {
|
|
return deployFromFactory("TestUtils");
|
|
}
|
|
beforeEach(async () => {
|
|
contract = (await loadFixture(deployTestUtilsFixture)) as TestUtils;
|
|
});
|
|
|
|
describe("efficientKeccak", () => {
|
|
it("Should return the correct keccak hash", async () => {
|
|
const leftValue = generateRandomBytes(32);
|
|
const rightValue = generateRandomBytes(32);
|
|
const solidityKeccakHash = generateKeccak256(["bytes32", "bytes32"], [leftValue, rightValue]);
|
|
expect(await contract.efficientKeccak(leftValue, rightValue)).to.equal(solidityKeccakHash);
|
|
});
|
|
});
|
|
});
|