Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
WIP Fix solhint, fix fromIndex test case
Browse files Browse the repository at this point in the history
  • Loading branch information
jacque006 committed Sep 22, 2021
1 parent 6fad55e commit 35097c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions contracts/rollup/Rollup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ contract Rollup is BatchManager, EIP712, IEIP712 {
/**
* @dev If this is not being externally consumed, it can be removed.
*/
// solhint-disable-next-line var-name-mixedcase
bytes32 public immutable ZERO_BYTES32;

// External contracts
Expand Down
12 changes: 6 additions & 6 deletions test/slow/rollup.transfer.test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import chai, { assert } from "chai";
import chaiAsPromised from "chai-as-promised";
import { BigNumber } from "ethers";
import { ethers } from "hardhat";
import { flatten } from "lodash";
import { deployAll } from "../../ts/deploy";
import { TESTING_PARAMS } from "../../ts/constants";
import { ethers } from "hardhat";
import { TESTING_PARAMS, ZERO_BYTES32 } from "../../ts/constants";
import { StateTree } from "../../ts/stateTree";
import { AccountRegistry } from "../../ts/accountTree";
import { getAggregateSig, serialize, TxTransfer } from "../../ts/tx";
import * as mcl from "../../ts/mcl";
import { allContracts } from "../../ts/allContractsInterfaces";
import chai, { assert } from "chai";
import chaiAsPromised from "chai-as-promised";
import { getGenesisProof, TransferCommitment } from "../../ts/commitments";
import { float16, USDT } from "../../ts/decimal";
import { hexToUint8Array } from "../../ts/utils";
import { Group, txTransferFactory, User } from "../../ts/factory";
import { deployKeyless } from "../../ts/deployment/deploy";
import { handleNewBatch } from "../../ts/client/batchHandler";
import { BigNumber } from "ethers";
import { Result } from "../../ts/interfaces";

chai.use(chaiAsPromised);
Expand Down Expand Up @@ -239,7 +239,7 @@ describe("Rollup Transfer", async function() {
expectedResult: Result.BadToIndex
}
].forEach(({ description, txsFactory, expectedResult }) => {
it(`dispute and rollback a bad batch with l2 tx(s) with ${description}`, async function() {
it(`dispute and rollback a bad batch with L2 tx(s) with ${description}`, async function() {
const { rollup } = contracts;

const txs = txsFactory();
Expand Down
3 changes: 2 additions & 1 deletion ts/stateTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ export class StateTree implements StateProvider {
this.checkSize(stateID);
const state = this.states[stateID] || ZERO_STATE;
const witness = this.stateTree.witness(stateID).nodes;
return { state, stateHash: state.hash(), witness };
const stateHash = state === ZERO_STATE ? ZERO_BYTES32 : state.hash();
return { state, stateHash, witness };
}

/** Side effect! */
Expand Down

0 comments on commit 35097c8

Please sign in to comment.