Commit graph

99 commits

Author SHA1 Message Date
Santiago Carmuega
537cd45c23
refactor: support roundtrip encoding for script data hash components (#526) 2024-10-22 10:09:37 -03:00
Matthias Benkort
969d5612b7
refactor: Re-organize and clean-up pallas-primitives (#523)
* Re-organize and clean-up pallas-primitives

  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` 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.

* Fix ordering of ScriptHash variants.

  This is an odd one. See the note.

* Bump minicbor to v0.25.1

* Add aliases with deprecation warnings to various fields and types.

* revert renaming plutus_script to plutus_v1_script in Alonzo witness

  See https://github.com/txpipe/pallas/pull/523#discussion_r1807329742
2024-10-22 08:57:21 -03:00
Andrew Westberg
4871342a8d feat(crypto): Add Key Evolving Signatures (KES) 2024-10-17 15:12:33 -04:00
Santiago Carmuega
21af5b7505
feat: add support for Conway config and params traverse (#521)
Co-authored-by: Clark Alesna <clark_alesna@hotmail.com>
Co-authored-by: johnquinnvictaboada <quinnvictaboada@gmail.com>
2024-10-16 21:43:23 -03:00
Andrew Westberg
0ca7c34776
feat(crypto): add extra types and conversions (#517) 2024-10-04 08:37:36 -03:00
Pedro Sánchez Terraf
07b74515a4
feat(applying): add cert and native script validation for ShelleyMA (#510)
BREAKING CHANGE: the `validate` fn signature has changed to support these changes

---------

Co-authored-by: Ale Gadea <ale.gadea@txpipe.io>
2024-09-23 13:24:32 -03:00
Matthias Benkort
2d89f3da54
fix(primitives): patch remaining Conway issues (#505)
* Expose private struct fields for ExUnitPrices.
* Fix UpdateDRepCert variant argument.
2024-08-25 11:48:54 -03:00
Matthias Benkort
81390296a3
fix(primitives): expose hidden struct fields in Conway (#501)
* Provide slightly better error when failing to decode Plutus data.
* Expose GovActionId, Constitution & Anchor inner fields
2024-08-10 20:08:45 -03:00
Matthias Benkort
5c18f06fa2
fix(traverse): use Conway types in places they are meant to (#499) 2024-08-08 08:33:10 -03:00
Santiago Carmuega
ee505a02e6
fix: relax CBOR decoding of Conway protocol params update (#473) 2024-06-18 13:03:07 -03:00
Santiago Carmuega
a59fe53ae2
fix(primitives): handle conway extreme param updates (#462) 2024-05-21 08:29:09 -03:00
Santiago Carmuega
1b2616256f
feat(primitives): derive Eq on relevant structs (#446) 2024-04-18 22:25:02 -03:00
Maico Leberle
a0c409b65e
refactor(applying): unify approach for protocol params access (#432) 2024-04-11 21:41:27 -03:00
Harper
c31e773ce2
feat: add Conway 2024-03 CDDL conformity (#424) 2024-04-01 14:02:52 -03:00
Santiago Carmuega
54997daf66
fix(primitives): contemplate Conway's CBOR set tag (#421)
Co-authored-by: jmhrpr <25673452+jmhrpr@users.noreply.github.com>
2024-03-08 19:32:03 -03:00
Maico Leberle
7b2894e4a2
feat(applying): implement Alonzo phase-1 validations (#380) 2024-01-19 22:19:46 -03:00
Harper
afa397f4ea
fix: return witness objects for conway era multieratx (#346) 2024-01-02 07:17:40 -03:00
Santiago Carmuega
408a41a9ea
feat(traverse): improve protocol update access (#360) 2023-12-14 18:54:01 -03:00
Santiago Carmuega
f26b9bd591
chore: fix lint warnings (#330) 2023-11-13 17:00:00 -03:00
Harper
93c978b0e3
feat: introduce conway primitives (#290)
Co-authored-by: lisicky <lisicky@inbox.ru>
2023-11-03 12:22:06 -03:00
Maico Leberle
986ee75761
feat: scaffold Byron phase-1 validations (#300)
Co-authored-by: Santiago Carmuega <santiago@carmuega.me>
2023-10-10 17:16:26 -03:00
Santiago Carmuega
1f870cac66
chore: fix lint warning (#283) 2023-09-07 09:39:18 -03:00
Santiago Carmuega
e117a2723a
feat: add helper to create bootstrap addresses (#269) 2023-07-29 18:15:00 -03:00
Harper
f2a746b831
fix: use u64 instead of i64 for unit interval and rational numerator (#268) 2023-07-18 09:21:35 -03:00
Santiago Carmuega
c9119e4925
fix: back-merge v0.18.1 hotfix (#254) 2023-04-27 21:24:09 -03:00
Santiago Carmuega
381a46f2cf
chore: Fix lint warnings for all targets (#240) 2023-03-24 06:59:49 -03:00
Santiago Carmuega
2612bb1038
chore(traverse): Improve API ergonomics (#233) 2023-03-13 15:19:40 -03:00
Pi Lanningham
4915d14cd5
feat: Add constants for known miniprotocols
* Add constants for known miniprotocols

Now consumers of the crate don't have to memorize what channel number means what

* Add myself to the crate authors
2023-02-05 06:13:55 -05:00
Santiago Carmuega
16d0211c5b
feat(miniprotocols): Implement tx submission client (#220)
* feat(miniprotocols): Implement tx submission client

* Match CDDL specs

* Fix build errors

* Add server implementation for txsubmission

Also includes some documentation for how to use both the client and the server

* cargo fmt

* clippy suggestions

clippy pls

* Fail explicitly on missing n2c unix socket

---------

Co-authored-by: Pi Lanningham <pi@sundaeswap.finance>
2023-02-03 20:38:12 -05:00
Santiago Carmuega
e600190107
fix: Provide original hash for inline datum (#221) 2023-02-03 14:58:39 -03:00
Harper
c6730340d0
fix: use PlutusBytes to encode BigUInt/BigNInt (#216) 2023-01-25 21:15:55 -03:00
Karol Ochman-Milarski
6fa936a998
fix: Match CBOR encoding of plutus data with the haskell implementation. (#212)
* Add failing cbor rountrip test
* Encode lists like haskell does
* Encode plutus data bytestrings as haskell does

That is:
 - as bytestring for up to 64 bytes length
 - as an indefinite bytestring made of 64 byte chunks, last one can be shorter
2022-12-14 21:20:11 -03:00
Santiago Carmuega
c647e51510
fix(primitives): Handle generic int in Plutus data (#202) 2022-11-12 16:16:26 -03:00
Santiago Carmuega
f5052241ac Back-merge v0.13 hotfix 2022-10-13 16:14:20 -03:00
Santiago Carmuega
7a73ebc5b2
fix: Handle undefined CBOR maps in Plutus data (#196) 2022-10-13 15:51:49 -03:00
alessandrokonrad
ac25b48797
fix(primitives): Add missing PartialOrd and Ord to TransactionInput (#191) 2022-09-14 15:02:57 -03:00
Santiago Carmuega
2f7d108b53
feat(primitives): Preserve order of map structures (#192) 2022-09-14 15:00:53 -03:00
Santiago Carmuega
6b2f23059f
chore: Fix lint warnings (#190)
* apply code formatting
* fix clippy warnings
2022-09-13 08:41:43 -03:00
Santiago Carmuega
85cf02dec4
feat(traverse): Provide access to original Datum hash (#189) 2022-09-13 07:52:35 -03:00
Santiago Carmuega
070b33114f
Back-merge v0.13 hotfix (#185) 2022-09-11 16:01:02 -03:00
Santiago Carmuega
d94262a3f0
fix(addresses): Skip error on pointer address overflow (#178) 2022-08-19 22:15:35 -03:00
Santiago Carmuega
57f9aac662
chore: Move fee logic out of primitives (#174) 2022-08-13 15:45:16 -03:00
Santiago Carmuega
aab58480a6
chore: Move time logic out of primitives (#173) 2022-08-13 14:37:02 -03:00
Santiago Carmuega
d72f9e42de
chore: Move hash logic out of primitives (#172) 2022-08-13 12:24:35 -03:00
Santiago Carmuega
bf2e8a7c88
chore(primitives): Remove redundant address logic (#171) 2022-08-13 10:50:45 -03:00
Santiago Carmuega
2e95b7b33a
feat(primitives): Enable serde of ledger structs (#169) 2022-08-12 19:43:56 -03:00
Santiago Carmuega
266df0fc18
fix(primitives): Fix overflow on cost model (#168) 2022-08-08 09:11:57 -03:00
Santiago Carmuega
69644d4a0e
fix(primitives): Make cost models optional (#167) 2022-08-07 21:39:04 -03:00
Santiago Carmuega
ea2368bf49
chore: Fix lint warnings (#166) 2022-08-07 12:18:43 -03:00
Santiago Carmuega
22b74673f7
fix(primitives): Handle alonzo headers without prev-hash (#164) 2022-08-06 19:19:31 -03:00