dcSpark / cardano-multiplatform-lib

Rust implementation of Cardano
MIT License
98 stars 35 forks source link

Move RawBytesEncoding and standardize use #340

Closed rooooooooob closed 2 months ago

rooooooooob commented 2 months ago

Fixes #334

Moves RawBytesEncoding to cml_core::serialization as there is nothing specific about crypto with it, and it can be used in many other places (Asset names, plutus scripts, etc).

Add wasm macros for declaring the RawBytesEncoding API automatically using the rust type's trait impl

Add missing hash() to PlutusV3Script

Document AssetName on how to convert to/from using utf8 traits in rust

Use dcSpark/cddl-codegen#240 to remove confusing get() (what is it getting?) functions on some wrapper types. These are replaced with RawBytesEncoding to standardize use with the rest of CML

rooooooooob commented 2 months ago

We could re-export it with a deprecated tag to avoid breaking code as well, and keep the old methods too but deprecate them in favor of the new one. Are we stable enough at this point where we should do that or is it fine as-is for breaking changes?

339 will break API anyway necessarily anyway so that's why i didn't bother here