Skip to content

Commit

Permalink
Merge #86: Reconstruct value
Browse files Browse the repository at this point in the history
88d15d3 test: Fuzz reconstruction of values (Christian Lewe)
2671dc8 feat: Implement Arbitrary for Value (Christian Lewe)
6e2f68e feat: Implement Arbitrary for ResolvedType (Christian Lewe)
7e07408 feat: Reconstruct Simplicity values (Christian Lewe)
d9dbee0 feat: Inverted array operations (Christian Lewe)
e00f696 refactor: Evaluate const expression using AST (Christian Lewe)
3d13c1b chore: parse::ExprTree (Christian Lewe)
5228b7b doc: all values are typed now (Christian Lewe)
7f178c4 doc: Update Partition (Christian Lewe)
61e8a87 fix: StructuralValue::list (Christian Lewe)
1c42894 fix: List bound assertion (Christian Lewe)
fdf09a6 chore: Update simplicity (Christian Lewe)

Pull request description:

  Convert Simplicity values back to Simfony values via a Simfony type. We need this to display debug output from the Simplicity Bit Machine in terms of Simfony speak. Fix bugs that came up during fuzzing.

ACKs for top commit:
  apoelstra:
    ACK 88d15d3 successfully ran local tests

Tree-SHA512: 7ccccdcd0a2b0d9c04538779ed08a04e3f7588ef0c91cefc5ca1773471a1741a87ecfcef909fb951dfbeca142a8c903a7c48836cbc5c412e835a39b58a252185
  • Loading branch information
uncomputable committed Sep 13, 2024
2 parents 8eec967 + 88d15d3 commit 6d7dc93
Show file tree
Hide file tree
Showing 12 changed files with 802 additions and 237 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pest = "2.1.3"
pest_derive = "2.7.1"
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.105"
simplicity-lang = { git = "https://github.com/BlockstreamResearch/rust-simplicity", rev = "794918783291465a109bdaf2ef694f86467c477e" }
simplicity-lang = { git = "https://github.com/BlockstreamResearch/rust-simplicity", rev = "713842937ab0b5e0b1a343e19fdee6634b7a6add" }
miniscript = "11.0.0"
either = "1.12.0"
itertools = "0.13.0"
Expand Down
7 changes: 7 additions & 0 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ path = "fuzz_targets/display_parse_tree.rs"
test = false
doc = false
bench = false

[[bin]]
name = "reconstruct_value"
path = "fuzz_targets/reconstruct_value.rs"
test = false
doc = false
bench = false
11 changes: 11 additions & 0 deletions fuzz/fuzz_targets/reconstruct_value.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#![no_main]

use libfuzzer_sys::fuzz_target;

use simfony::value::{Value, StructuralValue};

fuzz_target!(|value: Value| {
let structural_value = StructuralValue::from(&value);
let reconstructed_value = Value::reconstruct(&structural_value, value.ty()).unwrap();
assert_eq!(reconstructed_value, value);
});
Loading

0 comments on commit 6d7dc93

Please sign in to comment.