Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve balanceTx error if UTxOAssumptions are broken #3994

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Anviking
Copy link
Member

@Anviking Anviking commented Jun 15, 2023

  • I have ...

Comments

Issue Number

ADP-3056

@Anviking Anviking self-assigned this Jun 15, 2023
@Anviking Anviking force-pushed the anviking/ADP-3056/ErrViolatesUTxOAssumptions branch from 0847f3c to ce8e012 Compare June 15, 2023 18:29
@@ -277,6 +282,7 @@ data ErrSelectAssets

data ErrBalanceTxInternalError
= ErrUnderestimatedFee W.Coin SealedTx KeyWitnessCount
| ErrUTxOViolatesAssumptions UTxOAssumptionViolation
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not actually an internal balanceTx error. In the HTTP API it is an internal wallet error, but not here, only looking at balanceTx. Will move.

@Anviking
Copy link
Member Author

Failing with:

test/unit/Cardano/Wallet/Api/TypesSpec.hs:978:9:
--
  | cardano-wallet-test-unit>   1) Cardano.Wallet.Api.Types, Api Errors, Every ApiErrorInfo constructor has a corresponding schema type
  | cardano-wallet-test-unit>        Falsified (after 1 test):
  | cardano-wallet-test-unit>          Missing ApiErrorInfo constructors for:
  | cardano-wallet-test-unit>          ["UTxOAssumptionsViolated"]
  | cardano-wallet-test-unit>          Each of these need a corresponding swagger type of the form:
  | cardano-wallet-test-unit>          x-errConstructorName

Not sure it makes full sense to have to provide user-facing specifications for all the err500 errors 🤔

@@ -3041,7 +3099,8 @@ instance Arbitrary Wallet' where
genShelleyVkAddr = Cardano.shelleyAddressInEra
<$> (Cardano.makeShelleyAddress
<$> genNetworkId
<*> genPaymentCredential -- only vk credentials
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was also generating script credentials

@@ -2515,6 +2557,7 @@ balanceTransactionSpec = describe "balanceTransaction" $ do

wallet = mkTestWallet (utxo [Coin 5_000_000])


Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

outs = map (TxOut dummyBootstrapAddr . TokenBundle.fromCoin) coins
dummyHash = Hash $ B8.replicate 32 '0'


Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@@ -488,6 +489,8 @@ import qualified Cardano.Wallet.Primitive.Types.Tx.TxOut.Gen as TxOutGen
import qualified Cardano.Wallet.Shelley.Compatibility as Compatibility
import qualified Cardano.Wallet.Write.ProtocolParameters as Write
import qualified Cardano.Wallet.Write.Tx as Write
import Cardano.Wallet.Write.UTxOAssumptions
( UTxOAssumptionViolation (UTxOAssumptionViolation) )
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong section

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant