diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 421c13b..8ce91a2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,7 @@ concurrency: env: CARGO_TERM_COLOR: always - SIMPLEX_VERSION: 0.0.11 + SIMPLEX_VERSION: 0.1.1 jobs: lint: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bed4e67..0ffe655 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ concurrency: env: CARGO_TERM_COLOR: always RUST_BACKTRACE: full - SIMPLEX_VERSION: 0.0.11 + SIMPLEX_VERSION: 0.1.1 jobs: simplex-tests: diff --git a/Cargo.lock b/Cargo.lock index 86877ca..0a96b92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -133,7 +133,7 @@ version = "0.1.101" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "365c0acd5b2e8dd0111a46c4faea83fb3cfb6e39a49a7c73a06e090db7b2eff0" dependencies = [ - "bitcoin_hashes", + "bitcoin_hashes 0.14.101", ] [[package]] @@ -156,17 +156,36 @@ checksum = "32637268377fc7b10a8c6d51de3e7fba1ce5dd371a96e342b34e6078db558e7f" [[package]] name = "bip39" -version = "2.2.2" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90dbd31c98227229239363921e60fcf5e558e43ec69094d46fc4996f08d1d5bc" +checksum = "4559bb9225f8401dcea601cf8dc9ed81ea0dadd9cf7755fdefdd93ef7961e19e" dependencies = [ - "bitcoin_hashes", - "rand", - "rand_core", + "bitcoin_hashes 0.14.101", + "rand 0.8.8", + "rand_core 0.6.4", "serde", "unicode-normalization", ] +[[package]] +name = "bit-set" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56d87354e4229f54a44f7bf2435906a4656dba36026ab6eaca629a2c436a691c" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5727b15fa97d4f4fee0a3b7c3d550ed0269f54329207b86388de918604e31269" +dependencies = [ + "borsh", + "serde", +] + [[package]] name = "bitcoin" version = "0.32.102" @@ -176,9 +195,10 @@ dependencies = [ "base58ck", "base64 0.21.7", "bech32", + "bitcoin-consensus-encoding", "bitcoin-io", "bitcoin-units", - "bitcoin_hashes", + "bitcoin_hashes 0.14.101", "hex-conservative 0.2.3", "hex_lit", "secp256k1", @@ -191,11 +211,17 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9daa31138eb443d5751b207f3f64154e2bb09cd59960562ccc7a7112be38147f" dependencies = [ - "bitcoin-internals", + "bitcoin-internals 0.7.0", "hex-conservative 1.3.0", "serde", ] +[[package]] +name = "bitcoin-internals" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d573f4cf32996a8dce612e4348cece65a241f1882ed594047c9ba348e8869fa5" + [[package]] name = "bitcoin-internals" version = "0.7.0" @@ -238,6 +264,18 @@ dependencies = [ "serde", ] +[[package]] +name = "bitcoin_hashes" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5304e53726dbe5f93141535e102ed97b5bf4714fbecefdda8f9fb98d7fdaff0e" +dependencies = [ + "bitcoin-consensus-encoding", + "bitcoin-internals 0.6.0", + "hex-conservative 1.3.0", + "serde", +] + [[package]] name = "bitcoincore-rpc" version = "0.19.0" @@ -301,11 +339,35 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.4" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa" dependencies = [ - "generic-array", + "hybrid-array", +] + +[[package]] +name = "borsh" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "553c5d846a6ba5150c65e3b1b8ec073bcf1abc20f9b7220de384a4443ea4e20a" +dependencies = [ + "borsh-derive", + "bytes", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cdfe656708a01f89b451a7d36466e6fe6c414de0aa18fc54f864f6f9ca9f56" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 3.0.9", ] [[package]] @@ -336,6 +398,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + [[package]] name = "cc" version = "1.5.1" @@ -354,6 +422,23 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" +[[package]] +name = "cfg_aliases" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + +[[package]] +name = "chacha20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" +dependencies = [ + "cfg-if", + "cpufeatures", + "rand_core 0.10.1", +] + [[package]] name = "chumsky" version = "0.11.2" @@ -404,12 +489,24 @@ dependencies = [ "cc", ] +[[package]] +name = "cmov" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a" + [[package]] name = "colorchoice" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" +[[package]] +name = "const-oid" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" + [[package]] name = "const_format" version = "0.2.36" @@ -431,11 +528,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "core_detect" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" + [[package]] name = "cpufeatures" -version = "0.2.17" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566" dependencies = [ "libc", ] @@ -473,23 +576,32 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "crypto-common" -version = "0.1.7" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" dependencies = [ - "generic-array", - "typenum", + "hybrid-array", +] + +[[package]] +name = "ctutils" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03bb0e1cc970d482d121d9a1744999169b69a07470b3d644a7894e53fcaf4574" +dependencies = [ + "cmov", ] [[package]] name = "digest" -version = "0.10.7" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" dependencies = [ "block-buffer", + "const-oid", "crypto-common", - "subtle", + "ctutils", ] [[package]] @@ -506,9 +618,9 @@ checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" [[package]] name = "either" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" +checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" dependencies = [ "serde", ] @@ -540,12 +652,16 @@ dependencies = [ [[package]] name = "elements" -version = "0.25.3" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c63a04238f4b7f3564fe9705921452c2900efd00982545e5c634fac9024fe2" +checksum = "34e00f7ddcd826d2f4c9bd72d79a6b6991a0ac4286e7e2b2ff8eecd130549073" dependencies = [ "bech32", "bitcoin", + "bitcoin-consensus-encoding", + "bitcoin-internals 0.6.0", + "bitcoin_hashes 1.2.0", + "hex-conservative 1.3.0", "secp256k1-zkp", "serde", "serde_json", @@ -553,9 +669,9 @@ dependencies = [ [[package]] name = "elements-miniscript" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571fa105690f83c7833df2109eb2e14ca0e62d633d2624ffcb166ff18a3da870" +checksum = "0c18e931c81e6e7e58d63b6fea1c57f5534717f0e6721741c4fce72a6c547e19" dependencies = [ "bitcoin", "elements", @@ -598,11 +714,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand", + "rand 0.8.8", "rustc-hex", "static_assertions", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "foldhash" version = "0.1.5" @@ -645,16 +767,6 @@ dependencies = [ "slab", ] -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - [[package]] name = "getrandom" version = "0.2.17" @@ -677,6 +789,7 @@ dependencies = [ "cfg-if", "libc", "r-efi", + "rand_core 0.10.1", ] [[package]] @@ -685,12 +798,6 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8449d342b1c67f49169e92e71deb7b9b27f30062301a16dbc27a4cc8d2351b7" -[[package]] -name = "glob" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" - [[package]] name = "globset" version = "0.4.20" @@ -764,9 +871,9 @@ checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" [[package]] name = "hmac" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +checksum = "6303bc9732ae41b04cb554b844a762b4115a61bfaa81e3e83050991eeb56863f" dependencies = [ "digest", ] @@ -780,6 +887,15 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "hybrid-array" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27f864f10dfb56725ce5ce5472bc52252c8f93a4ab86327122cebf62c5f59a17" +dependencies = [ + "typenum", +] + [[package]] name = "ignore" version = "0.4.33" @@ -1093,12 +1209,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.37" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +checksum = "2bfe0f4c752e450fc2faf62654f1c134747922825d5b04ca717b8874f41a40c0" dependencies = [ "proc-macro2", - "syn 2.0.119", + "syn 3.0.9", ] [[package]] @@ -1130,6 +1246,26 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "proptest" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8530004ccb15eae51c7e40009fbe317f341f804db54dc033eec1c50be28cfa0" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.13.2", + "chacha20", + "core_detect", + "num-traits", + "rand 0.10.3", + "rand_xorshift", + "regex-syntax 0.8.11", + "rusty-fork", + "tempfile", + "unarray", +] + [[package]] name = "psm" version = "0.1.32" @@ -1140,6 +1276,12 @@ dependencies = [ "cc", ] +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quote" version = "1.0.47" @@ -1169,7 +1311,18 @@ checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c" dependencies = [ "libc", "rand_chacha", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af" +dependencies = [ + "chacha20", + "getrandom 0.4.3", + "rand_core 0.10.1", ] [[package]] @@ -1179,7 +1332,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -1191,6 +1344,21 @@ dependencies = [ "getrandom 0.2.17", ] +[[package]] +name = "rand_core" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + +[[package]] +name = "rand_xorshift" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60aa6af80be32871323012e02e6e65f8a7cc7890931ae421d217ad8fe0df2ccf" +dependencies = [ + "rand_core 0.10.1", +] + [[package]] name = "regex-automata" version = "0.3.9" @@ -1313,6 +1481,18 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" +[[package]] +name = "rusty-fork" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + [[package]] name = "same-file" version = "1.0.6" @@ -1328,8 +1508,8 @@ version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" dependencies = [ - "bitcoin_hashes", - "rand", + "bitcoin_hashes 0.14.101", + "rand 0.8.8", "secp256k1-sys", "serde", ] @@ -1350,7 +1530,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52a44aed3002b5ae975f8624c5df3a949cfbf00479e18778b6058fcd213b76e3" dependencies = [ "bitcoin-private", - "rand", + "rand 0.8.8", "secp256k1", "secp256k1-zkp-sys", "serde", @@ -1399,14 +1579,14 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] name = "serde_json" -version = "1.0.151" +version = "1.0.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" dependencies = [ "itoa", "memchr", @@ -1417,18 +1597,18 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +checksum = "4e7523beb55eece201a2356bee0bbca0d1ab466c14c07703b2e0ee6d42cb0c2c" dependencies = [ "serde_core", ] [[package]] name = "sha2" -version = "0.10.9" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19" dependencies = [ "cfg-if", "cpufeatures", @@ -1443,36 +1623,36 @@ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" [[package]] name = "simplicity-lang" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13ed081e3046d66c146d7201bcbf3b655ca3436cb83f6efc26d7895bd2b79d06" +checksum = "cff7b10251528d46d9cf60238267911984fedbb0948cccea98dd74fc6bf9f729" dependencies = [ "bitcoin", - "bitcoin_hashes", + "bitcoin_hashes 1.2.0", "byteorder", "elements", "getrandom 0.2.17", "ghost-cell", - "hex-conservative 0.2.3", + "hex-conservative 1.3.0", "miniscript", "simplicity-sys", ] [[package]] name = "simplicity-sys" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d1ec5477c7650b8ef511aa56dccb28f2e8cdb6e87f260ecffdaf0ebfef2d3b" +checksum = "955935733b2735665b4735d9b1361eade6be4c7aea6bca2640345e4c81756f58" dependencies = [ - "bitcoin_hashes", + "bitcoin_hashes 1.2.0", "cc", ] [[package]] name = "simplicityhl" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae77168fa3367d234b11bb3999cbd6e04d7180db0b9e11f83de259528e3b23d1" +checksum = "9e110f12190a4df92970b50d701f7da979638a60c5bf8294d55e4a55aceebf3e" dependencies = [ "ariadne", "base64 0.21.7", @@ -1496,7 +1676,7 @@ dependencies = [ "num-bigint", "num-traits", "primitive-types", - "rand", + "rand 0.8.8", "secp256k1-zkp", "smplx-std", ] @@ -1509,11 +1689,10 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "smplx-build" -version = "0.0.12" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e9561b9da1d788d3e777f8a59b085dd13a6fbace5b109f2b0576069f9f36ff" +checksum = "f886393537eaf341fb389d6cdb5365630d09daf99bcb4b570b228a0cad18dca2" dependencies = [ - "glob", "globwalk", "pathdiff", "prettyplease", @@ -1522,7 +1701,7 @@ dependencies = [ "serde", "serde_json", "simplicityhl", - "syn 2.0.119", + "syn 3.0.9", "thiserror", "toml", "toml_edit", @@ -1530,20 +1709,20 @@ dependencies = [ [[package]] name = "smplx-macros" -version = "0.0.12" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f802ff11501371c4c822f0ecdbf7e9e65180ccbbb43b55f252c9a00cb849d24" +checksum = "c798548362bb93281d5cc553fbd2b8af2eda9417a51243c85efc3ae665f5f23b" dependencies = [ "smplx-build", "smplx-test", - "syn 2.0.119", + "syn 3.0.9", ] [[package]] name = "smplx-regtest" -version = "0.0.12" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881db46f30a472018c26c5f245637a722ccba36a873b845d5e6376e7bd5e1106" +checksum = "cd6bcd96bdbc865762ba32f4f9998be9d8974340fc5c28a7c81557e9c9d3eba8" dependencies = [ "electrsd", "hex", @@ -1557,12 +1736,11 @@ dependencies = [ [[package]] name = "smplx-sdk" -version = "0.0.12" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98b85112288eccd99ba34bd852681d78c3581a52709eab0ce52a073b9d961d8e" +checksum = "160e1785e326d8cb7f8cc89ef1b0be5c49c63a20ee15cd7f179af6988f577163" dependencies = [ "bip39", - "bitcoin_hashes", "bitcoincore-rpc", "dyn-clone", "elements-miniscript", @@ -1577,11 +1755,13 @@ dependencies = [ [[package]] name = "smplx-std" -version = "0.0.12" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05855ac57a1b5f737a4bc244ebf5924453957a2066a0bb0fd8df033498386ba" +checksum = "16413a15bb3c65af6357f2f91ddb1400dc945b303d17db46f0230e77f818762e" dependencies = [ "either", + "rand 0.10.3", + "rand_core 0.10.1", "serde", "simplicityhl", "smplx-macros", @@ -1591,18 +1771,20 @@ dependencies = [ [[package]] name = "smplx-test" -version = "0.0.12" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a66ea20c2701a90faf10f9a18176058dd7a82222797d5ed6da9c83f0f1ca032" +checksum = "05907f61baf71916ed46c7daa76fd528e5605681902686137c8e6261b82a55d3" dependencies = [ "electrsd", "proc-macro2", + "proptest", "quote", + "rand 0.10.3", "serde", "simplicityhl", "smplx-regtest", "smplx-sdk", - "syn 2.0.119", + "syn 3.0.9", "thiserror", "toml", ] @@ -1651,9 +1833,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.6" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" dependencies = [ "proc-macro2", "quote", @@ -1696,7 +1878,7 @@ checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" dependencies = [ "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", ] [[package]] @@ -1707,64 +1889,55 @@ checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" [[package]] name = "toml" -version = "0.9.12+spec-1.1.0" +version = "1.1.8+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" +checksum = "20489e00e4d8741d6be680764cc12e270655e375a20d1011e844a9c3379e678d" dependencies = [ "indexmap", "serde_core", "serde_spanned", - "toml_datetime 0.7.5+spec-1.1.0", + "toml_datetime", "toml_parser", "toml_writer", - "winnow 0.7.15", + "winnow", ] [[package]] name = "toml_datetime" -version = "0.7.5+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" -dependencies = [ - "serde_core", -] - -[[package]] -name = "toml_datetime" -version = "1.1.1+spec-1.1.0" +version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053" dependencies = [ "serde_core", ] [[package]] name = "toml_edit" -version = "0.25.15+spec-1.1.0" +version = "0.25.17+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1340ea94a5856333492c9064b02c778b191dd2c853778d9609debdcdfea3a614" +checksum = "e3641d5bbb5349a79e1020a242d251efbc546ad8048d133958323ce9c40a9c9c" dependencies = [ "indexmap", - "toml_datetime 1.1.1+spec-1.1.0", + "toml_datetime", "toml_parser", "toml_writer", - "winnow 1.0.4", + "winnow", ] [[package]] name = "toml_parser" -version = "1.1.3+spec-1.1.0" +version = "1.1.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" +checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c" dependencies = [ - "winnow 1.0.4", + "winnow", ] [[package]] name = "toml_writer" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2" +checksum = "06bdbd8cfc056b8d2e2e85f29b56a3bdbecb527cef81eb39e3e7b98af4652770" [[package]] name = "typenum" @@ -1784,6 +1957,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + [[package]] name = "unicode-ident" version = "1.0.26" @@ -1830,10 +2009,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] -name = "version_check" -version = "0.9.5" +name = "wait-timeout" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] [[package]] name = "walkdir" @@ -1883,7 +2065,7 @@ dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 3.0.6", + "syn 3.0.9", "wasm-bindgen-shared", ] @@ -2023,12 +2205,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winnow" -version = "0.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" - [[package]] name = "winnow" version = "1.0.4" diff --git a/Cargo.toml b/Cargo.toml index 7703add..775a753 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ keywords = ["simplicity", "liquid", "elements", "smart-contracts"] categories = ["cryptography::cryptocurrencies"] [dependencies] -smplx-std = { version = "0.0.12" } +smplx-std = { version = "0.1.1" } [dev-dependencies] anyhow = { version = "1.0.101" } diff --git a/Simplex.toml b/Simplex.toml index c522f64..2dfcb1c 100644 --- a/Simplex.toml +++ b/Simplex.toml @@ -6,10 +6,10 @@ # out_dir = "./src/artifacts" # [dependencies] -# some_dep = { git = "", path = "" } +# some_dep = { git = "", path = "", = "", package = "" } # [regtest] -# mnemonic = "exist carry drive collect lend cereal occur much tiger just involve mean" +# mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about" # bitcoins = 10_000_000 # rpc_port = 18443 # esplora_port = 3000 @@ -17,7 +17,7 @@ # rpc_password = "password" # [test] -# mnemonic = "exist carry drive collect lend cereal occur much tiger just involve mean" +# mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about" # bitcoins = 10_000_000 # verbosity = 0 @@ -25,6 +25,11 @@ # url = "" # network = "" +# [test.fuzz] +# cases = 10 +# seed = 12345 +# network = "" + # [test.rpc] # url = "" # username = "" diff --git a/tests/stdlib/common/core.rs b/tests/stdlib/common/core.rs index 054768a..1a0a43e 100644 --- a/tests/stdlib/common/core.rs +++ b/tests/stdlib/common/core.rs @@ -3,9 +3,13 @@ #![allow(dead_code)] use secp256k1_zkp::Secp256k1; -use simplex::program::{Program, WitnessTrait}; + +use simplex::program::Program; use simplex::signer::Signer; -use simplex::simplicityhl::elements::{AssetId, Script, Txid}; +use simplex::simplicityhl::{ + WitnessValues, + elements::{AssetId, Script, Txid}, +}; use simplex::transaction::partial_input::IssuanceInput; use simplex::transaction::{ FinalTransaction, PartialInput, PartialOutput, ProgramInput, RequiredSignature, UTXO, @@ -110,7 +114,7 @@ pub fn construct_final_tx( txids: Vec, ) -> anyhow::Result where - W: WitnessTrait + 'static, + W: Into + 'static, { let signer = context.get_default_signer(); let script_to_send_to = signer.get_address().script_pubkey(); @@ -140,7 +144,7 @@ where ft.add_program_input( PartialInput::new(program_utxo.clone()), - ProgramInput::new(Box::new(program.as_ref().clone()), Box::new(witness)), + ProgramInput::new(Box::new(program.as_ref().clone()), witness.into()), RequiredSignature::None, ); @@ -232,7 +236,7 @@ pub fn spend( txids: Vec, ) -> anyhow::Result where - W: WitnessTrait + 'static, + W: Into + 'static, { let ft = construct_final_tx(context, program, script, witness, data, txids)?; @@ -267,7 +271,7 @@ pub fn run( expect: Expect, ) -> anyhow::Result<()> where - W: WitnessTrait + 'static, + W: Into + 'static, { let script = fund(context, &program, DEFAULT_SEND_AMOUNT)?; let result = spend(context, &program, &script, witness, None, Vec::new()); @@ -285,7 +289,7 @@ pub fn run_with_op_return( data: &[u8], ) -> anyhow::Result<()> where - W: WitnessTrait + 'static, + W: Into + 'static, { let script = fund(context, &program, DEFAULT_SEND_AMOUNT)?; let result = spend(context, &program, &script, witness, Some(data), Vec::new()); @@ -302,7 +306,7 @@ pub fn run_with_inputs_outputs( txids: Vec, ) -> anyhow::Result<()> where - W: WitnessTrait + 'static, + W: Into + 'static, { let script = program.as_ref().get_script_pubkey(context.get_network()); diff --git a/tests/stdlib/common/uint.rs b/tests/stdlib/common/uint.rs index 1169c33..ab997d1 100644 --- a/tests/stdlib/common/uint.rs +++ b/tests/stdlib/common/uint.rs @@ -8,7 +8,8 @@ use std::ops::{Add, Div, Mul, Sub}; use rand::Rng; use rand::distributions::uniform::SampleUniform; -use simplex::program::{Program, WitnessTrait}; +use simplex::program::Program; +use simplex::simplicityhl::WitnessValues; use crate::common::u256_wrapper::U256Wrapper; @@ -47,7 +48,7 @@ pub trait TestUint: + Div { type Program: AsRef; - type Witness: WitnessTrait + 'static; + type Witness: Into + 'static; const ZERO: Self; const ONE: Self; diff --git a/tests/stdlib/common/utxo_helper.rs b/tests/stdlib/common/utxo_helper.rs index 1cf4714..be7ac88 100644 --- a/tests/stdlib/common/utxo_helper.rs +++ b/tests/stdlib/common/utxo_helper.rs @@ -124,7 +124,7 @@ pub fn create_utxos_with_new_asset( } } - Ok((new_asset.unwrap().into_inner().0, txids)) + Ok((new_asset.unwrap().to_byte_array(), txids)) } fn get_asset_id_amount_from_conf_utxo(conf_utxo: UTXO) -> anyhow::Result { diff --git a/tests/stdlib/utxo/asserts/asset_id.rs b/tests/stdlib/utxo/asserts/asset_id.rs index 7a4dc6c..7e7c444 100644 --- a/tests/stdlib/utxo/asserts/asset_id.rs +++ b/tests/stdlib/utxo/asserts/asset_id.rs @@ -186,7 +186,7 @@ fn assert_false_explicit_asset_id_for_input(context: simplex::TestContext) -> an case(Explicit) .index(index) .index_type(IndexType::Input) - .expect(context.get_network().policy_asset().into_inner().0) + .expect(context.get_network().policy_asset().to_byte_array()) .expecting(&context, Expect::AssertFailed, txids) } @@ -224,7 +224,7 @@ fn assert_false_explicit_asset_id_for_output(context: simplex::TestContext) -> a case(Explicit) .index(index) .index_type(IndexType::Output) - .expect(context.get_network().policy_asset().into_inner().0) + .expect(context.get_network().policy_asset().to_byte_array()) .expecting(&context, Expect::AssertFailed, txids) } @@ -321,7 +321,7 @@ fn assert_false_explicit_input_asset_id(context: simplex::TestContext) -> anyhow case(ExplicitInput) .index(index) - .expect(context.get_network().policy_asset().into_inner().0) + .expect(context.get_network().policy_asset().to_byte_array()) .expecting(&context, Expect::AssertFailed, txids) } @@ -376,7 +376,7 @@ fn assert_false_explicit_output_asset_id(context: simplex::TestContext) -> anyho case(ExplicitOutput) .index(index) - .expect(context.get_network().policy_asset().into_inner().0) + .expect(context.get_network().policy_asset().to_byte_array()) .expecting(&context, Expect::AssertFailed, txids) } @@ -434,7 +434,7 @@ fn assert_false_explicit_current_asset_id(context: simplex::TestContext) -> anyh case(CurrentExplicit) .index(index) - .expect(context.get_network().policy_asset().into_inner().0) + .expect(context.get_network().policy_asset().to_byte_array()) .expecting(&context, Expect::AssertFailed, txids) } diff --git a/tests/stdlib/utxo/asserts/asset_id_with_amount.rs b/tests/stdlib/utxo/asserts/asset_id_with_amount.rs index d681124..316c42f 100644 --- a/tests/stdlib/utxo/asserts/asset_id_with_amount.rs +++ b/tests/stdlib/utxo/asserts/asset_id_with_amount.rs @@ -210,7 +210,7 @@ fn assert_false_explicit_asset_id_with_amount_for_input( .index(index) .index_type(IndexType::Input) .expect( - context.get_network().policy_asset().into_inner().0, + context.get_network().policy_asset().to_byte_array(), real_amount, ) .expecting(&context, Expect::AssertFailed, txids) @@ -281,7 +281,7 @@ fn assert_false_explicit_asset_id_with_amount_for_output( .index(index) .index_type(IndexType::Output) .expect( - context.get_network().policy_asset().into_inner().0, + context.get_network().policy_asset().to_byte_array(), real_amount, ) .expecting(&context, Expect::AssertFailed, txids) @@ -432,7 +432,7 @@ fn assert_false_explicit_input_asset_id_with_amount( case(ExplicitInput) .index(index) .expect( - context.get_network().policy_asset().into_inner().0, + context.get_network().policy_asset().to_byte_array(), real_amount, ) .expecting(&context, Expect::AssertFailed, txids) @@ -533,7 +533,7 @@ fn assert_false_explicit_output_asset_id_with_amount( case(ExplicitOutput) .index(index) .expect( - context.get_network().policy_asset().into_inner().0, + context.get_network().policy_asset().to_byte_array(), real_amount, ) .expecting(&context, Expect::AssertFailed, txids) @@ -631,7 +631,7 @@ fn assert_false_explicit_current_asset_id_with_amount( case(CurrentExplicit) .index(index) .expect( - context.get_network().policy_asset().into_inner().0, + context.get_network().policy_asset().to_byte_array(), real_amount, ) .expecting(&context, Expect::AssertFailed, txids)