Skip to content

Commit

Permalink
Merge pull request #373 from Emurgo/ruslan/costmodel-test
Browse files Browse the repository at this point in the history
Fixing hash_script_data
  • Loading branch information
vsubhuman authored Feb 16, 2022
2 parents 56ea7d4 + 5dfc32e commit 7b594e9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cardano-serialization-lib",
"version": "10.0.3",
"version": "10.0.4-beta.4",
"description": "(De)serialization functions for the Cardano blockchain along with related utility functions",
"scripts": {
"rust:build-nodejs": "(rimraf ./rust/pkg && cd rust; wasm-pack build --target=nodejs; wasm-pack pack) && npm run js:flowgen",
Expand Down
2 changes: 1 addition & 1 deletion rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[package]
name = "cardano-serialization-lib"
version = "10.0.3"
version = "10.0.4-beta.4"
edition = "2018"
authors = ["EMURGO"]
license = "MIT"
description = "(De)serialization functions for the Cardano blockchain along with related utility functions"
documentation = "https://docs.cardano.org/cardano-components/cardano-serialization-lib"
repository = "https://github.com/Emurgo/cardano-serialization-lib"
readme="../README.md"
exclude = [
"pkg/*",
]
Expand Down
4 changes: 2 additions & 2 deletions rust/src/plutus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1272,12 +1272,12 @@ mod tests {
// witness_set should have fixed length array
let mut witness_set = TransactionWitnessSet::new();
witness_set.set_plutus_data(&list);
assert_eq!("a1048101", hex::encode(witness_set.to_bytes()));
assert_eq!("a1049f01ff", hex::encode(witness_set.to_bytes()));

list = PlutusList::new();
list.add(&datum);
witness_set.set_plutus_data(&list);
assert_eq!(format!("a10481{}", datum_cli), hex::encode(witness_set.to_bytes()));
assert_eq!(format!("a1049f{}ff", datum_cli), hex::encode(witness_set.to_bytes()));
}

#[test]
Expand Down
5 changes: 1 addition & 4 deletions rust/src/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1806,10 +1806,7 @@ impl cbor_event::se::Serialize for TransactionWitnessSet {
}
if let Some(field) = &self.plutus_data {
serializer.write_unsigned_integer(4)?;
serializer.write_array(cbor_event::Len::Len(field.len() as u64))?;
for i in 0..field.len() {
field.get(i).serialize(serializer)?;
}
field.serialize(serializer)?;
}
if let Some(field) = &self.redeemers {
serializer.write_unsigned_integer(5)?;
Expand Down

0 comments on commit 7b594e9

Please sign in to comment.