-
Notifications
You must be signed in to change notification settings - Fork 7
Feat/party serialization into datum #239
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
base: main
Are you sure you want to change the base?
Conversation
crates/tx3-lang/src/tx3.pest
Outdated
| cardano_payment_part = { "payment_part" ~ "(" ~ data_expr ~ ")" } | ||
| cardano_staking_part = { "staking_part" ~ "(" ~ data_expr ~ ")" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to cardano_address_payment_part and cardano_address_staking_part
crates/tx3-lang/src/cardano.rs
Outdated
| } | ||
|
|
||
| #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
| pub struct CardanoPaymentPart { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to AddressPaymentPart
crates/tx3-lang/src/cardano.rs
Outdated
| } | ||
|
|
||
| #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] | ||
| pub struct CardanoStakingPart { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to AddressStakingPart
crates/tx3-lang/src/ast.rs
Outdated
| NegateOp(NegateOp), | ||
| PropertyOp(PropertyOp), | ||
| UtxoRef(UtxoRef), | ||
| CardanoFunctions(crate::cardano::CardanoFunctions), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add individual functions instead of aggregating as a single enum variant.
| ir::Expression::AdHocDirective(x) => match x.name.as_str() { | ||
| "cardano_address_payment_part" => Ok(extract_address_part(&x.data, 1..29)), | ||
| "cardano_address_staking_part" => Ok(extract_address_part(&x.data, 29..)), | ||
| _ => Ok(().as_data()), | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
relying on byte positions is too risky. Use pallas::ledger::addresses::Address to parse the bytes and return the data fragment we need.
|
Sorry for this wrongly approved review. Too much github tabs opened. 😢 |
…ization-into-datum
No description provided.