mirror of
https://github.com/logos-storage/logos-storage-contracts-eth.git
synced 2026-02-06 14:13:24 +00:00
Current tests are failing because ECMUL is not a valid opcode in hardhat. Exploring alternatives.
39 lines
905 B
JavaScript
39 lines
905 B
JavaScript
const { expect } = require("chai")
|
|
const { ethers } = require("hardhat")
|
|
const {
|
|
snapshot,
|
|
revert,
|
|
ensureMinimumBlockHeight,
|
|
currentTime,
|
|
advanceTime,
|
|
advanceTimeTo,
|
|
} = require("./evm")
|
|
const { periodic } = require("./time")
|
|
|
|
describe("Bn254", function () {
|
|
let bn254
|
|
|
|
beforeEach(async function () {
|
|
await snapshot()
|
|
await ensureMinimumBlockHeight(256)
|
|
const Bn254 = await ethers.getContractFactory("TestBn254")
|
|
bn254 = await Bn254.deploy()
|
|
})
|
|
|
|
afterEach(async function () {
|
|
await revert()
|
|
})
|
|
|
|
it("explicit sum and scalar prod are the same", async function () {
|
|
expect(await bn254.f()).to.be.true
|
|
})
|
|
|
|
it("adding point to negation of itself should be zero", async function () {
|
|
expect(await bn254.g()).to.be.true
|
|
})
|
|
|
|
it("multiplication along BN254 emits expected values", async function () {
|
|
expect(await bn254.testMul()).to.be.true
|
|
})
|
|
})
|