Skip to content

Commit

Permalink
fix node aux calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
vmidyllic committed Jun 22, 2023
1 parent fe237af commit 4c40ed8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/storage/blockchain/onchain-revocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class OnChainRevocationStorage {
existence: boolean;
auxIndex: bigint;
auxValue: bigint;
auxExistence: boolean;
siblings: bigint[];
}): Proof {
const p = new Proof();
Expand All @@ -74,9 +75,9 @@ export class OnChainRevocationStorage {
value: undefined
} as NodeAux;
} else {
const auxIndex = BigInt(mtp.auxIndex.toString());
const auxValue = BigInt(mtp.auxValue.toString());
if (auxIndex !== 0n && auxValue !== 0n) {
if (mtp.auxExistence) {
const auxIndex = BigInt(mtp.auxIndex.toString());
const auxValue = BigInt(mtp.auxValue.toString());
p.nodeAux = {
key: newHashFromBigInt(auxIndex),
value: newHashFromBigInt(auxValue)
Expand Down

0 comments on commit 4c40ed8

Please sign in to comment.