@@ -441,7 +441,7 @@ contract ECDSACertificateVerifierUnitTests_verifyCertificate is ECDSACertificate
441441 IECDSACertificateVerifierTypes.ECDSACertificate memory cert =
442442 _createCertificate (referenceTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys);
443443
444- uint [] memory signedStakes = verifier.verifyCertificate (defaultOperatorSet, cert);
444+ ( uint [] memory signedStakes , address [] memory signers ) = verifier.verifyCertificate (defaultOperatorSet, cert);
445445
446446 // Calculate total stakes
447447 uint [] memory totalStakes = new uint [](2 );
@@ -470,7 +470,7 @@ contract ECDSACertificateVerifierUnitTests_verifyCertificate is ECDSACertificate
470470 IECDSACertificateVerifierTypes.ECDSACertificate memory cert =
471471 _createCertificate (referenceTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys);
472472
473- uint [] memory signedStakes = verifier.verifyCertificate (defaultOperatorSet, cert);
473+ ( uint [] memory signedStakes , address [] memory signers ) = verifier.verifyCertificate (defaultOperatorSet, cert);
474474
475475 // Check that the signed stakes are correct
476476 assertEq (signedStakes.length , 2 , "Wrong number of stake types " );
@@ -525,7 +525,7 @@ contract ECDSACertificateVerifierUnitTests_verifyCertificate is ECDSACertificate
525525 IECDSACertificateVerifierTypes.ECDSACertificate memory cert =
526526 _createCertificate (secondTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys);
527527
528- uint [] memory signedStakes = verifier.verifyCertificate (defaultOperatorSet, cert);
528+ ( uint [] memory signedStakes , address [] memory signers ) = verifier.verifyCertificate (defaultOperatorSet, cert);
529529
530530 // Verify all stakes are signed
531531 uint [] memory totalStakes = new uint [](2 );
@@ -565,7 +565,7 @@ contract ECDSACertificateVerifierUnitTests_verifyCertificate is ECDSACertificate
565565 IECDSACertificateVerifierTypes.ECDSACertificate memory cert =
566566 _createCertificate (secondTimestamp, defaultMsgHash, nonSignerIndices, secondOperators, signerPrivKeys);
567567
568- uint [] memory signedStakes = verifier.verifyCertificate (defaultOperatorSet, cert);
568+ ( uint [] memory signedStakes , address [] memory signers ) = verifier.verifyCertificate (defaultOperatorSet, cert);
569569
570570 // Verify only signers' stakes are counted
571571 uint [] memory expectedSignedStakes = new uint [](2 );
@@ -800,7 +800,7 @@ contract ECDSACertificateVerifierUnitTests_verifyCertificateProportion is ECDSAC
800800 thresholds[0 ] = 6000 ; // 60%
801801 thresholds[1 ] = 6000 ; // 60%
802802
803- bool meetsThresholds = verifier.verifyCertificateProportion (defaultOperatorSet, cert, thresholds);
803+ ( bool meetsThresholds , address [] memory signers ) = verifier.verifyCertificateProportion (defaultOperatorSet, cert, thresholds);
804804
805805 // Calculate expected result based on the number of signers
806806 uint signedPercentage = (numSigners * 10_000 ) / numOperators;
@@ -829,10 +829,10 @@ contract ECDSACertificateVerifierUnitTests_verifyCertificateProportion is ECDSAC
829829 thresholds[0 ] = 9000 ; // 90%
830830 thresholds[1 ] = 9000 ; // 90%
831831
832- bool meetsThresholds = verifier.verifyCertificateProportion (defaultOperatorSet, cert, thresholds);
832+ ( bool meetsThresholds , address [] memory signers ) = verifier.verifyCertificateProportion (defaultOperatorSet, cert, thresholds);
833833
834834 // Calculate percentage of signed stakes to determine if it should meet threshold
835- uint [] memory signedStakes = verifier.verifyCertificate (defaultOperatorSet, cert);
835+ ( uint [] memory signedStakes , address [] memory certSigners ) = verifier.verifyCertificate (defaultOperatorSet, cert);
836836 uint [] memory totalStakes = verifier.getTotalStakes (defaultOperatorSet, referenceTimestamp);
837837 uint signedPercentage0 = (signedStakes[0 ] * 10_000 ) / totalStakes[0 ];
838838 uint signedPercentage1 = (signedStakes[1 ] * 10_000 ) / totalStakes[1 ];
@@ -864,10 +864,10 @@ contract ECDSACertificateVerifierUnitTests_verifyCertificateProportion is ECDSAC
864864 thresholds[0 ] = threshold0;
865865 thresholds[1 ] = threshold1;
866866
867- bool meetsThresholds = verifier.verifyCertificateProportion (defaultOperatorSet, cert, thresholds);
867+ ( bool meetsThresholds , address [] memory signers ) = verifier.verifyCertificateProportion (defaultOperatorSet, cert, thresholds);
868868
869869 // Calculate expected result
870- uint [] memory signedStakes = verifier.verifyCertificate (defaultOperatorSet, cert);
870+ ( uint [] memory signedStakes , address [] memory certSigners ) = verifier.verifyCertificate (defaultOperatorSet, cert);
871871 uint [] memory totalStakes = verifier.getTotalStakes (defaultOperatorSet, referenceTimestamp);
872872
873873 bool expectedResult = true ;
@@ -927,14 +927,14 @@ contract ECDSACertificateVerifierUnitTests_verifyCertificateNominal is ECDSACert
927927 _createCertificate (referenceTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys);
928928
929929 // Get the signed stakes for reference
930- uint [] memory signedStakes = verifier.verifyCertificate (defaultOperatorSet, cert);
930+ ( uint [] memory signedStakes , address [] memory certSigners ) = verifier.verifyCertificate (defaultOperatorSet, cert);
931931
932932 // Test with thresholds lower than signed stakes (should pass)
933933 uint [] memory passThresholds = new uint [](2 );
934934 passThresholds[0 ] = signedStakes[0 ] > 10 ? signedStakes[0 ] - 10 : 0 ;
935935 passThresholds[1 ] = signedStakes[1 ] > 10 ? signedStakes[1 ] - 10 : 0 ;
936936
937- bool meetsThresholds = verifier.verifyCertificateNominal (defaultOperatorSet, cert, passThresholds);
937+ ( bool meetsThresholds , address [] memory signers ) = verifier.verifyCertificateNominal (defaultOperatorSet, cert, passThresholds);
938938 assertTrue (meetsThresholds, "Certificate should meet nominal thresholds " );
939939 }
940940
@@ -954,14 +954,14 @@ contract ECDSACertificateVerifierUnitTests_verifyCertificateNominal is ECDSACert
954954 _createCertificate (referenceTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys);
955955
956956 // Get the signed stakes for reference
957- uint [] memory signedStakes = verifier.verifyCertificate (defaultOperatorSet, cert);
957+ ( uint [] memory signedStakes , address [] memory certSigners ) = verifier.verifyCertificate (defaultOperatorSet, cert);
958958
959959 // Test with thresholds higher than signed stakes (should fail)
960960 uint [] memory failThresholds = new uint [](2 );
961961 failThresholds[0 ] = signedStakes[0 ] + 10 ;
962962 failThresholds[1 ] = signedStakes[1 ] + 10 ;
963963
964- bool meetsThresholds = verifier.verifyCertificateNominal (defaultOperatorSet, cert, failThresholds);
964+ ( bool meetsThresholds , address [] memory signers ) = verifier.verifyCertificateNominal (defaultOperatorSet, cert, failThresholds);
965965 assertFalse (meetsThresholds, "Certificate should not meet impossible nominal thresholds " );
966966 }
967967
@@ -982,20 +982,20 @@ contract ECDSACertificateVerifierUnitTests_verifyCertificateNominal is ECDSACert
982982 _createCertificate (referenceTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys);
983983
984984 // Get the signed stakes for reference
985- uint [] memory signedStakes = verifier.verifyCertificate (defaultOperatorSet, cert);
985+ ( uint [] memory signedStakes ,) = verifier.verifyCertificate (defaultOperatorSet, cert);
986986
987987 // Bound thresholds to reasonable values
988- threshold0 = bound (threshold0, 0 , signedStakes[0 ] * 2 );
989- threshold1 = bound (threshold1, 0 , signedStakes[1 ] * 2 );
988+ uint boundedThreshold0 = bound (threshold0, 0 , signedStakes[0 ] * 2 );
989+ uint boundedThreshold1 = bound (threshold1, 0 , signedStakes[1 ] * 2 );
990990
991991 uint [] memory thresholds = new uint [](2 );
992- thresholds[0 ] = threshold0 ;
993- thresholds[1 ] = threshold1 ;
992+ thresholds[0 ] = boundedThreshold0 ;
993+ thresholds[1 ] = boundedThreshold1 ;
994994
995- bool meetsThresholds = verifier.verifyCertificateNominal (defaultOperatorSet, cert, thresholds);
995+ ( bool meetsThresholds ,) = verifier.verifyCertificateNominal (defaultOperatorSet, cert, thresholds);
996996
997997 // Expected result
998- bool expectedResult = (signedStakes[0 ] >= threshold0 ) && (signedStakes[1 ] >= threshold1 );
998+ bool expectedResult = (signedStakes[0 ] >= boundedThreshold0 ) && (signedStakes[1 ] >= boundedThreshold1 );
999999
10001000 assertEq (meetsThresholds, expectedResult, "Nominal threshold check mismatch " );
10011001 }
0 commit comments