From aa4739deea3acb26e455235b00aa39ea7c155fb4 Mon Sep 17 00:00:00 2001 From: Greg Hale Date: Fri, 1 Sep 2023 12:46:12 -0700 Subject: [PATCH] syntax improvements --- src/Pact/Types/Crypto.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Pact/Types/Crypto.hs b/src/Pact/Types/Crypto.hs index e93d72be2..f97195dd8 100644 --- a/src/Pact/Types/Crypto.hs +++ b/src/Pact/Types/Crypto.hs @@ -217,7 +217,7 @@ instance Scheme (SPPKScheme 'WebAuthn) where let pactHashText :: T.Text = PactHash.hashToText msg if pactHashText == challenge then return () - else Left $ "Hash mismatch" + else Left "Hash mismatch" --------- SCHEME HELPER DATA TYPES --------- @@ -422,12 +422,12 @@ instance A.FromJSON WebAuthnSignature where clientDataJSON <- o .: "clientDataJSON" authenticatorData <- o .: "authenticatorData" signature <- o .: "signature" - pure $ WebAuthnSignature { clientDataJSON, authenticatorData, signature } + pure $ WebAuthnSignature {..} -- | This type represents a challenge that was used during -- a WebAuthn "assertion" flow. For signing Pact payloads, this -- is the PactHash of a transaction. -data ClientDataJSON = ClientDataJSON { +newtype ClientDataJSON = ClientDataJSON { challenge :: T.Text } deriving (Show, Generic)