-
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 ledger presentation of multi-asset values directly. Lens to make this uniform over ShelleyBasedEra
#360
Changes from 10 commits
a52cb17
0bef5e3
46ad8e4
f4fca13
d5e61c9
e462623
5cd6506
589fb20
984ebfa
0008725
9774286
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,6 @@ library internal | |
Cardano.Api.Eon.AlonzoEraOnwards | ||
Cardano.Api.Eon.BabbageEraOnwards | ||
Cardano.Api.Eon.ByronEraOnly | ||
Cardano.Api.Eon.ByronToAllegraEra | ||
Cardano.Api.Eon.ByronToAlonzoEra | ||
Cardano.Api.Eon.ConwayEraOnwards | ||
Cardano.Api.Eon.MaryEraOnwards | ||
|
@@ -170,6 +169,7 @@ library internal | |
, errors | ||
, filepath | ||
, formatting | ||
, groups | ||
, iproute | ||
, memory | ||
, microlens | ||
|
@@ -223,6 +223,7 @@ library | |
-- exposed by cardano-api-ledger | ||
Cardano.Api.Ledger | ||
|
||
reexported-modules: Cardano.Api.Ledger.Lens | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New export so we can use eon enabled from the CLI and from tests. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just expose it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code needs to live in the |
||
|
||
build-depends: bytestring | ||
, cardano-api:internal | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
module Cardano.Api.Eras.Case | ||
( -- Case on CardanoEra | ||
caseByronOrShelleyBasedEra | ||
, caseByronToAllegraOrMaryEraOnwards | ||
, caseByronToAlonzoOrBabbageEraOnwards | ||
|
||
-- Case on ShelleyBasedEra | ||
|
@@ -22,7 +21,6 @@ module Cardano.Api.Eras.Case | |
, disjointByronEraOnlyAndShelleyBasedEra | ||
|
||
-- Conversions | ||
, shelleyToAllegraEraToByronToAllegraEra | ||
, shelleyToAlonzoEraToShelleyToBabbageEra | ||
, alonzoEraOnwardsToMaryEraOnwards | ||
, babbageEraOnwardsToMaryEraOnwards | ||
|
@@ -33,7 +31,6 @@ import Cardano.Api.Eon.AllegraEraOnwards | |
import Cardano.Api.Eon.AlonzoEraOnwards | ||
import Cardano.Api.Eon.BabbageEraOnwards | ||
import Cardano.Api.Eon.ByronEraOnly | ||
import Cardano.Api.Eon.ByronToAllegraEra | ||
import Cardano.Api.Eon.ByronToAlonzoEra | ||
import Cardano.Api.Eon.ConwayEraOnwards | ||
import Cardano.Api.Eon.MaryEraOnwards | ||
|
@@ -60,22 +57,6 @@ caseByronOrShelleyBasedEra l r = \case | |
BabbageEra -> r ShelleyBasedEraBabbage | ||
ConwayEra -> r ShelleyBasedEraConway | ||
|
||
-- | @caseByronToAllegraOrMaryEraOnwards f g era@ applies @f@ to byron, shelley, and allegra; | ||
-- and @g@ to mary and later eras. | ||
caseByronToAllegraOrMaryEraOnwards :: () | ||
=> (ByronToAllegraEraConstraints era => ByronToAllegraEra era -> a) | ||
-> (MaryEraOnwardsConstraints era => MaryEraOnwards era -> a) | ||
-> CardanoEra era | ||
-> a | ||
caseByronToAllegraOrMaryEraOnwards l r = \case | ||
ByronEra -> l ByronToAllegraEraByron | ||
ShelleyEra -> l ByronToAllegraEraShelley | ||
AllegraEra -> l ByronToAllegraEraAllegra | ||
MaryEra -> r MaryEraOnwardsMary | ||
AlonzoEra -> r MaryEraOnwardsAlonzo | ||
BabbageEra -> r MaryEraOnwardsBabbage | ||
ConwayEra -> r MaryEraOnwardsConway | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deletes a case function because we don't need it anymore. |
||
|
||
-- | @caseByronToAlonzoOrBabbageEraOnwards f g era@ applies @f@ to byron, shelley, allegra, mary, and alonzo; | ||
-- and @g@ to babbage and later eras. | ||
caseByronToAlonzoOrBabbageEraOnwards :: () | ||
|
@@ -174,11 +155,6 @@ noByronEraInShelleyBasedEra = flip disjointByronEraOnlyAndShelleyBasedEra | |
disjointByronEraOnlyAndShelleyBasedEra :: ByronEraOnly era -> ShelleyBasedEra era -> a | ||
disjointByronEraOnlyAndShelleyBasedEra ByronEraOnlyByron sbe = case sbe of {} | ||
|
||
shelleyToAllegraEraToByronToAllegraEra :: ShelleyToAllegraEra era -> ByronToAllegraEra era | ||
shelleyToAllegraEraToByronToAllegraEra = \case | ||
ShelleyToAllegraEraShelley -> ByronToAllegraEraShelley | ||
ShelleyToAllegraEraAllegra -> ByronToAllegraEraAllegra | ||
|
||
shelleyToAlonzoEraToShelleyToBabbageEra :: () | ||
=> ShelleyToAlonzoEra era | ||
-> ShelleyToBabbageEra era | ||
|
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 import
groups
because ledger implementsGroup
for multi-asset values which we can use to negate the entireL.Value ledgerera
.