diff --git a/packages/lazytower.sol/contracts/README.md b/packages/lazytower.sol/contracts/README.md index e3b3d88..a30e48d 100644 --- a/packages/lazytower.sol/contracts/README.md +++ b/packages/lazytower.sol/contracts/README.md @@ -65,19 +65,19 @@ yarn add @zk-kit/lazytower.sol pragma solidity ^0.8.4; -import "../LazyTower.sol"; +import "../LazyTowerHashChain.sol"; -contract LazyTowerTest { - using LazyTower for LazyTowerData; +contract LazyTowerHashChainTest { + using LazyTowerHashChain for LazyTowerHashChainData; - // LazyTower may emit multiple events in a singal add() call - event Add(uint8 indexed level, uint64 indexed lvFullIndex, uint256 value); + event Add(uint256 item); // map for multiple test cases - mapping(bytes32 => LazyTowerData) public towers; + mapping(bytes32 => LazyTowerHashChainData) public towers; function add(bytes32 _towerId, uint256 _item) external { towers[_towerId].add(_item); + emit Add(_item); } function getDataForProving(bytes32 _towerId) @@ -101,7 +101,7 @@ contract LazyTowerTest { import { Contract } from "ethers" import { task, types } from "hardhat/config" -task("deploy:ht-test", "Deploy a LazyTowerTest contract") +task("deploy:lazytower-test", "Deploy a LazyTowerHashChainTest contract") .addOptionalParam("logs", "Print the logs", true, types.boolean) .setAction(async ({ logs }, { ethers }): Promise => { const PoseidonT3Factory = await ethers.getContractFactory("PoseidonT3") @@ -111,7 +111,7 @@ task("deploy:ht-test", "Deploy a LazyTowerTest contract") console.info(`PoseidonT3 library has been deployed to: ${PoseidonT3.address}`) } - const LazyTowerLibFactory = await ethers.getContractFactory("LazyTower", { + const LazyTowerLibFactory = await ethers.getContractFactory("LazyTowerHashChain", { libraries: { PoseidonT3: PoseidonT3.address } @@ -121,12 +121,12 @@ task("deploy:ht-test", "Deploy a LazyTowerTest contract") await lazyTowerLib.deployed() if (logs) { - console.info(`LazyTower library has been deployed to: ${lazyTowerLib.address}`) + console.info(`LazyTowerHashChain library has been deployed to: ${lazyTowerLib.address}`) } - const ContractFactory = await ethers.getContractFactory("LazyTowerTest", { + const ContractFactory = await ethers.getContractFactory("LazyTowerHashChainTest", { libraries: { - LazyTower: lazyTowerLib.address + LazyTowerHashChain: lazyTowerLib.address } }) diff --git a/packages/lazytower.sol/contracts/test/LazyTowerHashChainTest.sol b/packages/lazytower.sol/contracts/test/LazyTowerHashChainTest.sol index eb6804d..e25c7e9 100644 --- a/packages/lazytower.sol/contracts/test/LazyTowerHashChainTest.sol +++ b/packages/lazytower.sol/contracts/test/LazyTowerHashChainTest.sol @@ -7,7 +7,6 @@ import "../LazyTowerHashChain.sol"; contract LazyTowerHashChainTest { using LazyTowerHashChain for LazyTowerHashChainData; - // LazyTower may emit multiple events in a singal add() call event Add(uint256 item); // map for multiple test cases diff --git a/packages/lazytower.sol/hardhat.config.ts b/packages/lazytower.sol/hardhat.config.ts index 7662e1e..407ab71 100644 --- a/packages/lazytower.sol/hardhat.config.ts +++ b/packages/lazytower.sol/hardhat.config.ts @@ -3,7 +3,7 @@ import { config as dotenvConfig } from "dotenv" import { HardhatUserConfig } from "hardhat/config" import { resolve } from "path" import { config } from "./package.json" -import "./tasks/deploy-ht-test" +import "./tasks/deploy-lazytower-test" dotenvConfig({ path: resolve(__dirname, "./.env") }) diff --git a/packages/lazytower.sol/tasks/deploy-ht-test.ts b/packages/lazytower.sol/tasks/deploy-lazytower-test.ts similarity index 94% rename from packages/lazytower.sol/tasks/deploy-ht-test.ts rename to packages/lazytower.sol/tasks/deploy-lazytower-test.ts index 246c90a..0a61497 100644 --- a/packages/lazytower.sol/tasks/deploy-ht-test.ts +++ b/packages/lazytower.sol/tasks/deploy-lazytower-test.ts @@ -1,7 +1,7 @@ import { Contract } from "ethers" import { task, types } from "hardhat/config" -task("deploy:ht-test", "Deploy a LazyTowerTest contract") +task("deploy:lazytower-test", "Deploy a LazyTowerHashChainTest contract") .addOptionalParam("logs", "Print the logs", true, types.boolean) .setAction(async ({ logs }, { ethers }): Promise => { const PoseidonT3Factory = await ethers.getContractFactory("PoseidonT3") diff --git a/packages/lazytower.sol/test/LazyTowerHashChainTest.ts b/packages/lazytower.sol/test/LazyTowerHashChainTest.ts index 6c7d28e..bb774b4 100644 --- a/packages/lazytower.sol/test/LazyTowerHashChainTest.ts +++ b/packages/lazytower.sol/test/LazyTowerHashChainTest.ts @@ -9,7 +9,7 @@ describe("LazyTowerHashChainTest", () => { let contract: Contract before(async () => { - contract = await run("deploy:ht-test", { logs: false }) + contract = await run("deploy:lazytower-test", { logs: false }) }) it("Should produce correct levelLengths, digests and digest of digests", async () => {