Skip to content

Commit

Permalink
Merge pull request #82 from 0xPolygonID/fix/onchain
Browse files Browse the repository at this point in the history
fix node aux calculation
  • Loading branch information
vmidyllic authored Jun 23, 2023
2 parents fe237af + 4c40ed8 commit 51e80d2
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 51e80d2

Please sign in to comment.