Skip to content

Commit

Permalink
align core unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed May 25, 2021
1 parent 8e25234 commit cc5f4b0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions lib/core/test/unit/Cardano/Wallet/Api/TypesSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1724,9 +1724,17 @@ instance Arbitrary (Quantity "percent" Double) where

instance Arbitrary ApiVerificationKeyShelley where
arbitrary =
fmap ApiVerificationKeyShelley . (,)
<$> fmap B8.pack (replicateM 32 arbitrary)
<*> elements [UtxoExternal, UtxoInternal, MutableAccount]
oneof [noHashedGen, hashedGen]
where
noHashedGen = do
payload' <- fmap B8.pack (replicateM 32 arbitrary)
role' <- elements [UtxoExternal, MutableAccount]
pure $ ApiVerificationKeyShelley (payload', role') WithoutHashing

hashedGen = do
payload' <- fmap B8.pack (replicateM 28 arbitrary)
role' <- elements [UtxoExternal, MutableAccount]
pure $ ApiVerificationKeyShelley (payload', role') WithHashing

instance ToSchema ApiVerificationKeyShelley where
declareNamedSchema _ = declareSchemaForDefinition "ApiVerificationKeyShelley"
Expand Down
4 changes: 2 additions & 2 deletions specifications/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1869,7 +1869,7 @@ components:
ApiVerificationKeyShelley: &ApiVerificationKeyShelley
type: string
format: bech32
pattern: "^((addr_vk)|(stake_vk))1[0-9a-z]*$"
pattern: "^((addr_vk)|(stake_vk)|(addr_vkh)|(stake_vkh))1[0-9a-z]*$"

ApiVerificationKeyShared: &ApiVerificationKeyShared
type: string
Expand Down Expand Up @@ -4548,7 +4548,7 @@ paths:
responses: *responsesPostAccountKey

/wallets/{walletId}/keys:
post:
get:
operationId: getAccountKey
tags: ["Keys"]
summary: Get
Expand Down

0 comments on commit cc5f4b0

Please sign in to comment.