Skip to content

Commit

Permalink
Add balanceTransaction goldens
Browse files Browse the repository at this point in the history
Produces CSV files with the columns
> wallet balance, fee, minfee, error
for a 1 UTxO wallet balance of 0 to 4 ada,

with the following payloads:
- 1ada-payment
- delegate
- pingPong_1
- pingPong_2
  • Loading branch information
Anviking committed Feb 22, 2022
1 parent 208565d commit e3e4962
Show file tree
Hide file tree
Showing 12 changed files with 637 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ hie.yaml

### auto-generated faulty JSON golden tests ###
*.faulty.json
*.faulty.json
lib/shelley/test/data/balanceTx/**/actual

### Release scripts output
/GENERATED_*.md
Expand Down
1 change: 1 addition & 0 deletions lib/shelley/cardano-wallet.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ test-suite unit
, generic-arbitrary
, generic-lens
, hspec-core
, hspec-golden
, iohk-monitoring
, time
, hspec
Expand Down
1 change: 1 addition & 0 deletions lib/shelley/src/Cardano/Wallet/Shelley/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module Cardano.Wallet.Shelley.Transaction
, _decodeSealedTx
, _estimateMaxNumberOfInputs
, _maxScriptExecutionCost
, mkDelegationCertificates
, estimateTxCost
, estimateTxSize
, mkByronWitness
Expand Down
81 changes: 81 additions & 0 deletions lib/shelley/test/data/balanceTx/1ada-payment/golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
0.000000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 0, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.050000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 50000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.100000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 100000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.150000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 150000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.200000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 200000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.250000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 250000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.300000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 300000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.350000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 350000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.400000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 400000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.450000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 450000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.500000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 500000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.550000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 550000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.600000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 600000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.650000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 650000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.700000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 700000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.750000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 750000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.800000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 800000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.850000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 850000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.900000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 900000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
0.950000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (BalanceInsufficient (BalanceInsufficientError {utxoBalanceAvailable = TokenBundle {coin = Coin 950000, tokens = TokenMap (fromList [])}, utxoBalanceRequired = TokenBundle {coin = Coin 1000000, tokens = TokenMap (fromList [])}}))))
1.000000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (UnableToConstructChange (UnableToConstructChangeError {requiredCost = Coin 169329, shortfall = Coin 169329}))))
1.050000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (UnableToConstructChange (UnableToConstructChangeError {requiredCost = Coin 169329, shortfall = Coin 119329}))))
1.100000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (UnableToConstructChange (UnableToConstructChangeError {requiredCost = Coin 169329, shortfall = Coin 69329}))))
1.150000,,,ErrBalanceTxSelectAssets (ErrSelectAssetsSelectionError (SelectionBalanceErrorOf (UnableToConstructChange (UnableToConstructChangeError {requiredCost = Coin 169329, shortfall = Coin 19329}))))
1.200000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,36083)])
1.250000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,86083)])
1.300000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,136083)])
1.350000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,186083)])
1.400000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,236083)])
1.450000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,286083)])
1.500000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,336083)])
1.550000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,386083)])
1.600000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,436083)])
1.650000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,486083)])
1.700000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,536083)])
1.750000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,586083)])
1.800000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,636083)])
1.850000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,686083)])
1.900000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,736083)])
1.950000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,786083)])
2.000000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,836083)])
2.050000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,886083)])
2.100000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,936083)])
2.150000,,,ErrBalanceTxFailedBalancing (valueFromList [(AdaAssetId,986083)])
2.200000,0.166777,0.166777
2.250000,0.166777,0.166777
2.300000,0.166777,0.166777
2.350000,0.166777,0.166777
2.400000,0.166777,0.166777
2.450000,0.166777,0.166777
2.500000,0.166777,0.166777
2.550000,0.166777,0.166777
2.600000,0.166777,0.166777
2.650000,0.166777,0.166777
2.700000,0.166777,0.166777
2.750000,0.166777,0.166777
2.800000,0.166777,0.166777
2.850000,0.166777,0.166777
2.900000,0.166777,0.166777
2.950000,0.166777,0.166777
3.000000,0.166777,0.166777
3.050000,0.166777,0.166777
3.100000,0.166777,0.166777
3.150000,0.166777,0.166777
3.200000,0.166777,0.166777
3.250000,0.166777,0.166777
3.300000,0.166777,0.166777
3.350000,0.166777,0.166777
3.400000,0.166777,0.166777
3.450000,0.166777,0.166777
3.500000,0.166777,0.166777
3.550000,0.166777,0.166777
3.600000,0.166777,0.166777
3.650000,0.166777,0.166777
3.700000,0.166777,0.166777
3.750000,0.166777,0.166777
3.800000,0.166777,0.166777
3.850000,0.166777,0.166777
3.900000,0.166777,0.166777
3.950000,0.166777,0.166777
4.000000,0.166777,0.166777
81 changes: 81 additions & 0 deletions lib/shelley/test/data/balanceTx/delegate/golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
0.000000,,,ErrBalanceTxNotYetSupported Deposits
0.050000,,,ErrBalanceTxNotYetSupported Deposits
0.100000,,,ErrBalanceTxNotYetSupported Deposits
0.150000,,,ErrBalanceTxNotYetSupported Deposits
0.200000,,,ErrBalanceTxNotYetSupported Deposits
0.250000,,,ErrBalanceTxNotYetSupported Deposits
0.300000,,,ErrBalanceTxNotYetSupported Deposits
0.350000,,,ErrBalanceTxNotYetSupported Deposits
0.400000,,,ErrBalanceTxNotYetSupported Deposits
0.450000,,,ErrBalanceTxNotYetSupported Deposits
0.500000,,,ErrBalanceTxNotYetSupported Deposits
0.550000,,,ErrBalanceTxNotYetSupported Deposits
0.600000,,,ErrBalanceTxNotYetSupported Deposits
0.650000,,,ErrBalanceTxNotYetSupported Deposits
0.700000,,,ErrBalanceTxNotYetSupported Deposits
0.750000,,,ErrBalanceTxNotYetSupported Deposits
0.800000,,,ErrBalanceTxNotYetSupported Deposits
0.850000,,,ErrBalanceTxNotYetSupported Deposits
0.900000,,,ErrBalanceTxNotYetSupported Deposits
0.950000,,,ErrBalanceTxNotYetSupported Deposits
1.000000,,,ErrBalanceTxNotYetSupported Deposits
1.050000,,,ErrBalanceTxNotYetSupported Deposits
1.100000,,,ErrBalanceTxNotYetSupported Deposits
1.150000,,,ErrBalanceTxNotYetSupported Deposits
1.200000,,,ErrBalanceTxNotYetSupported Deposits
1.250000,,,ErrBalanceTxNotYetSupported Deposits
1.300000,,,ErrBalanceTxNotYetSupported Deposits
1.350000,,,ErrBalanceTxNotYetSupported Deposits
1.400000,,,ErrBalanceTxNotYetSupported Deposits
1.450000,,,ErrBalanceTxNotYetSupported Deposits
1.500000,,,ErrBalanceTxNotYetSupported Deposits
1.550000,,,ErrBalanceTxNotYetSupported Deposits
1.600000,,,ErrBalanceTxNotYetSupported Deposits
1.650000,,,ErrBalanceTxNotYetSupported Deposits
1.700000,,,ErrBalanceTxNotYetSupported Deposits
1.750000,,,ErrBalanceTxNotYetSupported Deposits
1.800000,,,ErrBalanceTxNotYetSupported Deposits
1.850000,,,ErrBalanceTxNotYetSupported Deposits
1.900000,,,ErrBalanceTxNotYetSupported Deposits
1.950000,,,ErrBalanceTxNotYetSupported Deposits
2.000000,,,ErrBalanceTxNotYetSupported Deposits
2.050000,,,ErrBalanceTxNotYetSupported Deposits
2.100000,,,ErrBalanceTxNotYetSupported Deposits
2.150000,,,ErrBalanceTxNotYetSupported Deposits
2.200000,,,ErrBalanceTxNotYetSupported Deposits
2.250000,,,ErrBalanceTxNotYetSupported Deposits
2.300000,,,ErrBalanceTxNotYetSupported Deposits
2.350000,,,ErrBalanceTxNotYetSupported Deposits
2.400000,,,ErrBalanceTxNotYetSupported Deposits
2.450000,,,ErrBalanceTxNotYetSupported Deposits
2.500000,,,ErrBalanceTxNotYetSupported Deposits
2.550000,,,ErrBalanceTxNotYetSupported Deposits
2.600000,,,ErrBalanceTxNotYetSupported Deposits
2.650000,,,ErrBalanceTxNotYetSupported Deposits
2.700000,,,ErrBalanceTxNotYetSupported Deposits
2.750000,,,ErrBalanceTxNotYetSupported Deposits
2.800000,,,ErrBalanceTxNotYetSupported Deposits
2.850000,,,ErrBalanceTxNotYetSupported Deposits
2.900000,,,ErrBalanceTxNotYetSupported Deposits
2.950000,,,ErrBalanceTxNotYetSupported Deposits
3.000000,,,ErrBalanceTxNotYetSupported Deposits
3.050000,,,ErrBalanceTxNotYetSupported Deposits
3.100000,,,ErrBalanceTxNotYetSupported Deposits
3.150000,,,ErrBalanceTxNotYetSupported Deposits
3.200000,,,ErrBalanceTxNotYetSupported Deposits
3.250000,,,ErrBalanceTxNotYetSupported Deposits
3.300000,,,ErrBalanceTxNotYetSupported Deposits
3.350000,,,ErrBalanceTxNotYetSupported Deposits
3.400000,,,ErrBalanceTxNotYetSupported Deposits
3.450000,,,ErrBalanceTxNotYetSupported Deposits
3.500000,,,ErrBalanceTxNotYetSupported Deposits
3.550000,,,ErrBalanceTxNotYetSupported Deposits
3.600000,,,ErrBalanceTxNotYetSupported Deposits
3.650000,,,ErrBalanceTxNotYetSupported Deposits
3.700000,,,ErrBalanceTxNotYetSupported Deposits
3.750000,,,ErrBalanceTxNotYetSupported Deposits
3.800000,,,ErrBalanceTxNotYetSupported Deposits
3.850000,,,ErrBalanceTxNotYetSupported Deposits
3.900000,,,ErrBalanceTxNotYetSupported Deposits
3.950000,,,ErrBalanceTxNotYetSupported Deposits
4.000000,,,ErrBalanceTxNotYetSupported Deposits
Loading

0 comments on commit e3e4962

Please sign in to comment.