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
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jobs:

- name: Install simplex-cli
uses: ./.github/actions/setup-smplx
with:
commit-sha: "c9cae5da3ace3e502fc19bda9cf5bd3fb909e49b"

- name: Generate contract artifacts
shell: bash
Expand Down
19 changes: 7 additions & 12 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 @@ -11,7 +11,7 @@ keywords = ["simplicity", "liquid", "elements", "smart-contracts"]
categories = ["cryptography::cryptocurrencies"]

[dependencies]
smplx-std = "0.0.9"
smplx-std = { git = "https://github.com/BlockstreamResearch/smplx.git", rev = "c9cae5da3ace3e502fc19bda9cf5bd3fb909e49b" }

[dev-dependencies]
anyhow = { version = "1.0.101" }
Expand Down
2 changes: 1 addition & 1 deletion tests/asserts_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const DEFAULT_SOME_U128: Option<u128> = Some(0);
const DEFAULT_SOME_U256: Option<[u8; 32]> = Some([0; 32]);

fn program() -> AssertsTestProgram {
AssertsTestProgram::new(AssertsTestArguments {})
AssertsTestProgram::new(&AssertsTestArguments {})
}

/// Returns two values in `[min, max]` that are equal when `same`, distinct otherwise.
Expand Down
2 changes: 1 addition & 1 deletion tests/binary_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mod binary_tests {

#[simplex::test]
fn binary_test(context: simplex::TestContext) -> anyhow::Result<()> {
let program = BinaryTestProgram::new(BinaryTestArguments {});
let program = BinaryTestProgram::new(&BinaryTestArguments {});
run(&context, program, BinaryTestWitness {}, Expect::Ok)
}
}
2 changes: 1 addition & 1 deletion tests/op_return_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn op(o: FunctionToTest) -> u8 {
const DEFAULT_DATA: &[u8; 1] = &[1];

fn program() -> OpReturnTestProgram {
OpReturnTestProgram::new(OpReturnTestArguments {})
OpReturnTestProgram::new(&OpReturnTestArguments {})
}

fn build_witness(function: u8, index: u32, expected: bool) -> OpReturnTestWitness {
Expand Down
2 changes: 1 addition & 1 deletion tests/secp256k1_operations_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const SECP_N: [u8; 32] = [
];

fn program() -> Secp256k1OperationsTestProgram {
Secp256k1OperationsTestProgram::new(Secp256k1OperationsTestArguments {})
Secp256k1OperationsTestProgram::new(&Secp256k1OperationsTestArguments {})
}

#[allow(clippy::too_many_arguments)]
Expand Down
2 changes: 1 addition & 1 deletion tests/u128_basic_math_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn op(o: FunctionToTest) -> u8 {
const DEFAULT_EXPECTED: u128 = 0;

fn program() -> U128BasicMathTestProgram {
U128BasicMathTestProgram::new(U128BasicMathTestArguments {})
U128BasicMathTestProgram::new(&U128BasicMathTestArguments {})
}

fn build_witness(
Expand Down
2 changes: 1 addition & 1 deletion tests/u128_convert_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn op(o: FunctionToTest) -> u8 {
}

fn program() -> U128ConvertTestProgram {
U128ConvertTestProgram::new(U128ConvertTestArguments {})
U128ConvertTestProgram::new(&U128ConvertTestArguments {})
}

fn build_witness(function: u8, a: u128, expected: [u8; 32]) -> U128ConvertTestWitness {
Expand Down
2 changes: 1 addition & 1 deletion tests/u128_math_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl TestUint for u128 {
const MUL_BOUND: u128 = 1 << 64; // 2^(128/2)

fn program() -> U128MathTestProgram {
U128MathTestProgram::new(U128MathTestArguments {})
U128MathTestProgram::new(&U128MathTestArguments {})
}

fn witness(op: u8, a: u128, b: u128, expected: Option<u128>) -> U128MathTestWitness {
Expand Down
2 changes: 1 addition & 1 deletion tests/u128_test_bits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn op(o: FunctionToTest) -> u8 {
const DEFAULT_EXPECTED: u128 = 0;

fn program() -> U128TestBitsProgram {
U128TestBitsProgram::new(U128TestBitsArguments {})
U128TestBitsProgram::new(&U128TestBitsArguments {})
}

fn build_witness(
Expand Down
2 changes: 1 addition & 1 deletion tests/u128_test_compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn op(o: FunctionToTest) -> u8 {
const DEFAULT_EXPECTED: u128 = 0;

fn program() -> U128TestCompareProgram {
U128TestCompareProgram::new(U128TestCompareArguments {})
U128TestCompareProgram::new(&U128TestCompareArguments {})
}

fn build_witness(function: u8, a: u128, b: u128, expected_bool: bool) -> U128TestCompareWitness {
Expand Down
2 changes: 1 addition & 1 deletion tests/u16_convert_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn op(o: FunctionToTest) -> u8 {
}

fn program() -> U16ConvertTestProgram {
U16ConvertTestProgram::new(U16ConvertTestArguments {})
U16ConvertTestProgram::new(&U16ConvertTestArguments {})
}

fn build_witness(function: u8, a: u16, expected: [u8; 32]) -> U16ConvertTestWitness {
Expand Down
2 changes: 1 addition & 1 deletion tests/u16_math_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl TestUint for u16 {
const MUL_BOUND: u16 = 1 << 8; // 2^(16/2)

fn program() -> U16MathTestProgram {
U16MathTestProgram::new(U16MathTestArguments {})
U16MathTestProgram::new(&U16MathTestArguments {})
}

fn witness(op: u8, a: u16, b: u16, expected: Option<u16>) -> U16MathTestWitness {
Expand Down
2 changes: 1 addition & 1 deletion tests/u1_convert_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn op(o: FunctionToTest) -> u8 {
}

fn program() -> U1ConvertTestProgram {
U1ConvertTestProgram::new(U1ConvertTestArguments {})
U1ConvertTestProgram::new(&U1ConvertTestArguments {})
}

fn build_witness(function: u8, a: u8, expected: [u8; 32]) -> U1ConvertTestWitness {
Expand Down
2 changes: 1 addition & 1 deletion tests/u256_convert_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn op(o: FunctionToTest) -> u8 {
}

fn program() -> U256ConvertTestProgram {
U256ConvertTestProgram::new(U256ConvertTestArguments {})
U256ConvertTestProgram::new(&U256ConvertTestArguments {})
}

fn build_witness(function: u8, a: [u8; 32], expected: [u8; 32]) -> U256ConvertTestWitness {
Expand Down
2 changes: 1 addition & 1 deletion tests/u256_math_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl TestUint for U256Wrapper {
const MUL_BOUND: U256Wrapper = U256Wrapper(U256([0, 0, 1, 0])); // 2^(256/2)

fn program() -> U256MathTestProgram {
U256MathTestProgram::new(U256MathTestArguments {})
U256MathTestProgram::new(&U256MathTestArguments {})
}

fn witness(
Expand Down
2 changes: 1 addition & 1 deletion tests/u256_test_add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn op(o: FunctionToTest) -> u8 {
}

fn program() -> U256TestAddProgram {
U256TestAddProgram::new(U256TestAddArguments {})
U256TestAddProgram::new(&U256TestAddArguments {})
}

fn build_witness(
Expand Down
2 changes: 1 addition & 1 deletion tests/u256_test_bits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn op(o: FunctionToTest) -> u8 {
}

fn program() -> U256TestBitsProgram {
U256TestBitsProgram::new(U256TestBitsArguments {})
U256TestBitsProgram::new(&U256TestBitsArguments {})
}

fn build_witness(
Expand Down
2 changes: 1 addition & 1 deletion tests/u256_test_compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn op(o: FunctionToTest) -> u8 {
const DEFAULT_EXPECTED: [u8; 32] = [0; 32];

fn program() -> U256TestCompareProgram {
U256TestCompareProgram::new(U256TestCompareArguments {})
U256TestCompareProgram::new(&U256TestCompareArguments {})
}

fn build_witness(
Expand Down
2 changes: 1 addition & 1 deletion tests/u256_test_div.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn op(o: FunctionToTest) -> u8 {
const DEFAULT_EXPECTED: [u8; 32] = [0; 32];

fn program() -> U256TestDivProgram {
U256TestDivProgram::new(U256TestDivArguments {})
U256TestDivProgram::new(&U256TestDivArguments {})
}

fn build_witness(
Expand Down
2 changes: 1 addition & 1 deletion tests/u256_test_sub_mul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn op(o: FunctionToTest) -> u8 {
const DEFAULT_EXPECTED: [u8; 32] = [0; 32];

fn program() -> U256TestSubMulProgram {
U256TestSubMulProgram::new(U256TestSubMulArguments {})
U256TestSubMulProgram::new(&U256TestSubMulArguments {})
}

fn build_witness(
Expand Down
2 changes: 1 addition & 1 deletion tests/u32_convert_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn op(o: FunctionToTest) -> u8 {
}

fn program() -> U32ConvertTestProgram {
U32ConvertTestProgram::new(U32ConvertTestArguments {})
U32ConvertTestProgram::new(&U32ConvertTestArguments {})
}

fn build_witness(function: u8, a: u32, expected: [u8; 32]) -> U32ConvertTestWitness {
Expand Down
2 changes: 1 addition & 1 deletion tests/u32_math_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl TestUint for u32 {
const MUL_BOUND: u32 = 1 << 16; // 2^(32/2)

fn program() -> U32MathTestProgram {
U32MathTestProgram::new(U32MathTestArguments {})
U32MathTestProgram::new(&U32MathTestArguments {})
}

fn witness(op: u8, a: u32, b: u32, expected: Option<u32>) -> U32MathTestWitness {
Expand Down
2 changes: 1 addition & 1 deletion tests/u64_convert_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn op(o: FunctionToTest) -> u8 {
}

fn program() -> U64ConvertTestProgram {
U64ConvertTestProgram::new(U64ConvertTestArguments {})
U64ConvertTestProgram::new(&U64ConvertTestArguments {})
}

fn build_witness(function: u8, a: u64, expected: [u8; 32]) -> U64ConvertTestWitness {
Expand Down
2 changes: 1 addition & 1 deletion tests/u64_math_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl TestUint for u64 {
const MUL_BOUND: u64 = 1 << 32; // 2^(64/2)

fn program() -> U64MathTestProgram {
U64MathTestProgram::new(U64MathTestArguments {})
U64MathTestProgram::new(&U64MathTestArguments {})
}

fn witness(op: u8, a: u64, b: u64, expected: Option<u64>) -> U64MathTestWitness {
Expand Down
2 changes: 1 addition & 1 deletion tests/u8_convert_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn op(o: FunctionToTest) -> u8 {
}

fn program() -> U8ConvertTestProgram {
U8ConvertTestProgram::new(U8ConvertTestArguments {})
U8ConvertTestProgram::new(&U8ConvertTestArguments {})
}

fn build_witness(function: u8, a: u8, expected: [u8; 32]) -> U8ConvertTestWitness {
Expand Down
2 changes: 1 addition & 1 deletion tests/u8_math_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl TestUint for u8 {
const MUL_BOUND: u8 = 1 << 4; // 2^(8/2)

fn program() -> U8MathTestProgram {
U8MathTestProgram::new(U8MathTestArguments {})
U8MathTestProgram::new(&U8MathTestArguments {})
}

fn witness(op: u8, a: u8, b: u8, expected: Option<u8>) -> U8MathTestWitness {
Expand Down