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

Commit

Permalink
WIP Update tsc failures
Browse files Browse the repository at this point in the history
  • Loading branch information
jacque006 committed Sep 15, 2021
1 parent 8898997 commit 75870d7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ts/stateTree.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Hasher } from "./tree";
import { State, ZERO_STATE } from "./state";
import { TxTransfer, TxMassMigration, TxCreate2Transfer } from "./tx";
import { BigNumber, constants } from "ethers";
import { BigNumber, BytesLike, constants } from "ethers";
import { ZERO_BYTES32 } from "./constants";
import { minTreeDepth, sum } from "./utils";
import {
Expand Down Expand Up @@ -43,6 +43,7 @@ export const nullProvider = new NullProvider();

interface SolStateMerkleProof {
state: State;
stateHash: BytesLike;
witness: string[];
}

Expand All @@ -54,6 +55,7 @@ const PLACEHOLDER_PROOF_WITNESS = Array(STATE_WITNESS_LENGHT).fill(

const PLACEHOLDER_SOL_STATE_PROOF: SolStateMerkleProof = {
state: ZERO_STATE,
stateHash: ZERO_BYTES32,
witness: PLACEHOLDER_PROOF_WITNESS
};

Expand Down Expand Up @@ -112,7 +114,7 @@ export class StateTree implements StateProvider {
this.checkSize(stateID);
const state = this.states[stateID] || ZERO_STATE;
const witness = this.stateTree.witness(stateID).nodes;
return { state, witness };
return { state, stateHash: state.hash(), witness };
}

/** Side effect! */
Expand Down

0 comments on commit 75870d7

Please sign in to comment.