Skip to content

Commit

Permalink
PlutusData cardano-node JSON encoding/decoding (#277)
Browse files Browse the repository at this point in the history
* Bring over json_serialize.rs + plutus json code from old CML

* PlutusData cardano-node JSON encoding/decoding

Brought over from old CML's code. JSON parsing code is brought over as
well to new format.

PlutusData::BigInt -> PlutusData::Integer rename to match old CML's API
as the big part probably isn't particularly important

* PlutusData JSON wasm bindings

* fix clippy in tests
  • Loading branch information
rooooooooob authored Nov 21, 2023
1 parent 98e0383 commit 98c9f14
Show file tree
Hide file tree
Showing 14 changed files with 1,816 additions and 18 deletions.
1 change: 1 addition & 0 deletions chain/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ num-integer = "0.1.45"
#rand_os = "0.1"
thiserror = "1.0.37"
num = "0.4"
unicode-segmentation = "1.10.1"
# These can be removed if we make wasm bindings for ALL functionality here.
# This was not done right now as there is a lot of existing legacy code e.g.
# for Byron that might need to be used from WASM and might not.
Expand Down
2 changes: 1 addition & 1 deletion chain/rust/src/builders/redeemer_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ mod tests {
let script = PlutusScript::PlutusV1(PlutusV1Script::new(vec![0]));
PartialPlutusWitness {
script: PlutusScriptWitness::Script(script),
redeemer: PlutusData::new_big_int(0u64.into()),
redeemer: PlutusData::new_integer(0u64.into()),
}
};
let missing_signers = vec![fake_raw_key_public(0).hash()];
Expand Down
4 changes: 2 additions & 2 deletions chain/rust/src/builders/witness_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ mod tests {
let script = PlutusScript::PlutusV1(PlutusV1Script::new(vec![0]));
PartialPlutusWitness {
script: PlutusScriptWitness::Script(script),
redeemer: PlutusData::new_big_int(0u64.into()),
redeemer: PlutusData::new_integer(0u64.into()),
}
};
let missing_signers = vec![fake_raw_key_public(0).hash()];
Expand All @@ -648,7 +648,7 @@ mod tests {
let script = PlutusScript::PlutusV1(PlutusV1Script::new(vec![0]));
PartialPlutusWitness {
script: PlutusScriptWitness::Script(script),
redeemer: PlutusData::new_big_int(0u64.into()),
redeemer: PlutusData::new_integer(0u64.into()),
}
};
let missing_signers = vec![hash];
Expand Down
Loading

0 comments on commit 98c9f14

Please sign in to comment.