diff --git a/Cargo.lock b/Cargo.lock index 8b9ca06..091ed24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -42,16 +42,16 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.11", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", @@ -100,9 +100,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "ark-bls12-377" @@ -383,9 +383,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.6" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79fed4cdb43e993fcdadc7e58a09fd0e3e649c4436fa11da71c9f1f3ee7feb9" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "bigdecimal" @@ -542,7 +542,7 @@ dependencies = [ [[package]] name = "blockifier" version = "0.1.0-rc2" -source = "git+https://github.com/keep-starknet-strange/blockifier?branch=no_std-support-7578442#8270582205fb7c2fb81b7e2de1dc46cd9b483d83" +source = "git+https://github.com/keep-starknet-strange/blockifier?branch=no_std-support-7578442#e7a85edd7078eb25f3f56d82d45be56d617ccc85" dependencies = [ "ark-ff", "ark-secp256k1", @@ -571,7 +571,7 @@ dependencies = [ "sha3", "sp-arithmetic", "spin 0.9.8", - "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", + "starknet-crypto", "starknet_api", "strum", "strum_macros", @@ -786,7 +786,7 @@ dependencies = [ "serde_json", "sha2 0.10.8", "sha3", - "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-crypto", "thiserror-no-std", ] @@ -830,9 +830,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.7.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" dependencies = [ "glob", "libc", @@ -920,9 +920,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -1051,9 +1051,9 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "deranged" -version = "0.3.11" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" dependencies = [ "powerfmt", "serde", @@ -1331,9 +1331,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -1346,9 +1346,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -1356,15 +1356,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -1374,15 +1374,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", @@ -1391,15 +1391,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-timer" @@ -1409,9 +1409,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -1457,9 +1457,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "js-sys", @@ -1549,7 +1549,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.6", ] [[package]] @@ -1558,7 +1558,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.7", + "ahash 0.8.6", "allocator-api2", "serde", ] @@ -1682,9 +1682,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1911,18 +1911,18 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "libloading" -version = "0.8.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "winapi", ] [[package]] @@ -2000,9 +2000,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.14" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "295c17e837573c8c821dbaeb3cceb3d745ad082f7572191409e69cbc1b3fd050" +checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" dependencies = [ "cc", "pkg-config", @@ -2076,9 +2076,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memfd" @@ -2186,7 +2186,7 @@ dependencies = [ "mp-felt", "mp-hashers", "mp-transactions", - "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-crypto", "starknet_api", ] @@ -2214,7 +2214,7 @@ dependencies = [ "scale-info", "serde", "sp-core", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-ff", "starknet_api", "thiserror-no-std", ] @@ -2229,7 +2229,7 @@ dependencies = [ "scale-info", "serde", "starknet-core", - "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-crypto", ] [[package]] @@ -2260,8 +2260,8 @@ dependencies = [ "serde", "serde_json", "starknet-core", - "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-crypto", + "starknet-ff", "starknet_api", ] @@ -2726,9 +2726,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.28" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "portable-atomic" @@ -2759,9 +2759,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "prettyplease" -version = "0.2.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", "syn 2.0.48", @@ -2913,7 +2913,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.11", ] [[package]] @@ -2936,18 +2936,18 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.22" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" +checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.22" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" +checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", @@ -3010,7 +3010,7 @@ version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ - "base64 0.21.6", + "base64 0.21.5", "bytes", "encoding_rs", "futures-core", @@ -3307,9 +3307,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.21" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" @@ -3333,9 +3333,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -3386,7 +3386,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" dependencies = [ - "base64 0.21.6", + "base64 0.21.5", "chrono", "hex", "indexmap 1.9.3", @@ -3695,9 +3695,9 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "ss58-registry" -version = "1.45.0" +version = "1.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0c74081753a8ce1c8eb10b9f262ab6f7017e5ad3317c17a54c7ab65fcb3c6e" +checksum = "35935738370302d5e33963665b77541e4b990a3e919ec904c837a56cfc891de1" dependencies = [ "Inflector", "num-format", @@ -3719,7 +3719,7 @@ name = "starknet-core" version = "0.7.2" source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22#a35ce22be52bf33b8e544d0df926031b0ec7d761" dependencies = [ - "base64 0.21.6", + "base64 0.21.5", "flate2", "hex", "serde", @@ -3727,26 +3727,8 @@ dependencies = [ "serde_json_pythonic", "serde_with 2.3.3", "sha3", - "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", -] - -[[package]] -name = "starknet-crypto" -version = "0.6.1" -source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" -dependencies = [ - "crypto-bigint", - "hmac 0.12.1", - "num-bigint", - "num-integer", - "num-traits", - "rfc6979", - "sha2 0.10.8", - "starknet-crypto-codegen 0.3.2 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", - "starknet-curve 0.4.0 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", - "zeroize", + "starknet-crypto", + "starknet-ff", ] [[package]] @@ -3762,57 +3744,28 @@ dependencies = [ "num-traits", "rfc6979", "sha2 0.10.8", - "starknet-crypto-codegen 0.3.2 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", - "starknet-curve 0.4.0 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-crypto-codegen", + "starknet-curve", + "starknet-ff", "zeroize", ] -[[package]] -name = "starknet-crypto-codegen" -version = "0.3.2" -source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" -dependencies = [ - "starknet-curve 0.4.0 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", - "syn 2.0.48", -] - [[package]] name = "starknet-crypto-codegen" version = "0.3.2" source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22#a35ce22be52bf33b8e544d0df926031b0ec7d761" dependencies = [ - "starknet-curve 0.4.0 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", + "starknet-curve", + "starknet-ff", "syn 2.0.48", ] -[[package]] -name = "starknet-curve" -version = "0.4.0" -source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" -dependencies = [ - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", -] - [[package]] name = "starknet-curve" version = "0.4.0" source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22#a35ce22be52bf33b8e544d0df926031b0ec7d761" dependencies = [ - "starknet-ff 0.3.5 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=a35ce22)", -] - -[[package]] -name = "starknet-ff" -version = "0.3.5" -source = "git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36#64ebc364c0c346e81b715c5b4a3b32ef37b055c8" -dependencies = [ - "ark-ff", - "crypto-bigint", - "getrandom 0.2.12", - "hex", + "starknet-ff", ] [[package]] @@ -3823,7 +3776,7 @@ dependencies = [ "ark-ff", "bigdecimal", "crypto-bigint", - "getrandom 0.2.12", + "getrandom 0.2.11", "hex", "serde", ] @@ -3871,7 +3824,7 @@ dependencies = [ [[package]] name = "starknet_api" version = "0.4.1" -source = "git+https://github.com/keep-starknet-strange/starknet-api?branch=no_std-support-dc83f05#3415c832bb0cd72d1764dcd9ce803ddf932895ef" +source = "git+https://github.com/keep-starknet-strange/starknet-api?branch=no_std-support-dc83f05#60e13594b5d3560ad3a6439c5dc6807e5f425866" dependencies = [ "cairo-lang-casm-contract-class", "derive_more", @@ -3884,7 +3837,7 @@ dependencies = [ "scale-info", "serde", "serde_json", - "starknet-crypto 0.6.1 (git+https://github.com/xJonathanLEI/starknet-rs.git?rev=64ebc36)", + "starknet-crypto", "thiserror-no-std", ] @@ -3989,37 +3942,37 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.13" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "tempfile" -version = "3.9.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand", "redox_syscall", "rustix 0.38.28", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", @@ -4058,9 +4011,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ "deranged", "itoa", @@ -4080,9 +4033,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -4674,11 +4627,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.52.0" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.48.5", ] [[package]] @@ -4881,9 +4834,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.33" +version = "0.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7520bbdec7211caa7c4e682eb1fbe07abe20cee6756b6e00f537c82c11816aa" +checksum = "b67b5f0a4e7a27a64c651977932b9dc5667ca7fc31ac44b03ed37a0cf42fdfff" dependencies = [ "memchr", ] @@ -4909,18 +4862,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "306dca4455518f1f31635ec308b6b3e4eb1b11758cefafc782827d0aa7acb5c7" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "be912bf68235a88fbefd1b73415cb218405958d1655b2ece9035a19920bdf6ba" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 8085c01..736449a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,39 +11,38 @@ std = ["parity-scale-codec/std", "bitvec/std", "starknet-types-core/std"] [dependencies] bitvec = { version = "1", default-features = false, features = ["alloc"] } derive_more = { version = "0.99.17", default-features = false, features = [ - "constructor", + "constructor", ] } hashbrown = { version = "0.14.3", default-features = false, features = [ - "ahash", + "ahash", ] } log = "0.4.20" parity-scale-codec = { version = "3.0.0", default-features = false, features = [ - "derive", + "derive", ] } rocksdb = { optional = true, version = "0.21.0", features = [ - "multi-threaded-cf", + "multi-threaded-cf", ] } serde = { version = "1.0.195", default-features = false, features = [ - "derive", - "alloc", + "derive", + "alloc", ] } starknet-types-core = { version = "0.0.7", default-features = false, features = [ - "hash", - "parity-scale-codec", + "hash", + "parity-scale-codec", ] } [dev-dependencies] -log = "0.4.20" mp-commitments = { git = "https://github.com/keep-starknet-strange/madara.git", rev = "f30acea8af7e28e956e771928130e12bfc084832", package = "mp-commitments" } mp-felt = { git = "https://github.com/keep-starknet-strange/madara.git", rev = "f30acea8af7e28e956e771928130e12bfc084832", package = "mp-felt", features = [ - "parity-scale-codec", - "serde", + "parity-scale-codec", + "serde", ] } mp-hashers = { git = "https://github.com/keep-starknet-strange/madara.git", rev = "f30acea8af7e28e956e771928130e12bfc084832", package = "mp-hashers" } -pathfinder-merkle-tree = { git = "https://github.com/massalabs/pathfinder.git", package = "pathfinder-merkle-tree", rev = "b7b6d76a76ab0e10f92e5f84ce099b5f727cb4db" } pathfinder-common = { git = "https://github.com/massalabs/pathfinder.git", package = "pathfinder-common", rev = "b7b6d76a76ab0e10f92e5f84ce099b5f727cb4db" } pathfinder-crypto = { git = "https://github.com/massalabs/pathfinder.git", package = "pathfinder-crypto", rev = "b7b6d76a76ab0e10f92e5f84ce099b5f727cb4db" } +pathfinder-merkle-tree = { git = "https://github.com/massalabs/pathfinder.git", package = "pathfinder-merkle-tree", rev = "b7b6d76a76ab0e10f92e5f84ce099b5f727cb4db" } pathfinder-storage = { git = "https://github.com/massalabs/pathfinder.git", package = "pathfinder-storage", rev = "b7b6d76a76ab0e10f92e5f84ce099b5f727cb4db" } rand = "0.8.5" tempfile = "3.8.0" diff --git a/ensure_no_std/Cargo.lock b/ensure_no_std/Cargo.lock index c273b59..d0eb289 100644 --- a/ensure_no_std/Cargo.lock +++ b/ensure_no_std/Cargo.lock @@ -57,7 +57,6 @@ dependencies = [ "log", "parity-scale-codec", "serde", - "serde_derive", "starknet-types-core", ] diff --git a/src/lib.rs b/src/lib.rs index 7a9fe5d..5e9e4d7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -92,7 +92,10 @@ use bonsai_database::BonsaiPersistentDatabase; use bonsai_database::KeyType; use changes::ChangeBatch; use key_value_db::KeyValueDB; -use starknet_types_core::{felt::Felt, hash::StarkHash}; +use starknet_types_core::{ + felt::Felt, + hash::{Pedersen, StarkHash}, +}; use trie::merkle_tree::MerkleTree; mod changes; @@ -320,12 +323,12 @@ where /// Verifies a merkle-proof for a given `key` and `value`. pub fn verify_proof( - root: Felt252Wrapper, + root: Felt, key: &BitSlice, - value: Felt252Wrapper, + value: Felt, proofs: &[ProofNode], ) -> Option { - MerkleTree::::verify_proof(root, key, value, proofs) + MerkleTree::::verify_proof(root, key, value, proofs) } } diff --git a/src/tests/proof.rs b/src/tests/proof.rs index 48a5dbb..fd09027 100644 --- a/src/tests/proof.rs +++ b/src/tests/proof.rs @@ -1,12 +1,12 @@ use std::collections::HashMap; use bitvec::vec::BitVec; -use mp_felt::Felt252Wrapper; use pathfinder_common::{hash::PedersenHash, trie::TrieNode}; -use pathfinder_crypto::Felt; +use pathfinder_crypto::Felt as PathfinderFelt; use pathfinder_merkle_tree::tree::{MerkleTree, TestStorage}; use pathfinder_storage::{Node, StoredNode}; use rand::Rng; +use starknet_types_core::{felt::Felt, hash::Pedersen}; use crate::{ databases::{create_rocks_db, RocksDB, RocksDBConfig}, @@ -19,11 +19,11 @@ use crate::{ fn commit_and_persist( tree: MerkleTree, storage: &mut TestStorage, -) -> (Felt, u64) { +) -> (PathfinderFelt, u64) { use pathfinder_storage::Child; for (key, value) in &tree.leaves { - let key = Felt::from_bits(key).unwrap(); + let key = PathfinderFelt::from_bits(key).unwrap(); storage.leaves.insert(key, *value); } @@ -88,10 +88,10 @@ fn assert_eq_proof(bonsai_proof: &[ProofNode], pathfinder_proof: &[TrieNode]) { }, ) => { let pathfinder_left_bits = pathfinder_left.to_hex_str(); - let pathfinder_felt = Felt252Wrapper::from_hex_be(&pathfinder_left_bits).unwrap(); + let pathfinder_felt = Felt::from_hex(&pathfinder_left_bits).unwrap(); assert_eq!(left, &pathfinder_felt); let pathfinder_right_bits = pathfinder_right.to_hex_str(); - let pathfinder_felt = Felt252Wrapper::from_hex_be(&pathfinder_right_bits).unwrap(); + let pathfinder_felt = Felt::from_hex(&pathfinder_right_bits).unwrap(); assert_eq!(right, &pathfinder_felt); } ( @@ -102,7 +102,7 @@ fn assert_eq_proof(bonsai_proof: &[ProofNode], pathfinder_proof: &[TrieNode]) { }, ) => { let pathfinder_child_bits = pathfinder_child.to_hex_str(); - let pathfinder_felt = Felt252Wrapper::from_hex_be(&pathfinder_child_bits).unwrap(); + let pathfinder_felt = Felt::from_hex(&pathfinder_child_bits).unwrap(); assert_eq!(child, &pathfinder_felt); assert_eq!(&path.0, pathfinder_path); } @@ -118,13 +118,14 @@ fn basic_proof() { let config = BonsaiStorageConfig::default(); let mut storage = pathfinder_merkle_tree::tree::TestStorage::default(); let mut bonsai_storage = - BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config).unwrap(); + BonsaiStorage::<_, _, Pedersen>::new(RocksDB::new(&db, RocksDBConfig::default()), config) + .unwrap(); let mut pathfinder_merkle_tree: MerkleTree = pathfinder_merkle_tree::tree::MerkleTree::empty(); let mut id_builder = BasicIdBuilder::new(); let pair1 = ( vec![1, 2, 1], - Felt252Wrapper::from_hex_be("0x66342762FDD54D033c195fec3ce2568b62052e").unwrap(), + Felt::from_hex("0x66342762FDD54D033c195fec3ce2568b62052e").unwrap(), ); let bitvec = BitVec::from_vec(pair1.0.clone()); bonsai_storage.insert(&bitvec, &pair1.1).unwrap(); @@ -132,12 +133,12 @@ fn basic_proof() { .set( &storage, bitvec, - Felt::from_hex_str("0x66342762FDD54D033c195fec3ce2568b62052e").unwrap(), + PathfinderFelt::from_hex_str("0x66342762FDD54D033c195fec3ce2568b62052e").unwrap(), ) .unwrap(); let pair2 = ( vec![1, 2, 2], - Felt252Wrapper::from_hex_be("0x66342762FD54D033c195fec3ce2568b62052e").unwrap(), + Felt::from_hex("0x66342762FD54D033c195fec3ce2568b62052e").unwrap(), ); let bitvec = BitVec::from_vec(pair2.0.clone()); bonsai_storage.insert(&bitvec, &pair2.1).unwrap(); @@ -145,12 +146,12 @@ fn basic_proof() { .set( &storage, bitvec, - Felt::from_hex_str("0x66342762FD54D033c195fec3ce2568b62052e").unwrap(), + PathfinderFelt::from_hex_str("0x66342762FD54D033c195fec3ce2568b62052e").unwrap(), ) .unwrap(); let pair3 = ( vec![1, 2, 3], - Felt252Wrapper::from_hex_be("0x66342762FD54D033c195fec3ce2568b62052e").unwrap(), + Felt::from_hex("0x66342762FD54D033c195fec3ce2568b62052e").unwrap(), ); let bitvec = BitVec::from_vec(pair3.0.clone()); bonsai_storage.insert(&bitvec, &pair3.1).unwrap(); @@ -158,7 +159,7 @@ fn basic_proof() { .set( &storage, bitvec, - Felt::from_hex_str("0x66342762FD54D033c195fec3ce2568b62052e").unwrap(), + PathfinderFelt::from_hex_str("0x66342762FD54D033c195fec3ce2568b62052e").unwrap(), ) .unwrap(); bonsai_storage.commit(id_builder.new_id()).unwrap(); @@ -175,7 +176,7 @@ fn basic_proof() { .unwrap(); assert_eq_proof(&bonsai_proof, &pathfinder_proof); assert_eq!( - BonsaiStorage::>::verify_proof( + BonsaiStorage::, Pedersen>::verify_proof( bonsai_storage.root_hash().unwrap(), &BitVec::from_vec(vec![1, 2, 1]), pair1.1, @@ -192,7 +193,8 @@ fn multiple_proofs() { let config = BonsaiStorageConfig::default(); let mut storage = pathfinder_merkle_tree::tree::TestStorage::default(); let mut bonsai_storage = - BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config).unwrap(); + BonsaiStorage::<_, _, Pedersen>::new(RocksDB::new(&db, RocksDBConfig::default()), config) + .unwrap(); let mut pathfinder_merkle_tree: MerkleTree = pathfinder_merkle_tree::tree::MerkleTree::empty(); let mut id_builder = BasicIdBuilder::new(); @@ -206,8 +208,8 @@ fn multiple_proofs() { let random_byte: u8 = rng.gen(); element.push_str(&format!("{:02x}", random_byte)); } - let value = Felt252Wrapper::from_hex_be(&element).unwrap(); - let key = &value.0.to_bytes_be()[..31]; + let value = Felt::from_hex(&element).unwrap(); + let key = &value.to_bytes_be()[..31]; bonsai_storage .insert(&BitVec::from_vec(key.to_vec()), &value) .unwrap(); @@ -215,7 +217,7 @@ fn multiple_proofs() { .set( &storage, BitVec::from_vec(key.to_vec()), - Felt::from_hex_str(&element).unwrap(), + PathfinderFelt::from_hex_str(&element).unwrap(), ) .unwrap(); elements.push((key.to_vec(), value)); @@ -235,7 +237,7 @@ fn multiple_proofs() { .unwrap(); assert_eq_proof(&proof, &pathfinder_proof); assert_eq!( - BonsaiStorage::>::verify_proof( + BonsaiStorage::, Pedersen>::verify_proof( bonsai_storage.root_hash().unwrap(), &BitVec::from_vec(element.0.clone()), element.1, @@ -253,13 +255,14 @@ fn one_element_proof() { let config = BonsaiStorageConfig::default(); let mut storage = pathfinder_merkle_tree::tree::TestStorage::default(); let mut bonsai_storage = - BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config).unwrap(); + BonsaiStorage::<_, _, Pedersen>::new(RocksDB::new(&db, RocksDBConfig::default()), config) + .unwrap(); let mut pathfinder_merkle_tree: MerkleTree = pathfinder_merkle_tree::tree::MerkleTree::empty(); let mut id_builder = BasicIdBuilder::new(); let pair1 = ( vec![1, 2, 1], - Felt252Wrapper::from_hex_be("0x66342762FDD54D033c195fec3ce2568b62052e").unwrap(), + Felt::from_hex("0x66342762FDD54D033c195fec3ce2568b62052e").unwrap(), ); let bitvec = BitVec::from_vec(pair1.0.clone()); bonsai_storage.insert(&bitvec, &pair1.1).unwrap(); @@ -267,7 +270,7 @@ fn one_element_proof() { .set( &storage, bitvec, - Felt::from_hex_str("0x66342762FDD54D033c195fec3ce2568b62052e").unwrap(), + PathfinderFelt::from_hex_str("0x66342762FDD54D033c195fec3ce2568b62052e").unwrap(), ) .unwrap(); bonsai_storage.commit(id_builder.new_id()).unwrap(); @@ -284,7 +287,7 @@ fn one_element_proof() { .unwrap(); assert_eq_proof(&bonsai_proof, &pathfinder_proof); assert_eq!( - BonsaiStorage::>::verify_proof( + BonsaiStorage::, Pedersen>::verify_proof( bonsai_storage.root_hash().unwrap(), &BitVec::from_vec(vec![1, 2, 1]), pair1.1, @@ -300,7 +303,8 @@ fn zero_not_crashing() { let db = create_rocks_db(tempdir.path()).unwrap(); let config = BonsaiStorageConfig::default(); let mut bonsai_storage = - BonsaiStorage::new(RocksDB::new(&db, RocksDBConfig::default()), config).unwrap(); + BonsaiStorage::<_, _, Pedersen>::new(RocksDB::new(&db, RocksDBConfig::default()), config) + .unwrap(); let mut id_builder = BasicIdBuilder::new(); bonsai_storage.commit(id_builder.new_id()).unwrap(); bonsai_storage diff --git a/src/trie/merkle_tree.rs b/src/trie/merkle_tree.rs index 130155e..6145593 100644 --- a/src/trie/merkle_tree.rs +++ b/src/trie/merkle_tree.rs @@ -129,28 +129,22 @@ fn test_shared_path_encode_decode() { /// Each node hold only the minimum of data that need to be known for the proof: the child hashes (and path for edge node) #[derive(Debug, Clone, PartialEq)] pub enum ProofNode { - Binary { - left: Felt252Wrapper, - right: Felt252Wrapper, - }, - Edge { - child: Felt252Wrapper, - path: Path, - }, + Binary { left: Felt, right: Felt }, + Edge { child: Felt, path: Path }, } impl ProofNode { - pub fn hash(&self) -> Felt252Wrapper { + pub fn hash(&self) -> Felt { match self { - ProofNode::Binary { left, right } => Felt252Wrapper(H::hash_elements(left.0, right.0)), + ProofNode::Binary { left, right } => H::hash(left, right), ProofNode::Edge { child, path } => { let mut bytes = [0u8; 32]; bytes.view_bits_mut::()[256 - path.0.len()..].copy_from_bitslice(&path.0); // SAFETY: path len is <= 251 - let path_hash = Felt252Wrapper::try_from(&bytes).unwrap(); + let path_hash = Felt::from_bytes_be(&bytes); - let length = Felt252Wrapper::from(path.0.len() as u8); - Felt252Wrapper(H::hash_elements(child.0, path_hash.0) + length.0) + let length = Felt::from(path.0.len() as u8); + H::hash(child, &path_hash) + length } } } @@ -753,7 +747,7 @@ impl MerkleTree { /// The merkle proof and all the child nodes hashes. pub fn get_proof(&self, key: &BitSlice) -> Result, BonsaiStorageError> where - BonsaiStorageError: std::convert::From<::DatabaseError>, + BonsaiStorageError: core::convert::From<::DatabaseError>, { let mut nodes = Vec::with_capacity(251); let mut node = match self.root_handle { @@ -1092,9 +1086,9 @@ impl MerkleTree { /// 4. set expected_hash <- to the child hash /// 3. check that the expected_hash is `value` (we should've reached the leaf) pub fn verify_proof( - root: Felt252Wrapper, + root: Felt, key: &BitSlice, - value: Felt252Wrapper, + value: Felt, proofs: &[ProofNode], ) -> Option { // Protect from ill-formed keys @@ -1399,4 +1393,113 @@ mod tests { assert_eq!(bonsai_root_hash, felt_from_madara_felt(&madara_root_hash)); } } + + // #[test] // fn multiple_commits_tree_compare_with_deletes() { + // let mut rng = rand::thread_rng(); + // let mut madara_tree = StateCommitmentTree::::default(); + // let rocks_db = create_rocks_db(std::path::Path::new("test_db")).unwrap(); + // let mut db = RocksDB::new(&rocks_db, RocksDBConfig::default()); + // let mut bonsai_tree: super::MerkleTree = + // super::MerkleTree::empty(&mut db); + // let nb_commits = rng.gen_range(2..5); + // let mut elements_to_delete = vec![]; + // for _ in 0..nb_commits { + // let mut elements = vec![]; + // let tree_size = rng.gen_range(10..100); + // for _ in 0..tree_size { + // let mut element = String::from("0x"); + // let element_size = rng.gen_range(10..32); + // for _ in 0..element_size { + // let random_byte: u8 = rng.gen(); + // element.push_str(&format!("{:02x}", random_byte)); + // } + // if rng.gen_bool(0.1) { + // elements_to_delete.push(Felt252Wrapper::from_hex_be(&element).unwrap()); + // elements.push(Felt252Wrapper::from_hex_be(&element).unwrap()); + // } else { + // elements.push(Felt252Wrapper::from_hex_be(&element).unwrap()); + // } + // } + // elements.iter().for_each(|class_hash| { + // let final_hash = + // calculate_class_commitment_leaf_hash::(*class_hash); + // madara_tree.set(*class_hash, final_hash); + // let key = &class_hash.0.to_bytes_be()[..31]; + // bonsai_tree.set(&BitVec::from_vec(key.to_vec()), final_hash); + // }); + + // let bonsai_root_hash = bonsai_tree.commit(); + // let madara_root_hash = madara_tree.commit(); + // assert_eq!(bonsai_root_hash, madara_root_hash); + // } + // elements_to_delete.iter().for_each(|class_hash| { + // madara_tree.set(*class_hash, Felt252Wrapper::ZERO); + // let key = &class_hash.0.to_bytes_be()[..31]; + // bonsai_tree.set(&BitVec::from_vec(key.to_vec()), Felt252Wrapper::ZERO); + // }); + + // let bonsai_root_hash = bonsai_tree.commit(); + // let madara_root_hash = madara_tree.commit(); + // assert_eq!(bonsai_root_hash, madara_root_hash); + // } + + #[test] + fn test_proof() { + let tempdir = tempfile::tempdir().unwrap(); + let rocks_db = create_rocks_db(std::path::Path::new(tempdir.path())).unwrap(); + let rocks_db = RocksDB::new(&rocks_db, RocksDBConfig::default()); + let db = KeyValueDB::new(rocks_db, KeyValueDBConfig::default(), None); + let mut bonsai_tree: super::MerkleTree, BasicId> = + super::MerkleTree::new(db).unwrap(); + let elements = [ + [Felt252Wrapper::from_hex_be("0x665342762FDD54D0303c195fec3ce2568b62052e").unwrap()], + [Felt252Wrapper::from_hex_be("0x66342762FDD54D0303c195fec3ce2568b62052e").unwrap()], + [Felt252Wrapper::from_hex_be("0x66342762FDD54D033c195fec3ce2568b62052e").unwrap()], + ]; + for elem in elements { + elem.iter().for_each(|class_hash| { + let final_hash = + calculate_class_commitment_leaf_hash::(*class_hash); + let key = &class_hash.0.to_bytes_be()[..31]; + bonsai_tree + .set( + &BitVec::from_vec(key.to_vec()), + Felt::from_bytes_be(&final_hash.0.to_bytes_be()), + ) + .unwrap(); + }); + } + bonsai_tree.commit().unwrap(); + let bonsai_proof = bonsai_tree + .get_proof(&BitVec::from_vec( + elements[0][0].0.to_bytes_be()[..31].to_vec(), + )) + .unwrap(); + println!("bonsai_proof: {:?}", bonsai_proof); + } + + // test in madara + // #[test] + // fn test_proof() { + // let mut tree = super::merkle_patricia_tree::merkle_tree::MerkleTree::::empty(); + // let elements = [ + // [Felt252Wrapper::from_hex_be("0x665342762FDD54D0303c195fec3ce2568b62052e").unwrap()], + // [Felt252Wrapper::from_hex_be("0x66342762FDD54D0303c195fec3ce2568b62052e").unwrap()], + // [Felt252Wrapper::from_hex_be("0x66342762FDD54D033c195fec3ce2568b62052e").unwrap()], + // ]; + // for elem in elements { + // elem.iter().for_each(|class_hash| { + // let final_hash = + // calculate_class_commitment_leaf_hash::(*class_hash); + // let key = &class_hash.0.to_bytes_be()[..31]; + // tree + // .set(&BitVec::from_vec(key.to_vec()), final_hash) + // }); + // } + // tree.commit(); + // let bonsai_proof = tree.get_proof(&BitVec::from_vec( + // elements[0][0].0.to_bytes_be()[..31].to_vec(), + // )); + // println!("bonsai_proof: {:?}", bonsai_proof); + // } }