Skip to content

Commit

Permalink
adjust affected stake pools integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed Apr 23, 2024
1 parent 9261b8a commit bc651c6
Showing 1 changed file with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -577,20 +577,25 @@ spec = describe "SHELLEY_STAKE_POOLS" $ do

it
"STAKE_POOLS_JOIN_02 - \
\Cannot join already joined stake pool"
\Cannot join already joined stake pool in Babbage but can in Conway"
$ \ctx -> runResourceT $ do
w <- fixtureWallet ctx
pool : _ <- map (view #id) <$> notRetiringPools ctx

waitForTxStatus ctx w InLedger . getResponse
=<< joinStakePool @n ctx (SpecificPool pool) (w, fixturePassphrase)

let expectedResponse =
if _mainEra ctx >= ApiConway
then
[ expectResponseCode HTTP.status202 ]
else
[ expectResponseCode HTTP.status403
, expectErrorMessage (errMsg403PoolAlreadyJoined $ toText pool)
]
joinStakePool @n ctx (SpecificPool pool) (w, fixturePassphrase)
>>= flip
verify
[ expectResponseCode HTTP.status403
, expectErrorMessage (errMsg403PoolAlreadyJoined $ toText pool)
]
verify expectedResponse

it "STAKE_POOLS_JOIN_03 - Cannot join a pool that has retired" $ \ctx -> runResourceT $ do
waitForEpoch 3 ctx -- One pool retires at epoch 3
Expand Down Expand Up @@ -967,14 +972,19 @@ spec = describe "SHELLEY_STAKE_POOLS" $ do
verify
[expectField #delegation (`shouldBe` deleg)]

-- Cannot join the same pool
-- Cannot join the same pool in Babbage but can in Conway
let expectedResponse =
if _mainEra ctx >= ApiConway
then
[ expectResponseCode HTTP.status200 ]
else
[ expectResponseCode HTTP.status403
, expectErrorMessage (errMsg403PoolAlreadyJoined $ toText pool1)
]
liftIO
$ joinStakePoolUnsigned @n @'Shelley ctx w (ApiT pool1)
>>= flip
verify
[ expectResponseCode HTTP.status403
, expectErrorMessage (errMsg403PoolAlreadyJoined (toText pool1))
]
verify expectedResponse

-- Can join another pool
liftIO
Expand Down

0 comments on commit bc651c6

Please sign in to comment.