diff --git a/src/test/contracts/check_signature.mligo b/src/test/contracts/check_signature.mligo index ecd56eb4b..5af7022c0 100644 --- a/src/test/contracts/check_signature.mligo +++ b/src/test/contracts/check_signature.mligo @@ -1,2 +1,24 @@ let check_signature (pk, signed, msg: key * signature * bytes) : bool = Crypto.check pk signed msg + +(* +$ tezos-client gen keys testsign + +$ tezos-client show address testsign -S +Hash: tz1RffmtWjy435AXZuWwLWG6UaJ66ERmgviA +Public Key: edpktz4xg6csJnJ5vcmMb2H37sWXyBDcoAp3XrBvjRaTSQ1zmZTeRQ +Secret Key: unencrypted:edsk34mH9qhMdVWtbammJfYkUoQfwW6Rw5K6rbGW1ajppy3LPNbiJA + +$ tezos-client hash data '"hello"' of type string +Raw packed data: 0x05010000000568656c6c6f +... + +$ tezos-client sign bytes 0x05010000000568656c6c6f for testsign +Signature: edsigtnzKd51CDomKVMFBoU8SzFZgNqRkYUaQH4DLUg8Lsimz98DFB82uiHAkdvx29DDqHxPf1noQ8noWpKMZoxTCsfprrbs4Xo +*) + +let example : bool = + Crypto.check + ("edpktz4xg6csJnJ5vcmMb2H37sWXyBDcoAp3XrBvjRaTSQ1zmZTeRQ" : key) + ("edsigtnzKd51CDomKVMFBoU8SzFZgNqRkYUaQH4DLUg8Lsimz98DFB82uiHAkdvx29DDqHxPf1noQ8noWpKMZoxTCsfprrbs4Xo" : signature) + 0x05010000000568656c6c6f diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index b8270e005..7f9369190 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -2090,6 +2090,7 @@ let check_signature_mligo () : unit result = e_bytes_string "hello world"] in let make_expected = e_bool true in let%bind () = expect_eq program "check_signature" make_input make_expected in + let%bind () = expect_eq_evaluate program "example" (e_bool true) in ok () let check_signature_religo () : unit result =