Skip to content

Commit

Permalink
Revert "Drop unused ErrBalanceTxConflictingNetworks"
Browse files Browse the repository at this point in the history
This reverts commit a668515.
  • Loading branch information
Anviking committed Dec 19, 2024
1 parent 3210b4a commit 176bfe7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/api/src/Cardano/Wallet/Api/Http/Server/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,12 @@ instance (Write.IsRecentEra era, IsServerError (ErrAssignRedeemers era))
TokenBundle shortfallAda shortfallAssets =
toWalletTokenBundle $ e ^. #shortfall
ErrBalanceTxAssignRedeemers err -> toServerError err
ErrBalanceTxConflictingNetworks ->
apiError err403 BalanceTxConflictingNetworks $ T.unwords
[ "There are withdrawals for multiple networks (e.g. both"
, "mainnet and testnet) in the provided transaction. This"
, "makes no sense, and I'm confused."
]
ErrBalanceTxExistingCollateral ->
apiError err403 BalanceTxExistingCollateral
"I cannot balance transactions with pre-defined collateral."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ data ErrBalanceTx era
| ErrBalanceTxExistingReturnCollateral
| ErrBalanceTxInsufficientCollateral
(ErrBalanceTxInsufficientCollateralError era)
| ErrBalanceTxConflictingNetworks
| ErrBalanceTxAssignRedeemers (ErrAssignRedeemers era)
| ErrBalanceTxInternalError (ErrBalanceTxInternalError era)
| ErrBalanceTxInputResolutionConflicts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,8 @@ prop_balanceTxValid
label "existing collateral return outputs" True
Left ErrBalanceTxMaxSizeLimitExceeded{} ->
label "maxTxSize limit exceeded" $ property True
Left ErrBalanceTxConflictingNetworks ->
label "conflicting networks" $ property True
Left ErrBalanceTxUnableToCreateInput ->
label "unable to create input" $ property True
Left (ErrBalanceTxInternalError
Expand Down
15 changes: 15 additions & 0 deletions specifications/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5097,6 +5097,20 @@ x-errTxNotInNodeEra: &errTxNotInNodeEra
type: string
enum: ["tx_not_in_node_era"]

x-errBalanceTxConflictingNetworks: &errBalanceTxConflictingNetworks
<<: *responsesErr
title: balance_tx_conflicting_networks
properties:
message:
type: string
description: |
There are withdrawals for multiple networks
(e.g. both mainnet and testnet) in the provided transaction.
This makes no sense, and I'm confused.
code:
type: string
enum: ["balance_tx_conflicting_networks"]

x-errTranslationByronTxOutInContext: &errTranslationByronTxOutInContext
<<: *responsesErr
title: translation_byron_tx_out_in_context
Expand Down Expand Up @@ -6764,6 +6778,7 @@ x-responsesBalanceTransaction: &responsesBalanceTransaction
oneOf:
- <<: *errAlreadyWithdrawing
- <<: *errNodeNotYetInRecentEra
- <<: *errBalanceTxConflictingNetworks
- <<: *errBalanceTxExistingCollateral
- <<: *errBalanceTxExistingKeyWitnesses
- <<: *errBalanceTxExistingReturnCollateral
Expand Down

0 comments on commit 176bfe7

Please sign in to comment.