Skip to content

Commit

Permalink
more testing
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed Nov 16, 2023
1 parent 74b68f7 commit 3fabe93
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
5 changes: 5 additions & 0 deletions lib/wallet/test/unit/Cardano/Wallet/Api/TypesSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@ spec = do
jsonTest @WalletPutPassphraseData
jsonTest @(ApiRewardAccount T0)
jsonTest @(ApiExternalCertificate T0)
jsonTest @ApiVoteAction

describe "ApiEra roundtrip" $
it "toApiEra . fromApiEra == id" $ property $ \era -> do
Expand Down Expand Up @@ -2821,6 +2822,10 @@ instance ToSchema WalletPutPassphraseData where
declareNamedSchema _ =
declareSchemaForDefinition "ApiWalletPutPassphraseData"

instance ToSchema ApiVoteAction where
declareNamedSchema _ =
declareSchemaForDefinition "ApiVoteAction"

instance ToSchema ByronWalletPutPassphraseData where
declareNamedSchema _ =
declareSchemaForDefinition "ApiByronWalletPutPassphraseData"
Expand Down
28 changes: 14 additions & 14 deletions specifications/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1401,19 +1401,6 @@ x-softIndex: &softIndex
maximum: 2147483647
description: A soft derivation index.

x-transactionVote: &transactionVote
description: |
Voting action. One can abstain, give no confidence vote
or vote for a representative by specifying its key hash or script hash.
Voting can be done together with delegation action.
oneOf:
- type: string
enum:
- abstain
- no_confidence
- type: string
<<: *drep

x-multiDelegationAction: &multiDelegationAction
description: |
A delegation action for a given stake key denoted by its soft index.
Expand Down Expand Up @@ -3720,6 +3707,19 @@ components:
asset_name: *assetName
operation: *ApiMintBurnOperation

ApiVoteAction: &ApiVoteAction
description: |
Voting action. One can abstain, give no confidence vote
or vote for a representative by specifying its key hash or script hash.
Voting can be done together with delegation action.
oneOf:
- type: string
enum:
- abstain
- no_confidence
- type: string
<<: *drep

ApiConstructTransactionData: &ApiConstructTransactionData
description: At least one field needs to be chosen
type: object
Expand All @@ -3735,7 +3735,7 @@ components:
description: |
An entry for each unique asset to be minted and/or burned,
containing helpful information.
vote: *transactionVote
vote: *ApiVoteAction
delegations: *transactionDelegations
validity_interval: *ApiValidityInterval
reference_policy_script_template:
Expand Down

0 comments on commit 3fabe93

Please sign in to comment.