-
Notifications
You must be signed in to change notification settings - Fork 156
Added Dijkstra era #5030
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
Open
Soupstraw
wants to merge
3
commits into
master
Choose a base branch
from
jj/dijkstra-certs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Added Dijkstra era #5030
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Adding a new era to `cardano-ledger` | ||
|
||
First you need to crate a new sub-package in the `eras` directory. | ||
It's easiest to just copy the `.cabal` file from the previous era and then make | ||
some changes to that. Change the name of the project to `cardano-ledger-<era>` | ||
and update the description/synopsis. | ||
|
||
Next you'll want to add a datatype to represent the new era (e.g. `ConwayEra`). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Revision history for cardano-ledger-dijkstra | ||
|
||
## 0.1.0.0 -- YYYY-mm-dd | ||
|
||
* First version. Released on an unsuspecting world. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
cabal-version: 3.0 | ||
name: cardano-ledger-dijkstra | ||
version: 0.1.0.0 | ||
license: Apache-2.0 | ||
maintainer: [email protected] | ||
author: IOHK | ||
bug-reports: https://github.com/intersectmbo/cardano-ledger/issues | ||
synopsis: Cardano ledger with nested transactions | ||
description: | ||
This package builds upon the Conway ledger with a nested transactions system. | ||
|
||
category: Network | ||
build-type: Simple | ||
extra-source-files: CHANGELOG.md | ||
|
||
source-repository head | ||
type: git | ||
location: https://github.com/intersectmbo/cardano-ledger | ||
subdir: eras/dijkstra | ||
|
||
flag asserts | ||
description: Enable assertions | ||
default: False | ||
|
||
library | ||
exposed-modules: | ||
Cardano.Ledger.Dijkstra | ||
Cardano.Ledger.Dijkstra.Era | ||
hs-source-dirs: src | ||
|
||
default-language: Haskell2010 | ||
ghc-options: | ||
-Wall | ||
-Wcompat | ||
-Wincomplete-record-updates | ||
-Wincomplete-uni-patterns | ||
-Wpartial-fields | ||
-Wredundant-constraints | ||
-Wunused-packages | ||
|
||
build-depends: | ||
base >=4.14 && <5, | ||
cardano-ledger-conway, | ||
cardano-ledger-mary, | ||
cardano-ledger-core, | ||
if flag(asserts) | ||
ghc-options: -fno-ignore-asserts | ||
|
||
library testlib | ||
exposed-modules: | ||
visibility: public | ||
hs-source-dirs: testlib | ||
other-modules: Paths_cardano_ledger_dijkstra | ||
default-language: Haskell2010 | ||
ghc-options: | ||
-Wall | ||
-Wcompat | ||
-Wincomplete-record-updates | ||
-Wincomplete-uni-patterns | ||
-Wpartial-fields | ||
-Wredundant-constraints | ||
-Wunused-packages | ||
|
||
build-depends: | ||
base, | ||
|
||
test-suite tests | ||
type: exitcode-stdio-1.0 | ||
main-is: Main.hs | ||
hs-source-dirs: test | ||
other-modules: | ||
Paths_cardano_ledger_dijkstra | ||
|
||
default-language: Haskell2010 | ||
ghc-options: | ||
-Wall | ||
-Wcompat | ||
-Wincomplete-record-updates | ||
-Wincomplete-uni-patterns | ||
-Wredundant-constraints | ||
-Wpartial-fields | ||
-Wunused-packages | ||
-threaded | ||
-rtsopts | ||
-with-rtsopts=-N | ||
|
||
build-depends: | ||
base, | ||
cardano-ledger-dijkstra:{cardano-ledger-dijkstra, testlib}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module Cardano.Ledger.Dijkstra (module X) where | ||
|
||
import Cardano.Ledger.Dijkstra.Era as X |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE TypeFamilies #-} | ||
|
||
module Cardano.Ledger.Dijkstra.Era ( | ||
DijkstraEra, | ||
) where | ||
|
||
import Cardano.Ledger.Conway (ConwayEra) | ||
import Cardano.Ledger.Conway.Core (Era (..), Value) | ||
import Cardano.Ledger.Mary (MaryValue) | ||
|
||
data DijkstraEra | ||
|
||
instance Era DijkstraEra where | ||
type PreviousEra DijkstraEra = ConwayEra | ||
type ProtVerLow DijkstraEra = 12 | ||
type ProtVerHigh DijkstraEra = 12 | ||
|
||
eraName = "Dijkstra" | ||
|
||
type instance Value DijkstraEra = MaryValue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{-# LANGUAGE TypeApplications #-} | ||
|
||
module Main where | ||
|
||
import Cardano.Ledger.Dijkstra (DijkstraEra) | ||
|
||
main :: IO () | ||
main = | ||
ledgerTestMain $ | ||
describe "Dijkstra" $ do | ||
GoldenTranslation.spec | ||
Golden.spec | ||
Spec.spec | ||
Proposals.spec | ||
Binary.spec | ||
Cddl.spec | ||
DRepRatify.spec | ||
CommitteeRatify.spec | ||
SPORatifySpec.spec | ||
Genesis.spec | ||
GovActionReorder.spec | ||
roundTripJsonEraSpec @DijkstraEra | ||
describe "Imp" $ | ||
Imp.spec @DijkstraEra | ||
describe "CostModels" $ do | ||
CostModelsSpec.spec @DijkstraEra | ||
describe "TxWits" $ do | ||
TxWitsSpec.spec @DijkstraEra | ||
describe "Plutus" $ do | ||
PlutusSpec.spec | ||
Regression.spec @DijkstraEra | ||
TxInfo.spec | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think it's fine to put the project directly into
eras/dijkstra
, since we don't want to have thecardano-ledger-<era>-test
packages anymore. This gives us a shorter path to Dijkstra 😉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.
Yes, that is fine, especially since that is the ultimate goal for all of the previous eras. 👍