Skip to content

Commit

Permalink
Resurrect test MIGRATE_07.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed May 13, 2021
1 parent 0db7147 commit 0bcab86
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
Expand Up @@ -490,16 +490,17 @@ spec = describe "BYRON_MIGRATIONS" $ do
(errMsg403NothingToMigrate (sourceWallet ^. walletId))
]

it "BYRON_MIGRATE_07 - invalid payload, parser error" $ \ctx -> runResourceT $ do
liftIO $ pendingWith "Migration endpoints temporarily disabled."
sourceWallet <- emptyRandomWallet ctx

r <- request @[ApiTransaction n] ctx
(Link.migrateWallet @'Byron sourceWallet)
Default
(NonJson "{passphrase:,}")
expectResponseCode HTTP.status400 r
expectErrorMessage errMsg400ParseError r
it "BYRON_MIGRATE_07 - \
\Including an invalidly-formatted passphrase results in a parser error."
$ \ctx -> runResourceT $ do
sourceWallet <- emptyRandomWallet ctx
response <- request @[ApiTransaction n] ctx
(Link.migrateWallet @'Byron sourceWallet) Default
(NonJson "{passphrase:,}")
verify response
[ expectResponseCode HTTP.status400
, expectErrorMessage errMsg400ParseError
]

it "BYRON_MIGRATE_XX - \
\a migration operation removes all funds from the source wallet."
Expand Down
Expand Up @@ -458,6 +458,18 @@ spec = describe "SHELLEY_MIGRATIONS" $ do
(errMsg403NothingToMigrate (sourceWallet ^. walletId))
]

it "SHELLEY_MIGRATE_07 - \
\Including an invalidly-formatted passphrase results in a parser error."
$ \ctx -> runResourceT $ do
sourceWallet <- emptyWallet ctx
response <- request @[ApiTransaction n] ctx
(Link.migrateWallet @'Shelley sourceWallet) Default
(NonJson "{passphrase:,}")
verify response
[ expectResponseCode HTTP.status400
, expectErrorMessage errMsg400ParseError
]

Hspec.it "SHELLEY_MIGRATE_XX - \
\migrating wallet with 'dust' (that complies with minUTxOValue) should pass."
$ \ctx -> runResourceT @IO $ do
Expand Down Expand Up @@ -522,16 +534,6 @@ spec = describe "SHELLEY_MIGRATIONS" $ do
(#balance . #total)
( `shouldBe` Quantity expectedBalance)
]

it "SHELLEY_MIGRATE_07 - invalid payload, parser error" $ \ctx -> runResourceT $ do
liftIO $ pendingWith "Migration endpoints temporarily disabled."
sourceWallet <- emptyWallet ctx
r <- request @[ApiTransaction n] ctx
(Link.migrateWallet @'Shelley sourceWallet)
Default
(NonJson "{passphrase:,}")
expectResponseCode HTTP.status400 r
expectErrorMessage errMsg400ParseError r
where
-- Compute the fee associated with an API transaction.
apiTransactionFee :: ApiTransaction n -> Word64
Expand Down

0 comments on commit 0bcab86

Please sign in to comment.