Skip to content

Commit

Permalink
update integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed Oct 13, 2021
1 parent 1ae5d26 commit 856a74e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
Expand Up @@ -98,6 +98,7 @@ module Test.Integration.Framework.TestData
, errMsg403TemplateInvalidScript
, errMsg403InvalidConstructTx
, errMsg403transactionAlreadyBalanced
, errMsg403MissingWitnesses
) where

import Prelude
Expand Down Expand Up @@ -626,6 +627,10 @@ errMsg403transactionAlreadyBalanced :: String
errMsg403transactionAlreadyBalanced =
"The transaction is already balanced. Please send a transaction that requires more inputs/outputs to be picked to be balanced."

errMsg403MissingWitnesses :: String
errMsg403MissingWitnesses =
"I couldn't submit a transaction with missing witnesses."

--------------------------------------------------------------------------------
-- Transaction metadata
--------------------------------------------------------------------------------
Expand Down
Expand Up @@ -126,6 +126,7 @@ import Test.Integration.Framework.TestData
( errMsg403Fee
, errMsg403InvalidConstructTx
, errMsg403MinUTxOValue
, errMsg403MissingWitnesses
, errMsg403NotDelegating
, errMsg403NotEnoughMoney
, errMsg403transactionAlreadyBalanced
Expand Down Expand Up @@ -1130,7 +1131,9 @@ spec = describe "NEW_SHELLEY_TRANSACTIONS" $ do
request @(ApiConstructTransaction n) ctx constructEndpoint Default payload

-- Submit tx
void $ submitTx ctx sealedTx [ expectResponseCode HTTP.status500 ]
void $ submitTx ctx sealedTx
[ expectResponseCode HTTP.status403
, expectErrorMessage errMsg403MissingWitnesses ]

it "TRANS_NEW_SIGN_03 - Sign withdrawals" $ \ctx -> runResourceT $ do
(w, _) <- rewardWallet ctx
Expand Down
2 changes: 1 addition & 1 deletion lib/core/src/Cardano/Wallet/Api/Server.hs
Expand Up @@ -3822,7 +3822,7 @@ instance IsServerError ErrSubmitTx where
}
ErrSubmitTxImpossible e -> toServerError e
ErrSubmitTxMissingWitnesses ->
apiError err404 MissingWitnesses $ mconcat
apiError err403 MissingWitnesses $ mconcat
[ "I couldn't submit a transaction with missing witnesses."
]

Expand Down
1 change: 0 additions & 1 deletion lib/core/src/Cardano/Wallet/Primitive/Types/Tx.hs
@@ -1,5 +1,4 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingVia #-}
Expand Down

0 comments on commit 856a74e

Please sign in to comment.