@@ -673,11 +673,10 @@ contract EspressoTEEVerifierTest is Test {
673673 abi.encode (true )
674674 );
675675
676- bytes32 typeHash = keccak256 ("EspressoTEEVerifier(bytes32 commitment,uint256 nonce ) " );
676+ bytes32 typeHash = keccak256 ("EspressoTEEVerifier(bytes32 commitment) " );
677677
678678 bytes32 userDataHash = keccak256 ("test data " );
679- uint256 nonce = 0 ;
680- bytes32 structHash = keccak256 (abi.encode (typeHash, userDataHash, nonce));
679+ bytes32 structHash = keccak256 (abi.encode (typeHash, userDataHash));
681680
682681 // Reconstruct EIP-712 domain separator
683682 bytes32 domainSeperator = keccak256 (
@@ -703,24 +702,5 @@ contract EspressoTEEVerifierTest is Test {
703702 signature, userDataHash, IEspressoTEEVerifier.TeeType.NITRO, ServiceType.BatchPoster
704703 );
705704 assertTrue (result);
706-
707- // Now try with the same nonce, it sould fail
708- vm.prank (signerAddr);
709- vm.expectRevert (IEspressoTEEVerifier.InvalidSignature.selector );
710- espressoTEEVerifier.verify (
711- signature, userDataHash, IEspressoTEEVerifier.TeeType.NITRO, ServiceType.BatchPoster
712- );
713-
714- // Now try adding a nonce
715- nonce = 1 ;
716- structHash = keccak256 (abi.encode (typeHash, userDataHash, nonce));
717- digest = keccak256 (abi.encodePacked ("\x19\x01 " , domainSeperator, structHash));
718- (v, r, s) = vm.sign (signerPk, digest);
719- signature = abi.encodePacked (r, s, v);
720- vm.prank (signerAddr);
721- result = espressoTEEVerifier.verify (
722- signature, userDataHash, IEspressoTEEVerifier.TeeType.NITRO, ServiceType.BatchPoster
723- );
724- assertTrue (result);
725705 }
726706}
0 commit comments