Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ default = ["elements"]
elements = ["dep:elements", "bitcoin"]
test-utils = ["simplicity-sys/test-utils"]
serde = ["dep:serde", "bitcoin/serde", "elements/serde"]
human_encoding = ["dep:logos"]

[lib]
name = "simplicity"
Expand All @@ -29,7 +30,7 @@ elements = { version = "0.25.0", optional = true, default-features = false }
ghost-cell = { version = "0.2.6", default-features = false }
hashes = { package = "bitcoin_hashes", version = "0.14" }
hex = { package = "hex-conservative", version = "0.2.1" }
logos = "0.15"
logos = { version = "0.15", optional = true }
simplicity-sys = { version = "0.6.2", path = "./simplicity-sys" }
serde = { version = "1.0.103", features = ["derive"], optional = true }

Expand Down
2 changes: 1 addition & 1 deletion fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ path = "fuzz_lib/lib.rs"
libfuzzer-sys = "0.4"
# We shouldn't need an explicit version on the next line, but Andrew's tools
# choke on it otherwise. See https://github.com/nix-community/crate2nix/issues/373
simplicity-lang = { path = "..", features = ["test-utils"], version = "0.7.0" }
simplicity-lang = { path = "..", features = ["test-utils", "human_encoding"], version = "0.7.0" }
old_simplicity = { package = "simplicity-lang", version = "0.3.1", default-features = false }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion simpcli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2018"

[dependencies]
# todo add lexopt for command line parsing
simplicity-lang = { version = "0.7.0", path = "..", features = [ "base64", "serde", "elements" ] }
simplicity-lang = { version = "0.7.0", path = "..", features = [ "base64", "serde", "elements", "human_encoding" ] }

[[bin]]
name = "simpcli"
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ mod analysis;
mod bit_encoding;
pub mod bit_machine;
pub mod dag;
#[cfg(feature = "human_encoding")]
pub mod human_encoding;
pub mod jet;
mod merkle;
Expand Down
10 changes: 6 additions & 4 deletions src/node/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,11 @@ mod tests {
use std::fmt;

use crate::decode::Error;
use crate::human_encoding::Forest;
use crate::jet::{Core, CoreEnv};
use crate::node::SimpleFinalizer;
use crate::{BitMachine, Value};
use crate::jet::Core;
#[cfg(feature = "human_encoding")]
use crate::{human_encoding::Forest, jet::CoreEnv, node::SimpleFinalizer, BitMachine, Value};

#[cfg(feature = "human_encoding")]
#[cfg_attr(not(feature = "base64"), allow(unused_variables))]
#[track_caller]
fn assert_program_deserializable<J: Jet>(
Expand Down Expand Up @@ -473,6 +473,7 @@ mod tests {
}

#[test]
#[cfg(feature = "human_encoding")]
fn shared_witnesses() {
assert_program_deserializable::<Core>(
"main := witness",
Expand Down Expand Up @@ -577,6 +578,7 @@ mod tests {
}

#[test]
#[cfg(feature = "human_encoding")]
fn regression_177() {
// `case (drop iden) iden` from upstream occurs-check test. Has an infinitely sized
// input type. Will fail trying to unify the input type with the unit type before
Expand Down
2 changes: 1 addition & 1 deletion src/node/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ fn shorten<S: AsRef<str>>(s: S, max_len: usize) -> String {
}
}

#[cfg(test)]
#[cfg(all(test, feature = "human_encoding"))]
mod tests {
use crate::human_encoding::Forest;
use crate::jet::Core;
Expand Down
9 changes: 5 additions & 4 deletions src/node/redeem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,13 +610,14 @@ impl<J: Jet> RedeemNode<J> {
#[cfg(test)]
mod tests {
use super::*;
#[cfg(feature = "human_encoding")]
use crate::human_encoding::Forest;
use crate::jet::Core;
use crate::node::SimpleFinalizer;
use crate::types::Final;
use hex::DisplayHex;
use std::collections::HashMap;
use std::fmt;
#[cfg(all(feature = "elements", feature = "human_encoding"))]
use {crate::types::Final, std::collections::HashMap};

#[cfg_attr(not(feature = "base64"), allow(unused_variables))]
#[track_caller]
Expand Down Expand Up @@ -965,7 +966,7 @@ mod tests {
);
}

#[cfg(feature = "elements")]
#[cfg(all(feature = "elements", feature = "human_encoding"))]
fn assert_correct_pruning<JE: JetEnvironment>(
unpruned_prog: &str,
unpruned_wit: &HashMap<Arc<str>, Value>,
Expand Down Expand Up @@ -1017,7 +1018,7 @@ mod tests {
}

#[test]
#[cfg(feature = "elements")]
#[cfg(all(feature = "elements", feature = "human_encoding"))]
fn prune() {
use crate::jet::ElementsTxEnv;

Expand Down
Loading