Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed Apr 25, 2024
1 parent 1a681e3 commit 98be543
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/api/src/Cardano/Wallet/Api/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1243,13 +1243,13 @@ data EncryptMetadataMethod = AES256CBC
deriving anyclass NFData

instance ToJSON EncryptMetadataMethod where
toJSON AES256CBC = "base"
toJSON AES256CBC = "basic"
instance FromJSON EncryptMetadataMethod where
parseJSON = withText "base" $ \txt ->
if txt == "base" then
if txt == "basic" then
pure AES256CBC
else
fail "'base' is expected."
fail "'basic' is expected."

data ApiEncryptMetadata = ApiEncryptMetadata
{ passphrase :: ApiT (Passphrase "lenient")
Expand Down
8 changes: 8 additions & 0 deletions lib/unit/test/unit/Cardano/Wallet/Api/TypesSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,14 @@ spec = do
parseUrlPiece "patate"
`shouldBe` (Left @Text @(ApiT AddressState) msg)

describe "Api Errors" $ do
it "Every ApiErrorInfo constructor has a corresponding schema type" $
let res = fromJSON @SchemaApiErrorInfo specification
errStr = case res of
Error s -> s
_ -> ""
in counterexample errStr $ res == Success SchemaApiErrorInfo

describe "toMetadataEncrypted openssl goldens" $ do
-- $ echo -n '"secret data"' | openssl enc -e -aes-256-cbc -pbkdf2 -iter 10000 -a -k "cardano" -nosalt
-- vBSywXY+WGcrckHUCyjJcQ==
Expand Down
2 changes: 1 addition & 1 deletion specifications/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1791,7 +1791,7 @@ x-transactionMetadata: &transactionMetadata
x-encryptionMethod: &encryptionMethod
type: string
enum:
- base
- basic

x-encryptMetadata: &encryptMetadata
description: |
Expand Down

0 comments on commit 98be543

Please sign in to comment.