diff --git a/.github/workflows/check-versions.yml b/.github/workflows/check-versions.yml new file mode 100644 index 00000000..63dd4a22 --- /dev/null +++ b/.github/workflows/check-versions.yml @@ -0,0 +1,33 @@ +name: Check Example Versions + +on: + push: + branches: [ "main", "master" ] + pull_request: + branches: [ "main", "master" ] + +jobs: + verify-pragmas: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Extract version from Cargo.toml + id: get_version + run: | + # Grabs the first 'version = "X.Y.Z"' it sees in Cargo.toml + VERSION=$(awk -F '\"' '/^version/ {print $2; exit}' Cargo.toml) + echo "COMPILER_VERSION=$VERSION" >> $GITHUB_ENV + echo "Detected Cargo version: $VERSION" + + - name: Run the example updater script + run: python3 update_examples.py ${{ env.COMPILER_VERSION }} + + - name: Fail if examples are out of date + run: | + # Only check the examples directory for changes! + if ! git diff --exit-code examples/; then + echo "::error::The pragma versions in the examples/ folder are incorrect or missing!" + exit 1 + fi \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 8ad3298a..44c740df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,11 +2,17 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + [[package]] name = "aho-corasick" -version = "1.0.5" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" dependencies = [ "memchr", ] @@ -19,9 +25,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "anstream" -version = "0.6.18" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" dependencies = [ "anstyle", "anstyle-parse", @@ -34,53 +40,53 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys", + "windows-sys 0.61.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.7" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", - "once_cell", - "windows-sys", + "once_cell_polyfill", + "windows-sys 0.61.2", ] [[package]] name = "ar_archive_writer" -version = "0.2.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c269894b6fe5e9d7ada0cf69b5bf847ff35bc25fc271f08e1d080fce80339a" +checksum = "7eb93bbb63b9c227414f6eb3a0adfddca591a8ce1e9b60661bb08969b87e340b" dependencies = [ "object", ] [[package]] name = "arbitrary" -version = "1.1.3" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a7924531f38b1970ff630f03eb20a2fde69db5c590c93b0f3482e95dcc5fd60" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" dependencies = [ "derive_arbitrary", ] @@ -91,6 +97,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "base58ck" version = "0.1.0" @@ -103,9 +115,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.3" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" @@ -115,15 +127,15 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bech32" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" +checksum = "32637268377fc7b10a8c6d51de3e7fba1ce5dd371a96e342b34e6078db558e7f" [[package]] name = "bitcoin" -version = "0.32.3" +version = "0.32.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0032b0e8ead7074cda7fc4f034409607e3f03a6f71d66ade8a307f79b4d99e73" +checksum = "1e499f9fc0407f50fe98af744ab44fa67d409f76b6772e1689ec8485eb0c0f66" dependencies = [ "base58ck", "bech32", @@ -144,9 +156,9 @@ checksum = "30bdbe14aa07b06e6cfeffc529a1f099e5fbe249524f8125358604df99a4bed2" [[package]] name = "bitcoin-io" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "340e09e8399c7bd8912f495af6aa58bea0c9214773417ffaa8f6460f93aaee56" +checksum = "2dee39a0ee5b4095224a0cfc6bf4cc1baf0f9624b96b367e53b66d974e51d953" [[package]] name = "bitcoin-private" @@ -165,31 +177,43 @@ dependencies = [ [[package]] name = "bitcoin_hashes" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" +checksum = "26ec84b80c482df901772e931a9a681e26a1b9ee2302edeff23cb30328745c8b" dependencies = [ "bitcoin-io", "hex-conservative", ] +[[package]] +name = "bitflags" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" + [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" [[package]] name = "cc" -version = "1.2.55" +version = "1.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29" +checksum = "e1e928d4b69e3077709075a938a05ffbedfa53a84c8f766efbf8220bb1ff60e1" dependencies = [ "find-msvc-tools", "jobserver", @@ -199,9 +223,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chumsky" @@ -209,8 +233,8 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acc17a6284abccac6e50db35c1cee87f605474a72939b959a3a67d9371800efd" dependencies = [ - "hashbrown", - "regex-automata", + "hashbrown 0.15.5", + "regex-automata 0.3.9", "serde", "stacker", "unicode-ident", @@ -219,18 +243,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.37" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" +checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.37" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" dependencies = [ "anstream", "anstyle", @@ -240,9 +264,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.4" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" [[package]] name = "codegen" @@ -253,38 +277,93 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] [[package]] name = "derive_arbitrary" -version = "1.1.3" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9a577516173adb681466d517d39bd468293bc2c2a16439375ef0f35bba45f3d" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "elements" -version = "0.25.0" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "739a0201c8b2d1e35e6509872ddb8250dd37b38d2a462b9cea05988bf9630196" +checksum = "81b2569d3495bfdfce36c504fd4d78752ff4a7699f8a33e6f3ee523bddf9f6ad" dependencies = [ "bech32", "bitcoin", "secp256k1-zkp", ] +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -292,409 +371,1217 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] -name = "find-msvc-tools" -version = "0.1.9" +name = "errno" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] [[package]] -name = "foldhash" -version = "0.1.5" +name = "fastrand" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] -name = "getrandom" -version = "0.2.10" +name = "filetime" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" dependencies = [ "cfg-if", - "js-sys", "libc", - "wasi", - "wasm-bindgen", + "libredox", ] [[package]] -name = "ghost-cell" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8449d342b1c67f49169e92e71deb7b9b27f30062301a16dbc27a4cc8d2351b7" - -[[package]] -name = "hashbrown" -version = "0.15.5" +name = "find-msvc-tools" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" -dependencies = [ - "allocator-api2", - "equivalent", - "foldhash", -] +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" [[package]] -name = "hex-conservative" -version = "0.2.1" +name = "flate2" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" dependencies = [ - "arrayvec", + "crc32fast", + "miniz_oxide", ] [[package]] -name = "hex_lit" -version = "0.1.1" +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "is_terminal_polyfill" -version = "1.70.1" +name = "foldhash" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] -name = "itertools" -version = "0.13.0" +name = "foreign-types" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "either", + "foreign-types-shared", ] [[package]] -name = "itoa" -version = "1.0.9" +name = "foreign-types-shared" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] -name = "jobserver" -version = "0.1.32" +name = "form_urlencoded" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ - "libc", + "percent-encoding", ] [[package]] -name = "js-sys" -version = "0.3.69" +name = "futures-channel" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" dependencies = [ - "wasm-bindgen", + "futures-core", + "futures-sink", ] [[package]] -name = "libc" -version = "0.2.180" +name = "futures-core" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" [[package]] -name = "libfuzzer-sys" -version = "0.4.10" +name = "futures-io" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5037190e1f70cbeef565bd267599242926f724d3b8a9f510fd7e0b540cfa4404" -dependencies = [ - "arbitrary", - "cc", -] +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" [[package]] -name = "log" -version = "0.4.22" +name = "futures-sink" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" [[package]] -name = "memchr" -version = "2.6.3" +name = "futures-task" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" [[package]] -name = "miniscript" -version = "12.3.1" +name = "futures-util" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82911d2fb527bb9aacd2446d2f517aff3f8e3846ace1b3c24258b61ea3cce2bc" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" dependencies = [ - "bech32", - "bitcoin", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", ] [[package]] -name = "object" -version = "0.32.2" +name = "getrandom" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ - "memchr", + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", ] [[package]] -name = "once_cell" -version = "1.21.3" +name = "getrandom" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", +] [[package]] -name = "ppv-lite86" -version = "0.2.17" +name = "ghost-cell" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "d8449d342b1c67f49169e92e71deb7b9b27f30062301a16dbc27a4cc8d2351b7" [[package]] -name = "proc-macro2" -version = "1.0.66" +name = "h2" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" dependencies = [ - "unicode-ident", + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", ] [[package]] -name = "psm" -version = "0.1.28" +name = "hashbrown" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d11f2fedc3b7dafdc2851bc52f277377c5473d378859be234bc7ebb593144d01" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ - "ar_archive_writer", - "cc", + "allocator-api2", + "equivalent", + "foldhash", ] [[package]] -name = "quote" -version = "1.0.33" +name = "hashbrown" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" [[package]] -name = "rand" -version = "0.8.5" +name = "hex-conservative" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "fda06d18ac606267c40c04e41b9947729bf8b9efe74bd4e82b61a5f26a510b9f" dependencies = [ - "libc", - "rand_chacha", - "rand_core", + "arrayvec", ] [[package]] -name = "rand_chacha" -version = "0.3.1" +name = "hex_lit" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] +checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" [[package]] -name = "rand_core" -version = "0.6.4" +name = "home" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" dependencies = [ - "getrandom", + "windows-sys 0.61.2", ] [[package]] -name = "regex" -version = "1.9.5" +name = "http" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", + "bytes", + "itoa", ] [[package]] -name = "regex-automata" -version = "0.3.8" +name = "http-body" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", + "bytes", + "http", ] [[package]] -name = "regex-syntax" -version = "0.7.5" +name = "http-body-util" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] [[package]] -name = "ryu" -version = "1.0.15" +name = "httparse" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] -name = "santiago" -version = "1.3.1" +name = "hyper" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de36022292bc2086eb8f55bffa460fef3475e4459b478820711f4c421feb87ec" +checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" dependencies = [ - "regex", + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", ] [[package]] -name = "secp256k1" -version = "0.29.1" +name = "hyper-rustls" +version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ - "bitcoin_hashes", - "rand", - "secp256k1-sys", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", ] [[package]] -name = "secp256k1-sys" -version = "0.10.1" +name = "hyper-tls" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ - "cc", + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", ] [[package]] -name = "secp256k1-zkp" -version = "0.11.0" +name = "hyper-util" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52a44aed3002b5ae975f8624c5df3a949cfbf00479e18778b6058fcd213b76e3" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" dependencies = [ - "bitcoin-private", - "rand", - "secp256k1", - "secp256k1-zkp-sys", + "base64 0.22.1", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "system-configuration", + "tokio", + "tower-service", + "tracing", + "windows-registry", ] [[package]] -name = "secp256k1-zkp-sys" -version = "0.10.1" +name = "icu_collections" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57f08b2d0b143a22e07f798ae4f0ab20d5590d7c68e0d090f2088a48a21d1654" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" dependencies = [ - "cc", - "secp256k1-sys", + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "serde" -version = "1.0.188" +name = "icu_locale_core" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" dependencies = [ - "serde_derive", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "serde_derive" -version = "1.0.188" +name = "icu_normalizer" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.31", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", ] [[package]] -name = "serde_json" -version = "1.0.105" +name = "icu_normalizer_data" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" dependencies = [ - "itoa", - "ryu", - "serde", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", ] [[package]] -name = "shlex" -version = "1.3.0" +name = "icu_properties_data" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" [[package]] -name = "simplicity-lang" -version = "0.7.0" +name = "icu_provider" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e57bd4d84853974a212eab24ed89da54f49fbccf5e33e93bcd29f0a6591cd5" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" dependencies = [ - "bitcoin", - "bitcoin_hashes", - "byteorder", - "elements", - "getrandom", - "ghost-cell", - "hex-conservative", - "miniscript", - "santiago", - "simplicity-sys", + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", ] [[package]] -name = "simplicity-sys" -version = "0.6.0" +name = "idna" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875630d128f19818161cefe0a3d910b6aae921d8246711db574a689cb2c11747" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ - "bitcoin_hashes", - "cc", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "simplicityhl" -version = "0.5.0-rc.0" +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "iri-string" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4c90f45aa2e6eacbe8645f77fdea542ac97a494bcd117a67df9ff4d611f995" +dependencies = [ + "cfg-if", + "futures-util", + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" + +[[package]] +name = "libfuzzer-sys" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f12a681b7dd8ce12bff52488013ba614b869148d54dd79836ab85aafdd53f08d" dependencies = [ "arbitrary", - "base64 0.21.3", + "cc", +] + +[[package]] +name = "libredox" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ddbf48fd451246b1f8c2610bd3b4ac0cc6e149d89832867093ab69a17194f08" +dependencies = [ + "bitflags", + "libc", + "plain", + "redox_syscall", +] + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniscript" +version = "12.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487906208f38448e186e3deb02f2b8ef046a9078b0de00bdb28bf4fb9b76951c" +dependencies = [ + "bech32", + "bitcoin", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "native-tls" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "openssl" +version = "0.10.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "951c002c75e16ea2c65b8c7e4d3d51d5530d8dfa7d060b4776828c88cfb18ecf" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "openssl-sys" +version = "0.9.112" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d55af3b3e226502be1526dfdba67ab0e9c96fc293004e79576b2b9edb0dbdb" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "psm" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3852766467df634d74f0b2d7819bf8dc483a0eb2e3b0f50f756f9cfe8b0d18d8" +dependencies = [ + "ar_archive_writer", + "cc", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "redox_syscall" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce70a74e890531977d37e532c34d45e9055d2409ed08ddba14529471ed0be16" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.14", + "regex-syntax 0.8.10", +] + +[[package]] +name = "regex-automata" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.5", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.10", +] + +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "js-sys", + "log", + "mime", + "native-tls", + "percent-encoding", + "pin-project-lite", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-native-tls", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.23.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "santiago" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de36022292bc2086eb8f55bffa460fef3475e4459b478820711f4c421feb87ec" +dependencies = [ + "regex", +] + +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "secp256k1" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" +dependencies = [ + "bitcoin_hashes", + "rand", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +dependencies = [ + "cc", +] + +[[package]] +name = "secp256k1-zkp" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52a44aed3002b5ae975f8624c5df3a949cfbf00479e18778b6058fcd213b76e3" +dependencies = [ + "bitcoin-private", + "rand", + "secp256k1", + "secp256k1-zkp-sys", +] + +[[package]] +name = "secp256k1-zkp-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57f08b2d0b143a22e07f798ae4f0ab20d5590d7c68e0d090f2088a48a21d1654" +dependencies = [ + "cc", + "secp256k1-sys", +] + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "simd-adler32" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" + +[[package]] +name = "simplicity-lang" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e57bd4d84853974a212eab24ed89da54f49fbccf5e33e93bcd29f0a6591cd5" +dependencies = [ + "bitcoin", + "bitcoin_hashes", + "byteorder", + "elements", + "getrandom 0.2.17", + "ghost-cell", + "hex-conservative", + "miniscript", + "santiago", + "simplicity-sys", +] + +[[package]] +name = "simplicity-sys" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3401ee7331f183a5458c0f5a4b3d5d00bde0fd12e2e03728c537df34efae289" +dependencies = [ + "bitcoin_hashes", + "cc", +] + +[[package]] +name = "simplicityhl" +version = "0.5.0-rc.0" +dependencies = [ + "arbitrary", + "base64 0.21.7", "chumsky", "clap", "either", - "getrandom", + "flate2", + "getrandom 0.2.17", + "home", "itertools", "miniscript", + "regex", + "reqwest", + "semver", "serde", "serde_json", "simplicity-lang", + "tar", +] + +[[package]] +name = "simplicityhl-fuzz" +version = "0.0.0" +dependencies = [ + "arbitrary", + "base64 0.22.1", + "itertools", + "libfuzzer-sys", + "serde_json", + "simplicityhl", ] [[package]] -name = "simplicityhl-fuzz" -version = "0.0.0" +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" dependencies = [ - "arbitrary", - "base64 0.22.1", - "itertools", - "libfuzzer-sys", - "serde_json", - "simplicityhl", + "libc", + "windows-sys 0.61.2", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + [[package]] name = "stacker" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1f8b29fb42aafcea4edeeb6b2f2d7ecd0d969c48b4cf0d2e64aafc471dd6e59" +checksum = "08d74a23609d509411d10e2176dc2a4346e3b4aea2e7b1869f19fdedbc71c013" dependencies = [ "cc", "cfg-if", "libc", "psm", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -703,11 +1590,17 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + [[package]] name = "syn" -version = "1.0.109" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -715,27 +1608,232 @@ dependencies = [ ] [[package]] -name = "syn" -version = "2.0.31" +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "unicode-ident", + "syn", +] + +[[package]] +name = "system-configuration" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" +dependencies = [ + "bitflags", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tar" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22692a6476a21fa75fdfc11d452fda482af402c008cdbaf3476414e122040973" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.3.4", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", ] +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "unicode-segmentation" -version = "1.12.0" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "utf8parse" @@ -743,42 +1841,64 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "6523d69017b7633e396a89c5efab138161ed5aafcbc8d3e5c5a42ae38f50495a" dependencies = [ "cfg-if", + "once_cell", + "rustversion", "wasm-bindgen-macro", + "wasm-bindgen-shared", ] [[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" +name = "wasm-bindgen-futures" +version = "0.4.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "2d1faf851e778dfa54db7cd438b70758eba9755cb47403f3496edd7c8fc212f0" dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.31", - "wasm-bindgen-shared", + "js-sys", + "wasm-bindgen", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "4e3a6c758eb2f701ed3d052ff5737f5bfe6614326ea7f3bbac7156192dc32e67" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -786,22 +1906,79 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "921de2737904886b52bcbb237301552d05969a6f9c40d261eb0533c8b055fedf" dependencies = [ + "bumpalo", "proc-macro2", "quote", - "syn 2.0.31", - "wasm-bindgen-backend", + "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.115" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a93e946af942b58934c604527337bad9ae33ba1d5c6900bbb41c2c07c2364a93" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84cde8507f4d7cfcb1185b8cb5890c494ffea65edbe1ba82cfd63661c805ed94" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-registry" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] [[package]] name = "windows-sys" @@ -812,6 +1989,15 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-targets" version = "0.52.6" @@ -875,3 +2061,134 @@ name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "xattr" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" +dependencies = [ + "libc", + "rustix", +] + +[[package]] +name = "yoke" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/Cargo.toml b/Cargo.toml index 38366446..da40d0ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,13 @@ itertools = "0.13.0" arbitrary = { version = "1", optional = true, features = ["derive"] } clap = "4.5.37" chumsky = "0.11.2" +semver = "1.0.27" + +regex = "1.10" +home = "0.5" +reqwest = { version = "0.12", features = ["blocking", "json"] } +flate2 = "1.0" # For unpacking .tar.gz +tar = "0.4" # For unpacking .tar.gz [target.wasm32-unknown-unknown.dependencies] getrandom = { version = "0.2", features = ["js"] } @@ -68,7 +75,7 @@ copy_iterator = "warn" default_trait_access = "warn" doc_link_with_quotes = "warn" doc_markdown = "warn" -empty_enum = "warn" +empty_enums = "warn" enum_glob_use = "allow" expl_impl_clone_on_copy = "warn" explicit_deref_methods = "warn" @@ -152,7 +159,7 @@ struct_field_names = "warn" too_many_lines = "allow" transmute_ptr_to_ptr = "warn" trivially_copy_pass_by_ref = "warn" -unchecked_duration_subtraction = "warn" +unchecked_time_subtraction = "warn" unicode_not_nfc = "warn" unnecessary_box_returns = "warn" unnecessary_join = "warn" diff --git a/examples/array_fold.simf b/examples/array_fold.simf index e671493c..d3e0da46 100644 --- a/examples/array_fold.simf +++ b/examples/array_fold.simf @@ -1,3 +1,5 @@ +#![compiler_version("0.5.0-rc.0")] + fn sum(elt: u32, acc: u32) -> u32 { let (_, acc): (bool, u32) = jet::add_32(elt, acc); acc diff --git a/examples/array_fold_2n.simf b/examples/array_fold_2n.simf index 9d86325c..d78fb8e4 100644 --- a/examples/array_fold_2n.simf +++ b/examples/array_fold_2n.simf @@ -1,5 +1,7 @@ // From https://github.com/BlockstreamResearch/SimplicityHL/issues/153 +#![compiler_version("0.5.0-rc.0")] + fn sum(elt: u32, acc: u32) -> u32 { let (_, acc): (bool, u32) = jet::add_32(elt, acc); acc diff --git a/examples/cat.simf b/examples/cat.simf index f6c5e76c..dcc7f6cc 100644 --- a/examples/cat.simf +++ b/examples/cat.simf @@ -1,3 +1,5 @@ +#![compiler_version("0.2.0")] + fn main() { let ab: u16 = <(u8, u8)>::into((0x10, 0x01)); let c: u16 = 0x1001; diff --git a/examples/ctv.simf b/examples/ctv.simf index 3eadb44c..439938a8 100644 --- a/examples/ctv.simf +++ b/examples/ctv.simf @@ -5,6 +5,8 @@ * we require the user to specify all the components of the sighash * that they want to commit. */ +#![compiler_version("0.5.0-rc.0")] + fn main() { let ctx: Ctx8 = jet::sha_256_ctx_8_init(); let ctx: Ctx8 = jet::sha_256_ctx_8_add_4(ctx, jet::version()); diff --git a/examples/escrow_with_delay.simf b/examples/escrow_with_delay.simf index 67dd3d3e..5d742c84 100644 --- a/examples/escrow_with_delay.simf +++ b/examples/escrow_with_delay.simf @@ -7,6 +7,8 @@ * * https://docs.ivylang.org/bitcoin/language/ExampleContracts.html#escrowwithdelay */ +#![compiler_version("0.5.0-rc.0")] + fn not(bit: bool) -> bool { ::into(jet::complement_1(::into(bit))) } diff --git a/examples/hash_loop.simf b/examples/hash_loop.simf index f554d894..2c3043c4 100644 --- a/examples/hash_loop.simf +++ b/examples/hash_loop.simf @@ -1,3 +1,5 @@ +#![compiler_version("0.5.0-rc.0")] + // Add counter to streaming hash and finalize when the loop exists fn hash_counter_8(ctx: Ctx8, unused: (), byte: u8) -> Either { let new_ctx: Ctx8 = jet::sha_256_ctx_8_add_1(ctx, byte); diff --git a/examples/hodl_vault.simf b/examples/hodl_vault.simf index fdc29ae5..21591149 100644 --- a/examples/hodl_vault.simf +++ b/examples/hodl_vault.simf @@ -8,6 +8,8 @@ * the use of old data. The transaction is timelocked to the oracle height, * which means that the transaction becomes valid after the oracle height. */ +#![compiler_version("0.5.0-rc.0")] + fn checksig(pk: Pubkey, sig: Signature) { let msg: u256 = jet::sig_all_hash(); jet::bip_0340_verify((pk, msg), sig); diff --git a/examples/htlc.simf b/examples/htlc.simf index 2ee98c5e..55b4ead3 100644 --- a/examples/htlc.simf +++ b/examples/htlc.simf @@ -9,6 +9,8 @@ * * https://docs.ivylang.org/bitcoin/language/ExampleContracts.html#htlc */ +#![compiler_version("0.5.0-rc.0")] + fn sha2(string: u256) -> u256 { let hasher: Ctx8 = jet::sha_256_ctx_8_init(); let hasher: Ctx8 = jet::sha_256_ctx_8_add_32(hasher, string); diff --git a/examples/last_will.simf b/examples/last_will.simf index 01007b07..2e405a26 100644 --- a/examples/last_will.simf +++ b/examples/last_will.simf @@ -5,6 +5,8 @@ * days. The owner has to repeat the covenant when he moves the coins with his * hot key. The owner can break out of the covenant with his cold key. */ +#![compiler_version("0.5.0-rc.0")] + fn checksig(pk: Pubkey, sig: Signature) { let msg: u256 = jet::sig_all_hash(); jet::bip_0340_verify((pk, msg), sig); diff --git a/examples/non_interactive_fee_bump.simf b/examples/non_interactive_fee_bump.simf index 5188633c..dcea090a 100644 --- a/examples/non_interactive_fee_bump.simf +++ b/examples/non_interactive_fee_bump.simf @@ -11,6 +11,7 @@ * This enables miners to maximize their fees from transactions without needing external fee bumping services like * sponsors, Child-Pays-For-Parent (CPFP), or anchor outputs, simplifying fee management for transaction inclusion. */ +#![compiler_version("0.5.0-rc.0")] // This function computes a signature hash for transactions that allows non-interactive fee bumping. // It omits certain fields from the transaction that can be modified by anyone, diff --git a/examples/p2ms.simf b/examples/p2ms.simf index d95c1a0e..0ceb9f75 100644 --- a/examples/p2ms.simf +++ b/examples/p2ms.simf @@ -6,6 +6,8 @@ * * https://docs.ivylang.org/bitcoin/language/ExampleContracts.html#lockwithmultisig */ +#![compiler_version("0.5.0-rc.0")] + fn not(bit: bool) -> bool { ::into(jet::complement_1(::into(bit))) } diff --git a/examples/p2pk.simf b/examples/p2pk.simf index 7e40dd55..8fc38035 100644 --- a/examples/p2pk.simf +++ b/examples/p2pk.simf @@ -5,6 +5,8 @@ * * https://docs.ivylang.org/bitcoin/language/ExampleContracts.html#lockwithpublickey */ +#![compiler_version("0.5.0-rc.0")] + fn main() { jet::bip_0340_verify((param::ALICE_PUBLIC_KEY, jet::sig_all_hash()), witness::ALICE_SIGNATURE) } diff --git a/examples/p2pkh.simf b/examples/p2pkh.simf index 42f527a9..0f49b3d5 100644 --- a/examples/p2pkh.simf +++ b/examples/p2pkh.simf @@ -6,6 +6,8 @@ * * https://docs.ivylang.org/bitcoin/language/ExampleContracts.html#lockwithpublickeyhash */ +#![compiler_version("0.5.0-rc.0")] + fn sha2(string: u256) -> u256 { let hasher: Ctx8 = jet::sha_256_ctx_8_init(); let hasher: Ctx8 = jet::sha_256_ctx_8_add_32(hasher, string); diff --git a/examples/presigned_vault.simf b/examples/presigned_vault.simf index acd2ee28..138448f2 100644 --- a/examples/presigned_vault.simf +++ b/examples/presigned_vault.simf @@ -16,6 +16,8 @@ * * https://docs.ivylang.org/bitcoin/language/ExampleContracts.html#vaultspend */ +#![compiler_version("0.5.0-rc.0")] + fn checksig(pk: Pubkey, sig: Signature) { let msg: u256 = jet::sig_all_hash(); jet::bip_0340_verify((pk, msg), sig); diff --git a/examples/reveal_collision.simf b/examples/reveal_collision.simf index bec8b1f3..cff6c587 100644 --- a/examples/reveal_collision.simf +++ b/examples/reveal_collision.simf @@ -8,6 +8,8 @@ * * https://docs.ivylang.org/bitcoin/language/ExampleContracts.html#revealcollision */ +#![compiler_version("0.5.0-rc.0")] + fn not(bit: bool) -> bool { ::into(jet::complement_1(::into(bit))) } diff --git a/examples/reveal_fix_point.simf b/examples/reveal_fix_point.simf index 02f5da8d..045646b2 100644 --- a/examples/reveal_fix_point.simf +++ b/examples/reveal_fix_point.simf @@ -8,6 +8,8 @@ * * https://docs.ivylang.org/bitcoin/language/ExampleContracts.html#revealfixedpoint */ +#![compiler_version("0.5.0-rc.0")] + fn sha2(string: u256) -> u256 { let hasher: Ctx8 = jet::sha_256_ctx_8_init(); let hasher: Ctx8 = jet::sha_256_ctx_8_add_32(hasher, string); diff --git a/examples/sighash_all_anyonecanpay.simf b/examples/sighash_all_anyonecanpay.simf index ed1f6e2f..e6531b65 100644 --- a/examples/sighash_all_anyonecanpay.simf +++ b/examples/sighash_all_anyonecanpay.simf @@ -2,6 +2,8 @@ * This program verifies a Schnorr signature based on * SIGHASH_ALL | SIGHASH_ANYONECANPAY. */ +#![compiler_version("0.5.0-rc.0")] + fn main() { let ctx: Ctx8 = jet::sha_256_ctx_8_init(); // Blockchain diff --git a/examples/sighash_all_anyprevout.simf b/examples/sighash_all_anyprevout.simf index e5448792..c8a87231 100644 --- a/examples/sighash_all_anyprevout.simf +++ b/examples/sighash_all_anyprevout.simf @@ -2,6 +2,8 @@ * This program verifies a Schnorr signature based on * SIGHASH_ALL | SIGHASH_ANYPREVOUT. */ +#![compiler_version("0.5.0-rc.0")] + fn main() { let ctx: Ctx8 = jet::sha_256_ctx_8_init(); // Blockchain diff --git a/examples/sighash_all_anyprevoutanyscript.simf b/examples/sighash_all_anyprevoutanyscript.simf index fb7ab0a7..3116152e 100644 --- a/examples/sighash_all_anyprevoutanyscript.simf +++ b/examples/sighash_all_anyprevoutanyscript.simf @@ -2,6 +2,8 @@ * This program verifies a Schnorr signature based on * SIGHASH_ALL | SIGHASH_ANYPREVOUTANYSCRIPT. */ +#![compiler_version("0.5.0-rc.0")] + fn main() { let ctx: Ctx8 = jet::sha_256_ctx_8_init(); // Blockchain diff --git a/examples/sighash_none.simf b/examples/sighash_none.simf index 3ae78c45..8ac01b4d 100644 --- a/examples/sighash_none.simf +++ b/examples/sighash_none.simf @@ -2,6 +2,8 @@ * This program verifies a Schnorr signature based on * SIGHASH_NONE. */ +#![compiler_version("0.5.0-rc.0")] + fn main() { let ctx: Ctx8 = jet::sha_256_ctx_8_init(); // Blockchain diff --git a/examples/sighash_single.simf b/examples/sighash_single.simf index db06aa0a..e91f3ed4 100644 --- a/examples/sighash_single.simf +++ b/examples/sighash_single.simf @@ -2,6 +2,8 @@ * This program verifies a Schnorr signature based on * SIGHASH_SINGLE. */ +#![compiler_version("0.5.0-rc.0")] + fn main() { let ctx: Ctx8 = jet::sha_256_ctx_8_init(); // Blockchain diff --git a/examples/transfer_with_timeout.simf b/examples/transfer_with_timeout.simf index 91f6f69e..88f6cd18 100644 --- a/examples/transfer_with_timeout.simf +++ b/examples/transfer_with_timeout.simf @@ -12,6 +12,8 @@ * * https://docs.ivylang.org/bitcoin/language/ExampleContracts.html#transferwithtimeout */ +#![compiler_version("0.5.0-rc.0")] + fn checksig(pk: Pubkey, sig: Signature) { let msg: u256 = jet::sig_all_hash(); jet::bip_0340_verify((pk, msg), sig); diff --git a/src/ast.rs b/src/ast.rs index 3c59f2f7..b2030390 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -719,6 +719,76 @@ trait AbstractSyntaxTree: Sized { impl Program { pub fn analyze(from: &parse::Program) -> Result { + let compiler_version = env!("CARGO_PKG_VERSION"); + + match (from.version(), from.version_span()) { + (Some(v), Some(span)) => { + // Parse the compiler's exact version + let compiler_semver = semver::Version::parse(compiler_version) + .expect("CARGO_PKG_VERSION is always valid semver"); + + // Parse the version requirement (e.g., "^0.5.0" or ">=0.4.0") + match semver::VersionReq::parse(v) { + Ok(req) if req.matches(&compiler_semver) => {} + Ok(_) => { + let req_str = v.to_string(); + let comp_str = compiler_version.to_string(); + + if req_str.starts_with('>') + || req_str.starts_with(">=") + || req_str.starts_with('^') + { + return Err(Error::SimcVersionCompilerTooOld { + required: req_str, + current: comp_str, + }) + .with_span(span); + } else if req_str.starts_with('<') || req_str.starts_with("<=") { + return Err(Error::SimcVersionContractTooOld { + required: req_str, + current: comp_str, + }) + .with_span(span); + } else if req_str.starts_with('=') + || req_str.chars().next().is_some_and(|c| c.is_ascii_digit()) + { + return Err(Error::SimcVersionExactMismatch { + required: req_str, + current: comp_str, + }) + .with_span(span); + } + return Err(Error::SimcVersionIncompatible { + required: req_str, + current: comp_str, + }) + .with_span(span); + } + Err(e) => { + return Err(Error::InvalidSimcVersionSyntax(e.to_string())).with_span(span); + } + } + } + (None, _) | (_, None) => { + // Find where the first actual code item starts (ignoring comments) + let first_item_span = + from.items() + .first() + .map_or(Span::new(0, 0), |item| match item { + parse::Item::TypeAlias(t) => *t.as_ref(), + parse::Item::Function(f) => *f.as_ref(), + parse::Item::Module => Span::new(0, 0), + }); + + let insertion_point = Span::new(first_item_span.start, first_item_span.start); + + return Err(Error::MissingSimcVersion { + compiler: compiler_version.to_string(), + }) + .with_span(insertion_point); + } + } + let unit = ResolvedType::unit(); let mut scope = Scope::default(); let items = from diff --git a/src/bin/simc-build.rs b/src/bin/simc-build.rs new file mode 100644 index 00000000..b448e5b6 --- /dev/null +++ b/src/bin/simc-build.rs @@ -0,0 +1,288 @@ +use flate2::read::GzDecoder; +use regex::Regex; +use reqwest::blocking::Client; +use semver::{Version, VersionReq}; +use serde_json::Value; +use std::env; +use std::fs; +use std::path::{Path, PathBuf}; +use std::process::{exit, Command}; +use tar::Archive; + +#[cfg(unix)] +use std::os::unix::fs::PermissionsExt; + +const REPO_OWNER: &str = "BlockstreamResearch"; +const REPO_NAME: &str = "SimplicityHL"; + +fn main() { + let args: Vec = env::args().collect(); + if args.len() < 2 { + eprintln!("Usage: simc-build [additional args...]"); + exit(1); + } + + let target_file = &args[1]; + + if target_file == "list" { + list_installed_compilers(); + exit(0); + } + + // Extract the compiler version requirement (or None if missing) + let version_req_str = extract_compiler_version(target_file).unwrap_or_else(|err| { + eprintln!("Error reading file: {}", err); + exit(1); + }); + + // Resolve to an exact published version via GitHub API + let exact_version = match &version_req_str { + Some(req) if get_cached_compiler_path(req).exists() => req.clone(), + _ => { + // Otherwise, resolve via GitHub API (for >=0.4.0, or latest) + resolve_compiler_version(version_req_str.as_deref()).unwrap_or_else(|err| { + eprintln!("Error resolving compiler version: {}", err); + exit(1); + }) + } + }; + + println!("--> Resolved compiler version: v{}", exact_version); + + // Setup local cache directory (~/.simc/bin/v0.5.0/) + let compiler_bin = get_cached_compiler_path(&exact_version); + + // Download and extract if we don't have it locally + if !compiler_bin.exists() { + println!( + "--> simc v{} not found locally. Downloading...", + exact_version + ); + download_and_extract_compiler(&exact_version, &compiler_bin); + } + + // Execute the cached compiler and pass through all arguments + println!("--> Compiling with simc v{}", exact_version); + let compiler_args = &args[2..]; + + let status = Command::new(&compiler_bin) + .arg(target_file) + .args(compiler_args) + .status() + .unwrap_or_else(|err| { + eprintln!("Error executing simc: {}", err); + exit(1); + }); + + exit(status.code().unwrap_or(1)); +} + +fn extract_compiler_version(file_path: &str) -> Result, String> { + let content = fs::read_to_string(file_path) + .map_err(|e| format!("Could not read {}: {}", file_path, e))?; + + let re = Regex::new(r#"#!\[compiler_version\("([^"]+)"\)\]"#).unwrap(); + + if let Some(captures) = re.captures(&content) { + Ok(Some(captures[1].to_string())) + } else { + Ok(None) + } +} + +fn resolve_compiler_version(user_requirement: Option<&str>) -> Result { + let client = Client::builder() + .user_agent("simplicity-simc-build-wrapper") + .build() + .map_err(|e| format!("Failed to build HTTP client: {}", e))?; + + match user_requirement { + None => { + println!("--> No version specified in file. Fetching the latest release..."); + let url = format!( + "https://api.github.com/repos/{}/{}/releases/latest", + REPO_OWNER, REPO_NAME + ); + + let res: Value = client + .get(&url) + .send() + .map_err(|e| format!("Network error: {}", e))? + .json() + .map_err(|e| format!("Failed to parse JSON: {}", e))?; + + let tag_name = res["tag_name"] + .as_str() + .ok_or_else(|| { + "Could not find 'tag_name' in GitHub response. API rate limit exceeded?" + .to_string() + })? + .trim_start_matches("simplicityhl-") + .trim_start_matches('v'); + + Ok(tag_name.to_string()) + } + + Some(req_str) => { + let req = VersionReq::parse(req_str) + .map_err(|_| format!("Invalid semver requirement: {}", req_str))?; + + let url = format!( + "https://api.github.com/repos/{}/{}/releases", + REPO_OWNER, REPO_NAME + ); + let res: Vec = client + .get(&url) + .send() + .map_err(|e| format!("Network error: {}", e))? + .json() + .map_err(|e| format!("Failed to parse JSON: {}", e))?; + + let mut valid_versions: Vec = res + .into_iter() + .filter_map(|release| release["tag_name"].as_str().map(|s| s.to_string())) + .map(|tag| { + tag.trim_start_matches("simplicityhl-") + .trim_start_matches('v') + .to_string() + }) + .filter_map(|tag| Version::parse(&tag).ok()) + .filter(|v| req.matches(v)) + .collect(); + + valid_versions.sort(); + + valid_versions.last().map(|v| v.to_string()).ok_or_else(|| { + format!( + "No published releases found matching requirement '{}'", + req_str + ) + }) + } + } +} + +fn get_cached_compiler_path(version: &str) -> PathBuf { + let home_dir = home::home_dir().expect("Could not determine home directory"); + let cache_dir = home_dir + .join(".simc") + .join("bin") + .join(format!("v{}", version)); + + fs::create_dir_all(&cache_dir).expect("Failed to create cache directory"); + + let exe_name = if cfg!(target_os = "windows") { + "simc.exe" + } else { + "simc" + }; + cache_dir.join(exe_name) +} + +fn download_and_extract_compiler(version: &str, target_bin: &Path) { + let os = match env::consts::OS { + "macos" => "macos", + "linux" => "linux", + "windows" => "windows", + other => { + eprintln!("Error: Unsupported OS '{}'", other); + exit(1); + } + }; + + let arch = match env::consts::ARCH { + "x86_64" => "x86_64", + "aarch64" => "aarch64", + other => { + eprintln!("Error: Unsupported architecture '{}'", other); + exit(1); + } + }; + + let asset_name = if os == "windows" { + format!("simc-{}-{}.zip", os, arch) + } else { + format!("simc-{}-{}.tar.gz", os, arch) + }; + + let url = format!( + "https://github.com/{}/{}/releases/download/simplicityhl-{}/{}", + REPO_OWNER, REPO_NAME, version, asset_name + ); + + println!("--> Fetching from {}", url); + + let client = Client::builder() + .user_agent("simplicity-simc-build-wrapper") + .build() + .unwrap(); + let response = client.get(&url).send().unwrap_or_else(|e| { + eprintln!("Failed to download compiler: {}", e); + exit(1); + }); + + if !response.status().is_success() { + eprintln!( + "Error: Failed to download release asset (HTTP {})", + response.status() + ); + eprintln!( + "Make sure a release exists for v{} and the asset {} is uploaded.", + version, asset_name + ); + exit(1); + } + + let tar = GzDecoder::new(response); + let mut archive = Archive::new(tar); + + let cache_dir = target_bin.parent().unwrap(); + archive.unpack(cache_dir).unwrap_or_else(|e| { + eprintln!("Failed to extract archive: {}", e); + exit(1); + }); + + #[cfg(unix)] + { + let mut perms = fs::metadata(target_bin) + .expect("Failed to get binary metadata") + .permissions(); + perms.set_mode(0o755); + fs::set_permissions(target_bin, perms).expect("Failed to set executable permissions"); + } + + println!("--> Download and extraction complete!"); +} + +fn list_installed_compilers() { + let home_dir = home::home_dir().expect("Could not determine home directory"); + let bin_dir = home_dir.join(".simc").join("bin"); + + println!("Installed simc versions:"); + + if !bin_dir.exists() { + println!(" (None installed yet)"); + return; + } + + let mut versions = Vec::new(); + + if let Ok(entries) = fs::read_dir(bin_dir) { + for entry in entries.flatten() { + if entry.path().is_dir() { + if let Ok(name) = entry.file_name().into_string() { + versions.push(name); + } + } + } + } + + if versions.is_empty() { + println!(" (None installed yet)"); + } else { + versions.sort(); + for version in versions { + println!(" - {}", version); + } + } +} diff --git a/src/error.rs b/src/error.rs index 1ded6fdd..b16dc631 100644 --- a/src/error.rs +++ b/src/error.rs @@ -398,6 +398,27 @@ impl fmt::Display for ErrorCollector { /// Records _what_ happened but not where. #[derive(Debug, Clone, Eq, PartialEq, Hash)] pub enum Error { + MissingSimcVersion { + compiler: String, + }, + InvalidSimcVersionSyntax(String), + SimcVersionExactMismatch { + required: String, + current: String, + }, + SimcVersionCompilerTooOld { + required: String, + current: String, + }, + SimcVersionContractTooOld { + required: String, + current: String, + }, + SimcVersionIncompatible { + required: String, + current: String, + }, + ArraySizeNonZero(usize), ListBoundPow2(usize), BitStringPow2(usize), @@ -444,6 +465,13 @@ pub enum Error { impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { + Error::MissingSimcVersion { compiler } => write!(f, "Missing compiler version: Contract must declare a version, e.g., `#![compiler_version(\"{}\")]`", compiler), + Error::InvalidSimcVersionSyntax(err) => write!(f, "Invalid version syntax: {}", err), + Error::SimcVersionExactMismatch { required, current } => write!(f, "Exact version mismatch: Contract requires {}, but compiler is {}", required, current), + Error::SimcVersionCompilerTooOld { required, current } => write!(f, "Compiler too old: Contract requires {}, but compiler is {}. Please upgrade.", required, current), + Error::SimcVersionContractTooOld { required, current } => write!(f, "Contract too old: Contract requires {}, which is not supported by compiler {}.", required, current), + Error::SimcVersionIncompatible { required, current } => write!(f, "Incompatible version: Contract requirement '{}' is not satisfied by compiler {}.", required, current), + Error::ArraySizeNonZero(size) => write!( f, "Expected a non-negative integer as array size, found {size}" @@ -697,4 +725,108 @@ let x: u32 = Left( let expected = "Cannot parse: This error has an empty file"; assert_eq!(&expected, &error.to_string()); } + + #[test] + fn display_compiler_version_missing() { + let file = "fn main() {}"; + let error = Error::MissingSimcVersion { + compiler: "0.5.0".to_string(), + } + .with_span(Span::new(0, 0)) + .with_file(Arc::from(file)); + + let expected = r#" + | +1 | fn main() {} + | Missing compiler version: Contract must declare a version, e.g., `#![compiler_version("0.5.0")]`"#; + + assert_eq!(&expected[1..], &error.to_string()); + } + + #[test] + fn display_compiler_version_invalid_syntax() { + let file = "#![compiler_version(\"abc\")]\nfn main() {}"; + let error = Error::InvalidSimcVersionSyntax("unexpected character 'a'".to_string()) + .with_span(Span::new(0, 27)) + .with_file(Arc::from(file)); + + let expected = r#" + | +1 | #![compiler_version("abc")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Invalid version syntax: unexpected character 'a'"#; + + assert_eq!(&expected[1..], &error.to_string()); + } + + #[test] + fn display_compiler_version_exact_mismatch() { + let file = "#![compiler_version(\"= 0.4.0\")]\nfn main() {}"; + let error = Error::SimcVersionExactMismatch { + required: "= 0.4.0".to_string(), + current: "0.5.0".to_string(), + } + .with_span(Span::new(0, 31)) + .with_file(Arc::from(file)); + + let expected = r#" + | +1 | #![compiler_version("= 0.4.0")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Exact version mismatch: Contract requires = 0.4.0, but compiler is 0.5.0"#; + + assert_eq!(&expected[1..], &error.to_string()); + } + + #[test] + fn display_compiler_version_too_old() { + let file = "#![compiler_version(\">= 0.6.0\")]\nfn main() {}"; + let error = Error::SimcVersionCompilerTooOld { + required: ">= 0.6.0".to_string(), + current: "0.5.0".to_string(), + } + .with_span(Span::new(0, 32)) + .with_file(Arc::from(file)); + + let expected = r#" + | +1 | #![compiler_version(">= 0.6.0")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Compiler too old: Contract requires >= 0.6.0, but compiler is 0.5.0. Please upgrade."#; + + assert_eq!(&expected[1..], &error.to_string()); + } + + #[test] + fn display_compiler_version_contract_too_old() { + let file = "#![compiler_version(\"< 0.4.0\")]\nfn main() {}"; + let error = Error::SimcVersionContractTooOld { + required: "< 0.4.0".to_string(), + current: "0.5.0".to_string(), + } + .with_span(Span::new(0, 31)) + .with_file(Arc::from(file)); + + let expected = r#" + | +1 | #![compiler_version("< 0.4.0")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Contract too old: Contract requires < 0.4.0, which is not supported by compiler 0.5.0."#; + + assert_eq!(&expected[1..], &error.to_string()); + } + + #[test] + fn display_compiler_version_incompatible() { + let file = "#![compiler_version(\"~0.6.0\")]\nfn main() {}"; + let error = Error::SimcVersionIncompatible { + required: "~0.6.0".to_string(), + current: "0.5.0".to_string(), + } + .with_span(Span::new(0, 30)) + .with_file(Arc::from(file)); + + let expected = r#" + | +1 | #![compiler_version("~0.6.0")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incompatible version: Contract requirement '~0.6.0' is not satisfied by compiler 0.5.0."#; + + assert_eq!(&expected[1..], &error.to_string()); + } } diff --git a/src/lexer.rs b/src/lexer.rs index fef18927..e8409444 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -33,11 +33,14 @@ pub enum Token<'src> { RBrace, LAngle, RAngle, + Hash, + Bang, // Number literals DecLiteral(Decimal), HexLiteral(Hexadecimal), BinLiteral(Binary), + StringLiteral(&'src str), // Boolean literal Bool(bool), @@ -84,10 +87,13 @@ impl<'src> fmt::Display for Token<'src> { Token::RBrace => write!(f, "}}"), Token::LAngle => write!(f, "<"), Token::RAngle => write!(f, ">"), + Token::Hash => write!(f, "#"), + Token::Bang => write!(f, "!"), Token::DecLiteral(s) => write!(f, "{}", s), Token::HexLiteral(s) => write!(f, "0x{}", s), Token::BinLiteral(s) => write!(f, "0b{}", s), + Token::StringLiteral(s) => write!(f, "\"{}\"", s), Token::Ident(s) => write!(f, "{}", s), @@ -145,6 +151,11 @@ pub fn lexer<'src>( _ => Token::Ident(s), }); + let string_literal = just('"') + .ignore_then(any().and_is(just('"').not()).repeated().to_slice()) + .then_ignore(just('"')) + .map(Token::StringLiteral); + let jet = just("jet::") .labelled("jet") .ignore_then(text::ident()) @@ -173,6 +184,8 @@ pub fn lexer<'src>( just("}").to(Token::RBrace), just("<").to(Token::LAngle), just(">").to(Token::RAngle), + just("#").to(Token::Hash), + just("!").to(Token::Bang), )); let comment = just("//") @@ -199,6 +212,7 @@ pub fn lexer<'src>( param, macros, keyword, + string_literal, hex, bin, num, @@ -353,4 +367,57 @@ mod tests { assert!(lex_errs.is_empty()); } + + #[test] + fn test_lex_compiler_version_exact() { + let input = "#![compiler_version(\"0.5.0\")]"; + let (tokens, errors) = lex(input); + + assert!(errors.is_empty(), "Expected no errors, found: {:?}", errors); + + let tokens = tokens.unwrap(); + assert_eq!(tokens[0], Token::Hash); + assert_eq!(tokens[1], Token::Bang); + assert_eq!(tokens[2], Token::LBracket); + assert_eq!(tokens[3], Token::Ident("compiler_version")); + assert_eq!(tokens[4], Token::LParen); + assert_eq!(tokens[5], Token::StringLiteral("0.5.0")); + assert_eq!(tokens[6], Token::RParen); + assert_eq!(tokens[7], Token::RBracket); + } + + #[test] + fn test_lex_compiler_version_complex_string() { + // Proves the lexer captures all symbols (>, =, <, ^, ~) inside the quotes as a single string token + let input = "#![compiler_version(\">= 0.0.1, <= 1.0.0, ^0.5.0, ~0.6.0\")]"; + let (tokens, errors) = lex(input); + + assert!(errors.is_empty(), "Expected no errors, found: {:?}", errors); + + let tokens = tokens.unwrap(); + assert_eq!( + tokens[5], + Token::StringLiteral(">= 0.0.1, <= 1.0.0, ^0.5.0, ~0.6.0") + ); + } + + #[test] + fn test_lex_identifier_boundary() { + // Ensures the lexer doesn't accidentally break if a user creates a variable named `compiler_version` + let input = "let compiler_version = 1;"; + let (tokens, errors) = lex(input); + + assert!(errors.is_empty(), "Expected no errors, found: {:?}", errors); + + let tokens = tokens.unwrap(); + assert_eq!(tokens[0], Token::Let); + assert_eq!(tokens[1], Token::Ident("compiler_version")); + assert_eq!(tokens[2], Token::Eq); + + assert_eq!( + tokens[3], + Token::DecLiteral(crate::str::Decimal::from_str_unchecked("1")) + ); + assert_eq!(tokens[4], Token::Semi); + } } diff --git a/src/lib.rs b/src/lib.rs index b4a1032a..b75d5390 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -321,7 +321,19 @@ pub(crate) mod tests { } pub fn template_text(program_text: Cow) -> Self { - let program = match TemplateProgram::new(program_text.as_ref()) { + let clean_text = program_text + .lines() + .filter(|line| !line.trim_start().starts_with("#![compiler_version")) + .collect::>() + .join("\n"); + + let current_version = env!("CARGO_PKG_VERSION"); + let injected_text = format!( + "#![compiler_version(\"{}\")]\n{}", + current_version, clean_text + ); + + let program = match TemplateProgram::new(injected_text.as_str()) { Ok(x) => x, Err(error) => panic!("{error}"), }; @@ -649,14 +661,19 @@ pub(crate) mod tests { #[test] fn empty_function_body_nonempty_return() { - let prog_text = r#"fn my_true() -> bool { + let prog_text = format!( + "#![compiler_version(\"{}\")]\n{}", + env!("CARGO_PKG_VERSION"), + r#" +fn my_true() -> bool { // function body is empty, although function must return `bool` } fn main() { assert!(my_true()); } -"#; +"# + ); match SatisfiedProgram::new( prog_text, Arguments::default(), @@ -860,4 +877,80 @@ fn main() { regression_test("transfer_with_timeout"); } } + + #[test] + fn test_compiler_version_missing() { + let missing = "fn main() {}"; + let err = TemplateProgram::new(missing).unwrap_err(); + assert!(err.contains("Missing compiler version")); + } + + #[test] + fn test_compiler_version_exact_match() { + let exact = format!( + "#![compiler_version(\"{}\")]\nfn main() {{}}", + env!("CARGO_PKG_VERSION") + ); + assert!(TemplateProgram::new(exact.as_str()).is_ok()); + } + + #[test] + fn test_compiler_version_mismatch_too_old() { + // We require 99.99.99, meaning the current compiler is TOO OLD + let too_old = "#![compiler_version(\">= 99.99.99\")]\nfn main() {}"; + let err = TemplateProgram::new(too_old).unwrap_err(); + assert!( + err.contains("Compiler too old"), + "Expected 'Compiler too old', got: {}", + err + ); + } + + #[test] + fn test_compiler_version_contract_too_old() { + // We strictly require an ancient version, meaning the contract is TOO OLD for this compiler + let contract_too_old = "#![compiler_version(\"< 0.0.1\")]\nfn main() {}"; + let err = TemplateProgram::new(contract_too_old).unwrap_err(); + assert!( + err.contains("Contract too old"), + "Expected 'Contract too old', got: {}", + err + ); + } + + #[test] + fn test_compiler_version_exact_mismatch() { + let exact_mismatch = "#![compiler_version(\"= 0.0.1\")]\nfn main() {}"; + let err = TemplateProgram::new(exact_mismatch).unwrap_err(); + assert!( + err.contains("Exact version mismatch"), + "Expected 'Exact version mismatch', got: {}", + err + ); + } + + #[test] + fn test_compiler_version_operator_caret() { + let caret = format!( + "#![compiler_version(\"^{}\")]\nfn main() {{}}", + env!("CARGO_PKG_VERSION") + ); + assert!(TemplateProgram::new(caret.as_str()).is_ok()); + } + + #[test] + fn test_compiler_version_operator_gte() { + let gte = format!( + "#![compiler_version(\">={}\")]\nfn main() {{}}", + env!("CARGO_PKG_VERSION") + ); + assert!(TemplateProgram::new(gte.as_str()).is_ok()); + } + + #[test] + fn test_compiler_version_syntax_garbage_version() { + let garbage = "#![compiler_version(\"i-love-rust\")]\nfn main() {}"; + let err = TemplateProgram::new(garbage).unwrap_err(); + assert!(err.contains("Invalid version syntax")); + } } diff --git a/src/parse.rs b/src/parse.rs index c42c6f3d..03f69224 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -31,18 +31,27 @@ use crate::types::{AliasedType, BuiltinAlias, TypeConstructible}; /// A program is a sequence of items. #[derive(Clone, Debug)] pub struct Program { + version: Option<(String, Span)>, items: Arc<[Item]>, span: Span, } impl Program { + pub fn version(&self) -> Option<&str> { + self.version.as_ref().map(|(v, _)| v.as_str()) + } + + pub fn version_span(&self) -> Option { + self.version.as_ref().map(|(_, s)| *s) + } + /// Access the items of the program. pub fn items(&self) -> &[Item] { &self.items } } -impl_eq_hash!(Program; items); +impl_eq_hash!(Program; version, items); /// An item is a component of a program. #[derive(Clone, Debug, Eq, PartialEq, Hash)] @@ -544,6 +553,9 @@ impl ModuleAssignment { impl fmt::Display for Program { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if let Some(version) = &self.version() { + writeln!(f, "#![compiler_version(\"{}\")]\n", version)?; + } for item in self.items() { writeln!(f, "{item}")?; } @@ -1135,20 +1147,37 @@ impl ChumskyParse for Program { where I: ValueInput<'tokens, Token = Token<'src>, Span = Span>, { + // Parses: # ! [ compiler_version ( "..." ) ] + let compiler_version_attr = just(Token::Hash) + .ignore_then(just(Token::Bang)) + .ignore_then(just(Token::LBracket)) + .ignore_then(just(Token::Ident("compiler_version"))) + .ignore_then(just(Token::LParen)) + .ignore_then(select! { Token::StringLiteral(s) => s.to_string() }) + .then_ignore(just(Token::RParen)) + .then_ignore(just(Token::RBracket)) + .map_with(|version, e| (version, e.span())) + .or_not() // Making it optional, just like we agreed! + .labelled("compiler version attribute"); + let skip_until_next_item = any() .then( any() .filter(|t| !matches!(t, Token::Fn | Token::Type | Token::Mod)) .repeated(), ) - // map to empty module .map_with(|_, _| Item::Module); - Item::parser() - .recover_with(via_parser(skip_until_next_item)) - .repeated() - .collect::>() - .map_with(|items, e| Program { + // Combine the attribute and the items + compiler_version_attr + .then( + Item::parser() + .recover_with(via_parser(skip_until_next_item)) + .repeated() + .collect::>(), + ) + .map_with(|(version, items), e| Program { + version, items: Arc::from(items), span: e.span(), }) @@ -1935,6 +1964,7 @@ impl<'a> arbitrary::Arbitrary<'a> for Program { .map(|_| Item::arbitrary(u)) .collect::>>()?; Ok(Self { + version: Some(("0.4.1".to_string(), Span::DUMMY)), items, span: Span::DUMMY, }) diff --git a/src/tracker.rs b/src/tracker.rs index 4a6f693a..c41931a3 100644 --- a/src/tracker.rs +++ b/src/tracker.rs @@ -472,7 +472,12 @@ mod tests { #[test] fn test_debug_and_jet_tracing() { - let program = TemplateProgram::new(TEST_PROGRAM).unwrap(); + let program_text = format!( + "#![compiler_version(\"{}\")]\n{}", + env!("CARGO_PKG_VERSION"), + TEST_PROGRAM + ); + let program = TemplateProgram::new(program_text.as_str()).unwrap(); let program = program.instantiate(Arguments::default(), true).unwrap(); let satisfied = program.satisfy(WitnessValues::default()).unwrap(); @@ -541,7 +546,12 @@ mod tests { fn test_arith_jet_trace_regression() { let env = create_test_env(); - let program = TemplateProgram::new(TEST_ARITHMETIC_JETS).unwrap(); + let program_text = format!( + "#![compiler_version(\"{}\")]\n{}", + env!("CARGO_PKG_VERSION"), + TEST_ARITHMETIC_JETS + ); + let program = TemplateProgram::new(program_text.as_str()).unwrap(); let program = program.instantiate(Arguments::default(), true).unwrap(); let satisfied = program.satisfy(WitnessValues::default()).unwrap(); diff --git a/src/witness.rs b/src/witness.rs index 6d6ffefc..24137799 100644 --- a/src/witness.rs +++ b/src/witness.rs @@ -226,10 +226,14 @@ mod tests { #[test] fn witness_reuse() { - let s = r#"fn main() { + let s = format!( + "#![compiler_version(\"{}\")]\n{}", + env!("CARGO_PKG_VERSION"), + r#"fn main() { assert!(jet::eq_32(witness::A, witness::A)); -}"#; - let program = parse::Program::parse_from_str(s).expect("parsing works"); +}"# + ); + let program = parse::Program::parse_from_str(&s).expect("parsing works"); match ast::Program::analyze(&program).map_err(Error::from) { Ok(_) => panic!("Witness reuse was falsely accepted"), Err(Error::WitnessReused(..)) => {} @@ -239,9 +243,13 @@ mod tests { #[test] fn witness_type_mismatch() { - let s = r#"fn main() { + let s = format!( + "#![compiler_version(\"{}\")]\n{}", + env!("CARGO_PKG_VERSION"), + r#"fn main() { assert!(jet::is_zero_32(witness::A)); -}"#; +}"# + ); let witness = WitnessValues::from(HashMap::from([( WitnessName::from_str_unchecked("A"), @@ -258,13 +266,17 @@ mod tests { #[test] fn witness_outside_main() { - let s = r#"fn f() -> u32 { + let s = format!( + "#![compiler_version(\"{}\")]\n{}", + env!("CARGO_PKG_VERSION"), + r#"fn f() -> u32 { witness::OUTPUT_OF_F } fn main() { assert!(jet::is_zero_32(f())); -}"#; +}"# + ); match CompiledProgram::new(s, Arguments::default(), false) { Ok(_) => panic!("Witness outside main was falsely accepted"), diff --git a/test_exact_download.simf b/test_exact_download.simf new file mode 100644 index 00000000..8881df8c --- /dev/null +++ b/test_exact_download.simf @@ -0,0 +1,2 @@ +#![compiler_version("0.4.0")] +fn main() {} diff --git a/test_floating_download.simf b/test_floating_download.simf new file mode 100644 index 00000000..5a836f7e --- /dev/null +++ b/test_floating_download.simf @@ -0,0 +1,2 @@ +#![compiler_version(">= 0.4.0")] +fn main() {} diff --git a/test_missing_download.simf b/test_missing_download.simf new file mode 100644 index 00000000..f328e4d9 --- /dev/null +++ b/test_missing_download.simf @@ -0,0 +1 @@ +fn main() {} diff --git a/update_examples.py b/update_examples.py new file mode 100644 index 00000000..8ebdcaf4 --- /dev/null +++ b/update_examples.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +import os +import re +import sys + +if len(sys.argv) < 2: + print("Usage: python3 update_examples.py ") + sys.exit(1) + +new_version = sys.argv[1] +examples_dir = 'examples' + +new_pattern = r'#!\[compiler_version\("[^"]*"\)\]' +old_pattern = r'pragma version[^;]*;' +new_syntax = f'#![compiler_version("{new_version}")]' + +for root, _, files in os.walk(examples_dir): + for file in files: + if file.endswith('.simf'): + filepath = os.path.join(root, file) + with open(filepath, 'r') as f: + content = f.read() + + # 1. Check if the NEW attribute syntax already exists and update it + if re.search(new_pattern, content): + updated = re.sub(new_pattern, new_syntax, content) + + # 2. Check if the OLD pragma syntax exists and automatically migrate it! + elif re.search(old_pattern, content): + updated = re.sub(old_pattern, new_syntax, content) + + # 3. Neither exists, so add the new syntax to the very top + else: + updated = f"{new_syntax}\n\n" + content + + with open(filepath, 'w') as f: + f.write(updated) + +print(f"Successfully updated all examples to use {new_syntax}") \ No newline at end of file