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

Drop W.Coin, W.UTxO, W.TxOut usage in BalanceSpec #4940

Open
wants to merge 1 commit into
base: anviking/ADP-3413/balanceTx-unit-conway
Choose a base branch
from

Conversation

Anviking
Copy link
Member

@Anviking Anviking commented Jan 13, 2025

Drop a significant part of the usage of W.Coin, W.TxOut, W.UTxO in BalanceSpec, as part
of the effort to eventually consistently only use ledger types.

Depends on #4762

@Anviking Anviking self-assigned this Jan 13, 2025
@Anviking Anviking force-pushed the anviking/BalanceSpec-fewer-wallet-deps branch from 25dfa64 to 95fb19f Compare January 13, 2025 13:02
lovelaceF (Coin l)
| l < 0 = "-" <> pretty (W.Coin.unsafeFromIntegral (-l))
| otherwise = pretty (W.Coin.unsafeFromIntegral l)
lovelaceF (Coin c) = fixedF @Double 6 (fromIntegral c / 1e6)
Copy link
Member Author

Choose a reason for hiding this comment

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

From the W.Coin implementation

address :: IsRecentEra era => TxOut era -> W.Address
address = Convert.toWallet . view addrTxOutL
address :: TxOut era -> Address
address = view addrTxOutL
Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -875,14 +871,14 @@ spec_balanceTx era = describe "balanceTx" $ do
horizon = SlotNo 20
beyondHorizon = SlotNo 21

wallet = mkTestWallet (utxo [W.Coin 5_000_000])
wallet = mkTestWallet (utxo [Coin 5_000_000])
Copy link
Contributor

Choose a reason for hiding this comment

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

why not lovelace here?

Copy link
Contributor

Choose a reason for hiding this comment

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

aha, Coin is not Value ...

Copy link
Contributor

@paweljakubas paweljakubas left a comment

Choose a reason for hiding this comment

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

lgtm 👍

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.

2 participants