Skip to content

Commit

Permalink
Byron.CoinSelections
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed May 17, 2024
1 parent 6bf396d commit 3d54473
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ import Cardano.Wallet.Api.Types
import Cardano.Wallet.Api.Types.Amount
( ApiAmount (ApiAmount)
)
import Cardano.Wallet.Api.Types.Error
( ApiErrorInfo (..)
, ApiErrorNoSuchWallet (ApiErrorNoSuchWallet)
)
import Cardano.Wallet.Primitive.NetworkId
( HasSNetworkId
)
Expand All @@ -50,6 +54,7 @@ import Test.Integration.Framework.DSL
( Context (..)
, Headers (..)
, Payload (..)
, decodeErrorInfo
, emptyIcarusWallet
, emptyRandomWallet
, emptyWallet
Expand All @@ -68,7 +73,6 @@ import Test.Integration.Framework.DSL
)
import Test.Integration.Framework.TestData
( errMsg403NotAnIcarusWallet
, errMsg404NoWallet
)

import qualified Cardano.Wallet.Api.Link as Link
Expand Down Expand Up @@ -150,7 +154,9 @@ spec = describe "BYRON_COIN_SELECTION" $ do
let minUTxOValue' = ApiAmount . minUTxOValue $ _mainEra ctx
let payments = pure (AddressAmount addr minUTxOValue' mempty)
_ <- request @ApiByronWallet ctx (Link.deleteWallet @'Byron icW) Default Empty
selectCoins @_ @'Byron ctx icW payments >>= flip verify
r <- selectCoins @_ @'Byron ctx icW payments
verify r
[ expectResponseCode HTTP.status404
, expectErrorMessage (errMsg404NoWallet $ icW ^. walletId)
]
decodeErrorInfo r `shouldBe`
(NoSuchWallet $ ApiErrorNoSuchWallet $ icW ^. walletId)

0 comments on commit 3d54473

Please sign in to comment.