From 1e1f6a1b4314348a047bc5347e3ae5c31b19eff5 Mon Sep 17 00:00:00 2001 From: 0xOsiris Date: Fri, 27 Dec 2024 09:37:30 -0600 Subject: [PATCH] test: better assertions --- contracts/test/PBHSignatureAggregator.t.sol | 34 +++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/contracts/test/PBHSignatureAggregator.t.sol b/contracts/test/PBHSignatureAggregator.t.sol index 423a2388..648869b9 100644 --- a/contracts/test/PBHSignatureAggregator.t.sol +++ b/contracts/test/PBHSignatureAggregator.t.sol @@ -87,12 +87,27 @@ contract PBHSignatureAggregatorTest is TestUtils, Setup { decodedProofs[0].pbhExternalNullifier, proof.pbhExternalNullifier, "PBH External Nullifier should match" ); assertEq(decodedProofs[0].nullifierHash, proof.nullifierHash, "Nullifier Hash should match"); - + assertEq(decodedProofs[0].proof[0], proof.proof[0], "Proof should match"); + assertEq(decodedProofs[0].proof[1], proof.proof[1], "Proof should match"); + assertEq(decodedProofs[0].proof[2], proof.proof[2], "Proof should match"); + assertEq(decodedProofs[0].proof[3], proof.proof[3], "Proof should match"); + assertEq(decodedProofs[0].proof[4], proof.proof[4], "Proof should match"); + assertEq(decodedProofs[0].proof[5], proof.proof[5], "Proof should match"); + assertEq(decodedProofs[0].proof[6], proof.proof[6], "Proof should match"); + assertEq(decodedProofs[0].proof[7], proof.proof[7], "Proof should match"); assertEq(decodedProofs[1].root, proof.root, "Root should match"); assertEq( decodedProofs[1].pbhExternalNullifier, proof.pbhExternalNullifier, "PBH External Nullifier should match" ); assertEq(decodedProofs[1].nullifierHash, proof.nullifierHash, "Nullifier Hash should match"); + assertEq(decodedProofs[1].proof[0], proof.proof[0], "Proof should match"); + assertEq(decodedProofs[1].proof[1], proof.proof[1], "Proof should match"); + assertEq(decodedProofs[1].proof[2], proof.proof[2], "Proof should match"); + assertEq(decodedProofs[1].proof[3], proof.proof[3], "Proof should match"); + assertEq(decodedProofs[1].proof[4], proof.proof[4], "Proof should match"); + assertEq(decodedProofs[1].proof[5], proof.proof[5], "Proof should match"); + assertEq(decodedProofs[1].proof[6], proof.proof[6], "Proof should match"); + assertEq(decodedProofs[1].proof[7], proof.proof[7], "Proof should match"); } function testAggregateSignatures_VariableThreshold( @@ -130,12 +145,27 @@ contract PBHSignatureAggregatorTest is TestUtils, Setup { decodedProofs[0].pbhExternalNullifier, proof.pbhExternalNullifier, "PBH External Nullifier should match" ); assertEq(decodedProofs[0].nullifierHash, proof.nullifierHash, "Nullifier Hash should match"); - + assertEq(decodedProofs[0].proof[0], proof.proof[0], "Proof should match"); + assertEq(decodedProofs[0].proof[1], proof.proof[1], "Proof should match"); + assertEq(decodedProofs[0].proof[2], proof.proof[2], "Proof should match"); + assertEq(decodedProofs[0].proof[3], proof.proof[3], "Proof should match"); + assertEq(decodedProofs[0].proof[4], proof.proof[4], "Proof should match"); + assertEq(decodedProofs[0].proof[5], proof.proof[5], "Proof should match"); + assertEq(decodedProofs[0].proof[6], proof.proof[6], "Proof should match"); + assertEq(decodedProofs[0].proof[7], proof.proof[7], "Proof should match"); assertEq(decodedProofs[1].root, proof.root, "Root should match"); assertEq( decodedProofs[1].pbhExternalNullifier, proof.pbhExternalNullifier, "PBH External Nullifier should match" ); assertEq(decodedProofs[1].nullifierHash, proof.nullifierHash, "Nullifier Hash should match"); + assertEq(decodedProofs[1].proof[0], proof.proof[0], "Proof should match"); + assertEq(decodedProofs[1].proof[1], proof.proof[1], "Proof should match"); + assertEq(decodedProofs[1].proof[2], proof.proof[2], "Proof should match"); + assertEq(decodedProofs[1].proof[3], proof.proof[3], "Proof should match"); + assertEq(decodedProofs[1].proof[4], proof.proof[4], "Proof should match"); + assertEq(decodedProofs[1].proof[5], proof.proof[5], "Proof should match"); + assertEq(decodedProofs[1].proof[6], proof.proof[6], "Proof should match"); + assertEq(decodedProofs[1].proof[7], proof.proof[7], "Proof should match"); } function testFailAggregateSignatures_InvalidSignatureLength() public {