Move common (i.e. era-independent) types and structures up to the lib module; to be shared across all eras. If any of those deviate in a subsequent era, it is easy to bring them down and define new types from the point of divergence onward. This simplifies the scope of each era-specific module and make them slightly easier to navigate.
Note that, each era module still re-export all of the common types that's relevant to that particular era. So technically, this reorganization doesn't really change anything for callers/users of the library.
Rename Scripthash to ScriptHash. Before this commit, both actually existed as ScriptHash was introduced with the Conway era. Yet, they refer to the same thing, so the duplication is simply confusing.
Rename One / Two constructors for NetworkId to Testnet and Mainnet respectively. Also defined idiomatic From & TryFrom implementation for conversion to and from u8. This is a lot let confusing!
Generalize PlutusScript with a constant generic, to avoid repetition for each plutus script generated for specific version. Note that a distinction is still necessary if we want to provie out-of-the-box serialisers for Plutus scripts, which are serialised with a tag prefix depending on the language. All else apart, they are strictly similar types.
Rename CostMdls to CostModels. Because, common.
Rename plutus_script to plutus_v1_script in the Alonzo's witness set, for consistency with other eras.
Namely:
Move common (i.e. era-independent) types and structures up to the
lib
module; to be shared across all eras. If any of those deviate in a subsequent era, it is easy to bring them down and define new types from the point of divergence onward. This simplifies the scope of each era-specific module and make them slightly easier to navigate.Note that, each era module still re-export all of the common types that's relevant to that particular era. So technically, this reorganization doesn't really change anything for callers/users of the library.
Rename
Scripthash
toScriptHash
. Before this commit, both actually existed asScriptHash
was introduced with the Conway era. Yet, they refer to the same thing, so the duplication is simply confusing.Rename
One
/Two
constructors forNetworkId
toTestnet
andMainnet
respectively. Also defined idiomaticFrom
&TryFrom
implementation for conversion to and fromu8
. This is a lot let confusing!Generalize
PlutusScript
with a constant generic, to avoid repetition for each plutus script generated for specific version. Note that a distinction is still necessary if we want to provie out-of-the-box serialisers for Plutus scripts, which are serialised with a tag prefix depending on the language. All else apart, they are strictly similar types.Rename
CostMdls
toCostModels
. Because, common.Rename
plutus_script
toplutus_v1_script
in the Alonzo's witness set, for consistency with other eras.