diff --git a/test/unit/Chainweb/Test/Pact5/RemotePactTest.hs b/test/unit/Chainweb/Test/Pact5/RemotePactTest.hs index f1b19dc715..a646188a6b 100644 --- a/test/unit/Chainweb/Test/Pact5/RemotePactTest.hs +++ b/test/unit/Chainweb/Test/Pact5/RemotePactTest.hs @@ -188,6 +188,7 @@ tests rdb = withResource' (evaluate httpManager >> evaluate cert) $ \_ -> , invalidTxsTest rdb , testCaseSteps "caplistTest" (caplistTest rdb) , testCaseSteps "allocationTest" (allocationTest rdb) + , testCaseSteps "webAuthnSignatureTest" (webAuthnSignatureTest rdb) ] pollingInvalidRequestKeyTest :: RocksDb -> Step -> IO () @@ -638,6 +639,23 @@ _PEPact5Error = prism' (PEPact5Error . uncurry3 PactErrorCode) $ \case Just (_peCode, _peMsg, _peInfo) _ -> Nothing +-- Test that transactions signed with (mock) WebAuthn keypairs are accepted +-- by the pact service. +webAuthnSignatureTest :: RocksDb -> Step -> IO () +webAuthnSignatureTest rdb _step = runResourceT $ do + let v = pact5InstantCpmTestVersion petersonChainGraph + let cid = unsafeChainId 0 + fixture <- mkFixture v rdb + withFixture fixture $ liftIO $ do + cmd <- buildTextCmd v + $ set cbSigners [mkWebAuthnSigner' sender02WebAuthn [], mkEd25519Signer' sender00 []] + $ set cbRPC (mkExec' "(concat [\"chainweb-\" \"node\"])") + $ defaultCmd + send v cid [cmd] + advanceAllChains_ + poll v cid [cmdToRequestKey cmd] >>= + P.propful [P.match _Just successfulTx] + {- recvPwos <- runCutWithTx v pacts targetMempoolRef blockDb $ \_n _bHeight _bHash bHeader -> do buildCwCmd "transfer-crosschain" v