Skip to content

Commit

Permalink
adjust integration testing
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed Apr 30, 2024
1 parent c667050 commit f64e8f5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/api/src/Cardano/Wallet/Api/Http/Server/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ instance IsServerError ErrCannotJoin where
, toText pid
]
ErrAlreadyDelegatingVoting pid ->
apiError err403 PoolAlreadyJoined $ mconcat
apiError err403 PoolAlreadyJoinedSameVote $ mconcat
[ "I couldn't join a stake pool with the given id: "
, toText pid
, " and vote. I have already joined this pool, also voted the same last time;"
Expand Down
1 change: 1 addition & 0 deletions lib/api/src/Cardano/Wallet/Api/Types/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ data ApiErrorInfo
| OutputTokenQuantityExceedsLimit
| PastHorizon
| PoolAlreadyJoined
| PoolAlreadyJoinedSameVote
| QueryParamMissing
| RedeemerInvalidData
| RedeemerScriptFailure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3461,8 +3461,10 @@ spec = describe "NEW_SHELLEY_TRANSACTIONS" $ do
rTx3 <- request @(ApiConstructTransaction n) ctx
(Link.createUnsignedTransaction @'Shelley src) Default delegationJoin
verify rTx3
[ expectResponseCode HTTP.status202
[ expectResponseCode HTTP.status403

]
decodeErrorInfo rTx3 `shouldBe` PoolAlreadyJoinedSameVote

it "TRANS_NEW_JOIN_02 - Can join stakepool in case I have many UTxOs on 1 address"
$ \ctx -> runResourceT $ do
Expand Down
14 changes: 13 additions & 1 deletion specifications/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5200,11 +5200,22 @@ x-errPoolAlreadyJoined: &errPoolAlreadyJoined
properties:
message:
type: string
description: May occur when a given poolId matches the current delegation preferences of the wallet's account (not in Conway onwards).
description: May occur when a given poolId matches the current delegation preferences of the wallet's account (not in Conway onwards provided different vote was also casted).
code:
type: string
enum: ['pool_already_joined']

x-errPoolAlreadyJoinedSameVote: &errPoolAlreadyJoinedSameVote
<<: *responsesErr
title: pool_already_joined_same_vote
properties:
message:
type: string
description: May occur in Conway onwards when a given poolId matches the current delegation preferences of the wallet's account and also the same vote was casted.
code:
type: string
enum: ['pool_already_joined_same_vote']

x-errNotDelegatingTo: &errNotDelegatingTo
<<: *responsesErr
title: not_delegating_to
Expand Down Expand Up @@ -6313,6 +6324,7 @@ x-responsesJoinStakePool: &responsesJoinStakePool
- <<: *errNoUtxosAvailable
- <<: *errWrongEncryptionPassphrase
- <<: *errPoolAlreadyJoined
- <<: *errPoolAlreadyJoinedSameVote
404:
description: Not Found
content:
Expand Down

0 comments on commit f64e8f5

Please sign in to comment.