Skip to content

Commit

Permalink
Merge pull request #2901 from input-output-hk/lehins/restructure-expe…
Browse files Browse the repository at this point in the history
…riment

Restructure the Core for consistency, clarity and new functionality
  • Loading branch information
Jared Corduan authored Jul 27, 2022
2 parents 14e1bcc + 73b77de commit 9e1479d
Show file tree
Hide file tree
Showing 260 changed files with 9,937 additions and 10,291 deletions.
94 changes: 94 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,100 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
in the naming of release branches.


### Added
- Core type classes: `EraSegWits`, `EraTx`, `EraTxBody`, `EraTxOut`, `EraPParams`,
`EraAuxiliaryData`, `EraWitnesses`, `EraScript`
- Era specific type classes: `ShelleyEraTxBody`, `ShelleyMAEraTxBody`,
`AlonzoEraTxBody`, `AlonzoEraTxOut`, `AlonzoEraTx`, `BabbageEraTxBody`, `BabbageEraTxOut`
- Type class hierarchy:
```
EraSegWits --> EraTx --> EraTxBody --> EraTxOut --> Era
\ `--> EraPParams --> Era
`--> EraWitnesses --> EraScript --> Era
`--> EraAuxiliaryData --> Era
```
- Shelley:
```
ShelleyEraTxBody --> EraTxBody --> EraTxOut --> Era
```
- ShelleyMA:
```
ShelleyMAEraTxBody --> ShelleyEraTxBody --> EraTxBody --> EraTxOut --> Era
```
- Alonzo:
```
AlonzoEraTx --> EraTx --> ...
`--> AlonzoEraTxBody --> ShelleyMAEraTxBody --> ShelleyEraTxBody --> EraTxBody --> ...
`--> AlonzoEraTxOut -> ShelleyEraTxOut --> EraTxOut --> ...
```
- Babbage:
```
BabbageEraTxBody --> AlonzoEraTxBody --> ....
`--> BabbageEraTxOut -> AlonzoEraTxOut -->
```
### Changed
- Renamed `SupportsSegWit` to `EraSegWits`
- Split `ValidateScript` into `EraScript` and `EraTx.validateScript`
- Renamed `ValidateAuxiliaryData` to `EraAuxiliaryData` while removing usage of FunDeps.
- Renamed in `Cardano.Ledger.Shelley`:
- `Tx` to `ShelleyTx` (kept type synonym with a deprecation message)
- `TxOut` to `ShelleyTxOut` (kept type synonym with a deprecation message)
- `TxBody` to `ShelleyTxBody` (kept type synonym with a deprecation message)
- `PParams` to `ShelleyPParams` (kept type synonym with a deprecation message)
- `PParamsUpdate` to `ShelleyPParamsUpdate` (kept type synonym with a deprecation message)
- `AuxiliaryData` to `ShelleyAuxiliaryData` (kept type synonym with a deprecation message)
- Renamed in `Cardano.Ledger.Mary`:
- Renamed `Value` to `MaryValue` (kept type synonym with a deprecation message)
- Renamed in `Cardano.Ledger.ShelleyMA`:
- `TxBody` to `MATxBody` (kept type synonym with a deprecation message)
- `AuxiliaryData` to `ShelleyAuxiliaryData` (kept type synonym with a deprecation message)
- Renamed in `Cardano.Ledger.Alonzo`:
- `ValidatedTx` to `AlonzoTx` (kept type synonym with a deprecation message)
- `TxOut` to `AlonzoTxOut` (kept type synonym with a deprecation message)
- `TxBody` to `AlonzoTxBody` (kept type synonym with a deprecation message)
- `Script` to `AlonzoScript` (kept type synonym with a deprecation message)
- `PParams` to `AlonzoPParams` (kept type synonym with a deprecation message)
- `PParamsUpdate` to `AlonzoPParamsUpdate` (kept type synonym with a deprecation message)
- `AuxiliaryData` to `AlonzoAuxiliaryData` (kept type synonym with a deprecation message)
- Renamed in `Cardano.Ledger.Babbage`:
- `TxOut` to `BabbageTxOut` (kept type synonym with a deprecation message)
- `TxBody` to `BabbageTxBody` (kept type synonym with a deprecation message)
- `PParams` to `BabbagePParams` (kept type synonym with a deprecation message)
- `PParamsUpdate` to `BabbagePParamsUpdate` (kept type synonym with a deprecation message)
### Deprecated
- `getTxOutAddr txOut` in favor of `txOut ^. addrTxOutL`
- `getTxOutEitherAddr txOut` in favor of `txOut ^. addrEitherTxOutL`
- `getTxOutCompactAddr txOut` in favor of `txOut ^. compactAddrTxOutL`
- `getTxOutBootstrapAddress txOut` in favor of `txOut ^. bootAddrTxOutF`
- `getAllInputs txBody` in favor of ` txBody ^. allInputsTxBodyF`
- `getCoin txOut` in favor of `txOut ^. coinTxOutL`
### Removed
- `makeTxOut` in favor of `mkBasicTxOut`
- `HasField` instances for: `"inputs"`, `"outputs"`, `"txfee"`,
`"auxiliaryData"`, `"minted"`, `"wdrls"`, `"ttl"`, `"update"`, `"certs"`,
`"vldt"`, `"mint"`, `"collateral"`, `"reqSignerHashes"`,
`"scriptIntegrityHash"`, `"txnetworkid"`, `"sizedOutputs"`,
`"referenceInputs"`, `"totalCollateral"`, `"collateralReturn"`,
`"sizedCollateralReturn"`, `"body"`, `"wits"`, `"auxData"`, `"size"`,
`"isValid"`, `"addrWits"`, `"scriptWits"`, `"bootWits"`, `"txdatahash"`,
`"addr"`, `"bootAddr"`, `"script"`, `"dats"`, `"rdmrs"`
- `ValidateScript` in favor of `EraScript` and `EraTx`
- Type class synonyms:
- `Trans*`
- `Uses*`: `UsesPParams`, `UsesScript`, `UsesTxBody`, `UsesTxOut`, `UsesAuxiliaryData`
- `BlockAnn`
- `ChainData`
- `AnnotatedData`
- `SerialisableData`
- `WellFormed`
- `ConcreteAlonzo`
- `ConcreteBabbage`
- ...

### Fixed


## [Unreleased]
### Added
- Added `coinsPerUTxOByteToCoinsPerUTxOWord` helper function for Babbage
Expand Down
15 changes: 9 additions & 6 deletions eras/alonzo/impl/cardano-ledger-alonzo.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ library
Cardano.Ledger.Alonzo.Language
Cardano.Ledger.Alonzo.PlutusScriptApi
Cardano.Ledger.Alonzo.PParams
Cardano.Ledger.Alonzo.Rules.Bbody
Cardano.Ledger.Alonzo.Rules.Ledger
Cardano.Ledger.Alonzo.Rules.Utxo
Cardano.Ledger.Alonzo.Rules.Utxos
Cardano.Ledger.Alonzo.Rules.Utxow
Cardano.Ledger.Alonzo.Rules
Cardano.Ledger.Alonzo.Scripts
Cardano.Ledger.Alonzo.Tools
Cardano.Ledger.Alonzo.Translation
Expand All @@ -55,7 +51,13 @@ library
Cardano.Ledger.Alonzo.TxInfo
Cardano.Ledger.Alonzo.TxSeq
Cardano.Ledger.Alonzo.TxWitness
Cardano.Ledger.DescribeEras
other-modules:
Cardano.Ledger.Alonzo.Era
Cardano.Ledger.Alonzo.Rules.Bbody
Cardano.Ledger.Alonzo.Rules.Ledger
Cardano.Ledger.Alonzo.Rules.Utxo
Cardano.Ledger.Alonzo.Rules.Utxos
Cardano.Ledger.Alonzo.Rules.Utxow
build-depends:
aeson >= 2,
array,
Expand All @@ -74,6 +76,7 @@ library
deepseq,
measures,
mtl,
microlens,
nothunks,
plutus-ledger-api ^>= 1.0,
plutus-tx ^>= 1.0,
Expand Down
Loading

0 comments on commit 9e1479d

Please sign in to comment.