Skip to content
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

@newtype custom getters #240

Merged
merged 1 commit into from
Jul 9, 2024
Merged

@newtype custom getters #240

merged 1 commit into from
Jul 9, 2024

Conversation

rooooooooob
Copy link
Collaborator

Now you can optionally specify a getter e.g. foo = uint ; @newtype custom_getter.

Previously @newtype would always generate one named get() but this isn't always very helpful. Now you can explicitly name it, and if it's empty, no getter will be made, in which case users can choose to expose it however they want in their own utils.rs files.

Now you can optionally specify a getter e.g. `foo = uint ; @newtype
custom_getter`.

Previously `@newtype` would always generate one named `get()` but this
isn't always very helpful. Now you can explicitly name it, and if it's
empty, no getter will be made, in which case users can choose to expose
it however they want in their own `utils.rs` files.
rooooooooob added a commit to dcSpark/cardano-multiplatform-lib that referenced this pull request Jul 6, 2024
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
@SebastienGllmt SebastienGllmt merged commit 228fd49 into master Jul 9, 2024
1 check passed
@SebastienGllmt SebastienGllmt deleted the newtype-custom-getters branch July 9, 2024 06:01
SebastienGllmt pushed a commit to dcSpark/cardano-multiplatform-lib that referenced this pull request Jul 10, 2024
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 added a commit to dcSpark/cardano-multiplatform-lib that referenced this pull request Jul 23, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants