-
Notifications
You must be signed in to change notification settings - Fork 23
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
Use the ledger's Coin instead of our custom Lovelace type #475
Conversation
e5342d6
to
de27351
Compare
…ledger-pp-serialization Revert "query protocol parameters: use ledger instances"
5f42bc4
to
623466e
Compare
623466e
to
674dfb8
Compare
674dfb8
to
46c1e60
Compare
The transaction does not balance in its use of ada. The net balance of the transaction is negative: Coin 1 lovelace. The usual solution is to provide more inputs, or inputs with more ada. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message reads odd ... Coin 1 lovelace
. Can we add Pretty
instance for L.Coin
and use it for human-readable printing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in the two additional commits 👍
@@ -189,6 +190,8 @@ deriving instance Data Bech32.CharPosition | |||
deriving newtype instance Real L.Coin | |||
deriving newtype instance Integral L.Coin | |||
deriving newtype instance Num L.Coin | |||
instance Pretty L.Coin where | |||
pretty (L.Coin n) = pretty n <+> "lovelace" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretty (L.Coin n) = pretty n <+> "lovelace" | |
pretty (L.Coin n) = pretty n <+> "Lovelace" |
Lovelace is capitalized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, changed 👍
544541e
to
cc73f18
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 We should have probably deprecated the Lovelace
type with a warning and then removed it fully after a release.
@@ -47,15 +47,11 @@ module Cardano.Api.Value | |||
-- * Internal conversion functions | |||
, toByronLovelace | |||
, fromByronLovelace | |||
, toShelleyLovelace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Changelog
Context
L.Coin
instead ofLovelace
#368Checklist