diff --git a/Cargo.lock b/Cargo.lock index 4f746447e3..66f7bfba07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,8 +20,8 @@ dependencies = [ "ahash 0.8.6", "aligned-sized", "anchor-lang", - "ark-ff", - "ark-serialize", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", "borsh 0.10.3", "bytemuck", "light-bounded-vec", @@ -47,7 +47,7 @@ dependencies = [ name = "account-compression-state" version = "0.1.0" dependencies = [ - "ark-ff", + "ark-ff 0.4.2", "light-concurrent-merkle-tree", "light-hasher", "light-indexed-merkle-tree", @@ -110,7 +110,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.10", "once_cell", "version_check", ] @@ -122,7 +122,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", - "getrandom 0.2.12", + "getrandom 0.2.10", "once_cell", "version_check", "zerocopy", @@ -149,7 +149,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -292,7 +292,7 @@ dependencies = [ "bincode", "borsh 0.10.3", "bytemuck", - "getrandom 0.2.12", + "getrandom 0.2.10", "solana-program", "thiserror", ] @@ -354,9 +354,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" dependencies = [ "anstyle", "anstyle-parse", @@ -368,9 +368,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" @@ -406,15 +406,36 @@ version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +[[package]] +name = "ark-bls12-381" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65be532f9dd1e98ad0150b037276cde464c6f371059e6dd02c0222395761f6aa" +dependencies = [ + "ark-ec 0.3.0", + "ark-ff 0.3.0", + "ark-std 0.3.0", +] + +[[package]] +name = "ark-bn254" +version = "0.3.0" +source = "git+https://github.com/Lightprotocol/curves?branch=release-0.3.0#7c901afc3ec80bf3eaea654237ffe73356f68c86" +dependencies = [ + "ark-ec 0.3.0", + "ark-ff 0.3.0", + "ark-std 0.3.0", +] + [[package]] name = "ark-bn254" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" dependencies = [ - "ark-ec", - "ark-ff", - "ark-std", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-std 0.4.0", ] [[package]] @@ -422,15 +443,15 @@ name = "ark-circom" version = "0.1.0" source = "git+https://github.com/Lightprotocol/circom-compat.git?branch=feat/multi-dimension-input#392265d6f7c01748b7ac8abb46f48575b41c34e0" dependencies = [ - "ark-bn254", - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-groth16", - "ark-poly", - "ark-relations", - "ark-serialize", - "ark-std", + "ark-bn254 0.4.0", + "ark-crypto-primitives 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-groth16 0.4.0", + "ark-poly 0.4.2", + "ark-relations 0.4.0", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "byteorder", "cfg-if", "color-eyre", @@ -444,35 +465,68 @@ dependencies = [ "wasmer", ] +[[package]] +name = "ark-crypto-primitives" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff773c0ef8c655c98071d3026a63950798a66b2f45baef22d8334c1756f1bd18" +dependencies = [ + "ark-ec 0.3.0", + "ark-ff 0.3.0", + "ark-nonnative-field", + "ark-r1cs-std", + "ark-relations 0.3.0", + "ark-serialize 0.3.0", + "ark-snark 0.3.0", + "ark-std 0.3.0", + "blake2 0.9.2", + "derivative", + "digest 0.9.0", + "tracing", +] + [[package]] name = "ark-crypto-primitives" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" dependencies = [ - "ark-ec", - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-snark", - "ark-std", - "blake2", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-relations 0.4.0", + "ark-serialize 0.4.2", + "ark-snark 0.4.0", + "ark-std 0.4.0", + "blake2 0.10.6", "derivative", "digest 0.10.7", "rayon", "sha2 0.10.8", ] +[[package]] +name = "ark-ec" +version = "0.3.0" +source = "git+https://github.com/Lightprotocol/algebra?branch=release-0.3.0#d45d741649114ab36dca7a88d08c044174f6b8b5" +dependencies = [ + "ark-ff 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-traits", + "zeroize", +] + [[package]] name = "ark-ec" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" dependencies = [ - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", + "ark-ff 0.4.2", + "ark-poly 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "hashbrown 0.13.2", "itertools", @@ -481,16 +535,59 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ark-ed-on-bls12-381" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b7ada17db3854f5994e74e60b18e10e818594935ee7e1d329800c117b32970" +dependencies = [ + "ark-bls12-381", + "ark-ec 0.3.0", + "ark-ff 0.3.0", + "ark-r1cs-std", + "ark-std 0.3.0", +] + +[[package]] +name = "ark-ed-on-bn254" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fdc786b806fdbff4abebb08ec2fcb50cfe3941918e57120ab121228452903fd" +dependencies = [ + "ark-bn254 0.3.0", + "ark-ec 0.3.0", + "ark-ff 0.3.0", + "ark-r1cs-std", + "ark-std 0.3.0", +] + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "git+https://github.com/Lightprotocol/algebra?branch=release-0.3.0#d45d741649114ab36dca7a88d08c044174f6b8b5" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint 0.4.4", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + [[package]] name = "ark-ff" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" dependencies = [ - "ark-ff-asm", - "ark-ff-macros", - "ark-serialize", - "ark-std", + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "digest 0.10.7", "itertools", @@ -498,10 +595,19 @@ dependencies = [ "num-traits", "paste", "rayon", - "rustc_version", + "rustc_version 0.4.0", "zeroize", ] +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "git+https://github.com/Lightprotocol/algebra?branch=release-0.3.0#d45d741649114ab36dca7a88d08c044174f6b8b5" +dependencies = [ + "quote", + "syn 1.0.109", +] + [[package]] name = "ark-ff-asm" version = "0.4.2" @@ -512,6 +618,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "git+https://github.com/Lightprotocol/algebra?branch=release-0.3.0#d45d741649114ab36dca7a88d08c044174f6b8b5" +dependencies = [ + "num-bigint 0.4.4", + "num-traits", + "quote", + "syn 1.0.109", +] + [[package]] name = "ark-ff-macros" version = "0.4.2" @@ -525,60 +642,187 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-groth16" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f8fff7468e947130b5caf9bdd27de8b913cf30e15104b4f0cd301726b3d897" +dependencies = [ + "ark-crypto-primitives 0.3.0", + "ark-ec 0.3.0", + "ark-ff 0.3.0", + "ark-poly 0.3.0", + "ark-relations 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", +] + [[package]] name = "ark-groth16" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" dependencies = [ - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-poly", - "ark-relations", - "ark-serialize", - "ark-std", + "ark-crypto-primitives 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-poly 0.4.2", + "ark-relations 0.4.0", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "rayon", ] +[[package]] +name = "ark-marlin" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caa8510faa8e64f0a6841ee4b58efe2d56f7a80d86fa0ce9891bbb3aa20166d9" +dependencies = [ + "ark-ff 0.3.0", + "ark-poly 0.3.0", + "ark-poly-commit", + "ark-relations 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "digest 0.9.0", + "rand_chacha 0.3.1", +] + +[[package]] +name = "ark-nonnative-field" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "440ad4569974910adbeb84422b7e622b79e08d27142afd113785b7fcfb446186" +dependencies = [ + "ark-ec 0.3.0", + "ark-ff 0.3.0", + "ark-r1cs-std", + "ark-relations 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint 0.4.4", + "num-integer", + "num-traits", + "tracing", +] + +[[package]] +name = "ark-poly" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0f78f47537c2f15706db7e98fe64cc1711dbf9def81218194e17239e53e5aa" +dependencies = [ + "ark-ff 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "hashbrown 0.11.2", +] + [[package]] name = "ark-poly" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" dependencies = [ - "ark-ff", - "ark-serialize", - "ark-std", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "hashbrown 0.13.2", "rayon", ] +[[package]] +name = "ark-poly-commit" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a71ddfa72bad1446cab7bbecb6018dbbdc9abcbc3a0065483ae5186ad2a64dcd" +dependencies = [ + "ark-ec 0.3.0", + "ark-ff 0.3.0", + "ark-poly 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "digest 0.9.0", + "tracing", +] + +[[package]] +name = "ark-r1cs-std" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e8fdacb1931f238a0d866ced1e916a49d36de832fd8b83dc916b718ae72893" +dependencies = [ + "ark-ec 0.3.0", + "ark-ff 0.3.0", + "ark-relations 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint 0.4.4", + "num-traits", + "tracing", +] + +[[package]] +name = "ark-relations" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cba4c1c99792a6834bd97f7fd76578ec2cd58d2afc5139a17e1d1bec65b38f6" +dependencies = [ + "ark-ff 0.3.0", + "ark-std 0.3.0", + "tracing", + "tracing-subscriber 0.2.25", +] + [[package]] name = "ark-relations" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" dependencies = [ - "ark-ff", - "ark-std", + "ark-ff 0.4.2", + "ark-std 0.4.0", "tracing", "tracing-subscriber 0.2.25", ] +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "git+https://github.com/Lightprotocol/algebra?branch=release-0.3.0#d45d741649114ab36dca7a88d08c044174f6b8b5" +dependencies = [ + "ark-serialize-derive 0.3.0", + "ark-std 0.3.0", + "digest 0.9.0", +] + [[package]] name = "ark-serialize" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ - "ark-serialize-derive", - "ark-std", + "ark-serialize-derive 0.4.2", + "ark-std 0.4.0", "digest 0.10.7", "num-bigint 0.4.4", ] +[[package]] +name = "ark-serialize-derive" +version = "0.3.0" +source = "git+https://github.com/Lightprotocol/algebra?branch=release-0.3.0#d45d741649114ab36dca7a88d08c044174f6b8b5" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "ark-serialize-derive" version = "0.4.2" @@ -590,16 +834,37 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-snark" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc3dff1a5f67a9c0b34df32b079752d8dd17f1e9d06253da0453db6c1b7cc8a" +dependencies = [ + "ark-ff 0.3.0", + "ark-relations 0.3.0", + "ark-std 0.3.0", +] + [[package]] name = "ark-snark" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" dependencies = [ - "ark-ff", - "ark-relations", - "ark-serialize", - "ark-std", + "ark-ff 0.4.2", + "ark-relations 0.4.0", + "ark-serialize 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand 0.8.5", ] [[package]] @@ -613,6 +878,33 @@ dependencies = [ "rayon", ] +[[package]] +name = "arkworks-gadgets" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5e1a19f9135545de34eb3f3d061f8e5c4072aadd5f09c56d357647a66d509a" +dependencies = [ + "ark-bls12-381", + "ark-bn254 0.3.0", + "ark-crypto-primitives 0.3.0", + "ark-ec 0.3.0", + "ark-ed-on-bls12-381", + "ark-ed-on-bn254", + "ark-ff 0.3.0", + "ark-groth16 0.3.0", + "ark-marlin", + "ark-poly 0.3.0", + "ark-poly-commit", + "ark-r1cs-std", + "ark-relations 0.3.0", + "ark-serialize 0.3.0", + "ark-snark 0.3.0", + "ark-std 0.3.0", + "blake2 0.9.2", + "digest 0.9.0", + "paste", +] + [[package]] name = "arrayref" version = "0.3.7" @@ -718,7 +1010,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -822,6 +1114,17 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake2" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" +dependencies = [ + "crypto-mac", + "digest 0.9.0", + "opaque-debug", +] + [[package]] name = "blake2" version = "0.10.6" @@ -1053,9 +1356,9 @@ checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" [[package]] name = "bytemuck" -version = "1.14.3" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" +checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" dependencies = [ "bytemuck_derive", ] @@ -1068,7 +1371,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -1173,15 +1476,15 @@ dependencies = [ name = "circuitlib-rs" version = "0.1.0" dependencies = [ - "ark-bn254", + "ark-bn254 0.4.0", "ark-circom", - "ark-crypto-primitives", - "ark-ec", - "ark-ff", - "ark-groth16", - "ark-relations", - "ark-serialize", - "ark-std", + "ark-crypto-primitives 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-groth16 0.4.0", + "ark-relations 0.4.0", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "bytemuck", "color-eyre", "duct", @@ -1266,7 +1569,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -1660,7 +1963,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -1671,7 +1974,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -1807,7 +2110,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -1830,7 +2133,7 @@ checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -1956,7 +2259,7 @@ checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -1969,7 +2272,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -1990,7 +2293,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -2027,12 +2330,23 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480" dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", "libc", - "windows-sys 0.52.0", ] [[package]] @@ -2207,7 +2521,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -2276,9 +2590,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "js-sys", @@ -2330,10 +2644,10 @@ name = "groth16-solana" version = "0.0.2" source = "git+https://github.com/Lightprotocol/groth16-solana?branch=master#d1165a03aed6150576c38160797c9f9a1ae630a1" dependencies = [ - "ark-bn254", - "ark-ec", - "ark-ff", - "ark-serialize", + "ark-bn254 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", "solana-program", "thiserror", ] @@ -2343,10 +2657,10 @@ name = "groth16-solana" version = "0.0.2" source = "git+https://github.com/Lightprotocol/groth16-solana.git#d1165a03aed6150576c38160797c9f9a1ae630a1" dependencies = [ - "ark-bn254", - "ark-ec", - "ark-ff", - "ark-serialize", + "ark-bn254 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", "solana-program", "thiserror", ] @@ -2372,9 +2686,9 @@ dependencies = [ [[package]] name = "half" -version = "1.8.2" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" [[package]] name = "hash32" @@ -2422,8 +2736,8 @@ checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" name = "hasher" version = "0.1.0" dependencies = [ - "ark-bn254", - "ark-ff", + "ark-bn254 0.4.0", + "ark-ff 0.4.2", "blake2b_simd", "console_error_panic_hook", "hex", @@ -2728,13 +3042,13 @@ checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi 0.3.3", - "libc", - "windows-sys 0.52.0", + "rustix", + "windows-sys 0.48.0", ] [[package]] @@ -2822,17 +3136,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "libredox" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" -dependencies = [ - "bitflags 2.4.0", - "libc", - "redox_syscall 0.4.1", -] - [[package]] name = "libsecp256k1" version = "0.6.0" @@ -2911,8 +3214,8 @@ dependencies = [ name = "light-concurrent-merkle-tree" version = "0.1.0" dependencies = [ - "ark-bn254", - "ark-ff", + "ark-bn254 0.4.0", + "ark-ff 0.4.2", "bytemuck", "light-bounded-vec", "light-hasher", @@ -2930,7 +3233,7 @@ dependencies = [ name = "light-hasher" version = "0.1.0" dependencies = [ - "ark-bn254", + "ark-bn254 0.4.0", "light-poseidon 0.2.0", "sha2 0.10.8", "sha3 0.10.8", @@ -2942,8 +3245,8 @@ dependencies = [ name = "light-indexed-merkle-tree" version = "0.1.0" dependencies = [ - "ark-bn254", - "ark-ff", + "ark-bn254 0.4.0", + "ark-ff 0.4.2", "borsh 0.10.3", "light-bounded-vec", "light-concurrent-merkle-tree", @@ -2980,6 +3283,44 @@ dependencies = [ "thiserror", ] +[[package]] +name = "light-merkle-tree-program" +version = "0.3.1" +dependencies = [ + "ahash 0.8.6", + "aligned-sized", + "anchor-lang", + "anchor-spl", + "ark-bn254 0.3.0", + "ark-crypto-primitives 0.3.0", + "ark-ec 0.3.0", + "ark-ed-on-bn254", + "ark-ff 0.3.0", + "ark-groth16 0.3.0", + "ark-relations 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "arkworks-gadgets", + "arrayref", + "bincode", + "bytemuck", + "byteorder", + "getrandom 0.2.10", + "light-concurrent-merkle-tree", + "light-hasher", + "light-macros", + "light-merkle-tree-event", + "light-merkle-tree-reference", + "light-utils", + "serde_json", + "solana-program-test", + "solana-sdk", + "solana-security-txt", + "spl-account-compression", + "spl-concurrent-merkle-tree", + "spl-token 3.5.0", +] + [[package]] name = "light-merkle-tree-reference" version = "0.1.0" @@ -2995,8 +3336,8 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5b439809cdfc0d86ecc7317f1724df13dfa665df48991b79e90e689411451f7" dependencies = [ - "ark-bn254", - "ark-ff", + "ark-bn254 0.4.0", + "ark-ff 0.4.2", "thiserror", ] @@ -3006,8 +3347,8 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c9a85a9752c549ceb7578064b4ed891179d20acd85f27318573b64d2d7ee7ee" dependencies = [ - "ark-bn254", - "ark-ff", + "ark-bn254 0.4.0", + "ark-ff 0.4.2", "num-bigint 0.4.4", "thiserror", ] @@ -3019,7 +3360,7 @@ dependencies = [ "account-compression", "anchor-lang", "anyhow", - "ark-ff", + "ark-ff 0.4.2", "light", "light-macros", "rand 0.8.5", @@ -3044,18 +3385,36 @@ name = "light-utils" version = "0.1.0" dependencies = [ "anyhow", - "ark-bn254", - "ark-ff", + "ark-bn254 0.4.0", + "ark-ff 0.4.2", "rand 0.8.5", "solana-program", "thiserror", ] +[[package]] +name = "light-verifier-sdk" +version = "0.3.1" +dependencies = [ + "aligned-sized", + "anchor-lang", + "anchor-spl", + "ark-bn254 0.3.0", + "ark-ec 0.3.0", + "ark-ff 0.3.0", + "ark-std 0.3.0", + "groth16-solana 0.0.2 (git+https://github.com/Lightprotocol/groth16-solana?branch=master)", + "light-macros", + "light-merkle-tree-program", + "light-utils", + "spl-token 3.5.0", +] + [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" [[package]] name = "lock_api" @@ -3132,6 +3491,15 @@ dependencies = [ "libc", ] +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + [[package]] name = "memchr" version = "2.6.4" @@ -3218,9 +3586,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -3385,7 +3753,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -3500,7 +3868,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -3512,7 +3880,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -3571,9 +3939,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.63" +version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ "bitflags 2.4.0", "cfg-if", @@ -3592,7 +3960,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -3603,9 +3971,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.99" +version = "0.9.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" +checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" dependencies = [ "cc", "libc", @@ -3784,6 +4152,17 @@ dependencies = [ "num 0.2.1", ] +[[package]] +name = "pest" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + [[package]] name = "pin-project" version = "1.1.3" @@ -3801,7 +4180,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -3942,9 +4321,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -4041,7 +4420,7 @@ checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -4087,7 +4466,7 @@ checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ "bytes", "libc", - "socket2 0.5.5", + "socket2 0.5.6", "tracing", "windows-sys 0.48.0", ] @@ -4166,7 +4545,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.10", ] [[package]] @@ -4237,23 +4616,14 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.12", - "libredox", + "getrandom 0.2.10", + "redox_syscall 0.2.16", "thiserror", ] @@ -4299,14 +4669,14 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "region" -version = "3.0.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" dependencies = [ "bitflags 1.3.2", "libc", - "mach", - "winapi", + "mach2", + "windows-sys 0.52.0", ] [[package]] @@ -4320,9 +4690,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.26" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bf93c4af7a8bb7d879d51cebe797356ff10ae8516ace542b5182d9dcac10b2" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "async-compression", "base64 0.21.4", @@ -4441,13 +4811,22 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver", + "semver 1.0.19", ] [[package]] @@ -4461,15 +4840,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "f25469e9ae0f3d0047ca8b93fc56843f38e6774f0914a107ff8b41be8be8e0b7" dependencies = [ "bitflags 2.4.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -4568,7 +4947,7 @@ checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -4610,12 +4989,30 @@ dependencies = [ "libc", ] +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + [[package]] name = "semver" version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + [[package]] name = "serde" version = "1.0.197" @@ -4652,14 +5049,14 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ "itoa", "ryu", @@ -4697,7 +5094,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -4859,12 +5256,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4927,7 +5324,7 @@ dependencies = [ "rand 0.8.5", "rayon", "regex", - "rustc_version", + "rustc_version 0.4.0", "serde", "serde_derive", "solana-bucket-map", @@ -4961,7 +5358,7 @@ dependencies = [ "log", "num-derive 0.3.3", "num-traits", - "rustc_version", + "rustc_version 0.4.0", "serde", "solana-frozen-abi", "solana-frozen-abi-macro", @@ -5103,7 +5500,7 @@ dependencies = [ "humantime", "indicatif", "pretty-hex", - "semver", + "semver 1.0.19", "serde", "serde_json", "solana-account-decoder", @@ -5224,7 +5621,7 @@ checksum = "a3a196cec1784e85f3c470527bd32d9c2770beb36a96e63dd686d35890a5f092" dependencies = [ "lazy_static", "log", - "rustc_version", + "rustc_version 0.4.0", "solana-address-lookup-table-program", "solana-bpf-loader-program", "solana-compute-budget-program", @@ -5264,8 +5661,8 @@ dependencies = [ "num-derive 0.3.3", "num-traits", "num_enum 0.5.11", - "rustc_version", - "semver", + "rustc_version 0.4.0", + "semver 1.0.19", "serde", "serde_derive", "serde_json", @@ -5294,7 +5691,7 @@ dependencies = [ "lazy_static", "log", "memmap2", - "rustc_version", + "rustc_version 0.4.0", "serde", "serde_bytes", "serde_derive", @@ -5313,8 +5710,8 @@ checksum = "c28b7325d40b3b3fef0db6917972e8121bec05fa2b59904212b25478c85924cd" dependencies = [ "proc-macro2", "quote", - "rustc_version", - "syn 2.0.48", + "rustc_version 0.4.0", + "syn 2.0.55", ] [[package]] @@ -5380,7 +5777,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_derive", - "socket2 0.5.5", + "socket2 0.5.6", "solana-logger", "solana-sdk", "solana-version", @@ -5407,7 +5804,7 @@ dependencies = [ "nix", "rand 0.8.5", "rayon", - "rustc_version", + "rustc_version 0.4.0", "serde", "solana-frozen-abi", "solana-frozen-abi-macro", @@ -5423,10 +5820,10 @@ version = "1.17.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1fe4a811ec2c4b0c3773e5661ecfaff81f822c9e18866097caeba6be9338dab" dependencies = [ - "ark-bn254", - "ark-ec", - "ark-ff", - "ark-serialize", + "ark-bn254 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", "base64 0.21.4", "bincode", "bitflags 2.4.0", @@ -5440,7 +5837,7 @@ dependencies = [ "console_error_panic_hook", "console_log", "curve25519-dalek", - "getrandom 0.2.12", + "getrandom 0.2.10", "itertools", "js-sys", "lazy_static", @@ -5454,7 +5851,7 @@ dependencies = [ "num-traits", "parking_lot 0.12.1", "rand 0.8.5", - "rustc_version", + "rustc_version 0.4.0", "rustversion", "serde", "serde_bytes", @@ -5488,7 +5885,7 @@ dependencies = [ "num-traits", "percentage", "rand 0.8.5", - "rustc_version", + "rustc_version 0.4.0", "serde", "solana-frozen-abi", "solana-frozen-abi-macro", @@ -5539,7 +5936,7 @@ dependencies = [ "futures-util", "log", "reqwest", - "semver", + "semver 1.0.19", "serde", "serde_derive", "serde_json", @@ -5604,7 +6001,7 @@ dependencies = [ "num-traits", "parking_lot 0.12.1", "qstring", - "semver", + "semver 1.0.19", "solana-sdk", "thiserror", "uriparse", @@ -5623,7 +6020,7 @@ dependencies = [ "indicatif", "log", "reqwest", - "semver", + "semver 1.0.19", "serde", "serde_derive", "serde_json", @@ -5646,7 +6043,7 @@ dependencies = [ "bs58 0.4.0", "jsonrpc-core", "reqwest", - "semver", + "semver 1.0.19", "serde", "serde_derive", "serde_json", @@ -5710,7 +6107,7 @@ dependencies = [ "rand 0.8.5", "rayon", "regex", - "rustc_version", + "rustc_version 0.4.0", "serde", "serde_derive", "serde_json", @@ -5783,7 +6180,7 @@ dependencies = [ "qualifier_attr", "rand 0.7.3", "rand 0.8.5", - "rustc_version", + "rustc_version 0.4.0", "rustversion", "serde", "serde_bytes", @@ -5812,7 +6209,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -5845,7 +6242,7 @@ checksum = "7b2e33782ffd904081e6953e8d8e26ef6f23e4944ec6be223ec52ad76ffcee4c" dependencies = [ "bincode", "log", - "rustc_version", + "rustc_version 0.4.0", "solana-config-program", "solana-program-runtime", "solana-sdk", @@ -5984,8 +6381,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d49400028b385d830fde8ec073c372394197bb493236442670117516db4b4a1" dependencies = [ "log", - "rustc_version", - "semver", + "rustc_version 0.4.0", + "semver 1.0.19", "serde", "serde_derive", "solana-frozen-abi", @@ -6002,7 +6399,7 @@ dependencies = [ "crossbeam-channel", "itertools", "log", - "rustc_version", + "rustc_version 0.4.0", "serde", "serde_derive", "solana-frozen-abi", @@ -6022,7 +6419,7 @@ dependencies = [ "log", "num-derive 0.3.3", "num-traits", - "rustc_version", + "rustc_version 0.4.0", "serde", "serde_derive", "solana-frozen-abi", @@ -6170,7 +6567,7 @@ checksum = "07fd7858fc4ff8fb0e34090e41d7eb06a823e1057945c26d480bfc21d2338a93" dependencies = [ "quote", "spl-discriminator-syn", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -6182,7 +6579,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.8", - "syn 2.0.48", + "syn 2.0.55", "thiserror", ] @@ -6239,7 +6636,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.8", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -6422,9 +6819,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" dependencies = [ "proc-macro2", "quote", @@ -6513,9 +6910,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.13" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tarpc" @@ -6554,14 +6951,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", "fastrand", + "redox_syscall 0.3.5", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -6591,7 +6989,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -6602,7 +7000,7 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", "test-case-core", ] @@ -6638,7 +7036,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -6737,7 +7135,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2 0.5.6", "tokio-macros", "windows-sys 0.48.0", ] @@ -6750,7 +7148,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -6897,7 +7295,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -6986,6 +7384,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + [[package]] name = "unicode-bidi" version = "0.3.13" @@ -7046,9 +7450,9 @@ dependencies = [ [[package]] name = "unsafe-libyaml" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "untrusted" @@ -7091,9 +7495,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" [[package]] name = "valuable" @@ -7158,9 +7562,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -7168,16 +7572,16 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", "wasm-bindgen-shared", ] @@ -7195,9 +7599,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7205,28 +7609,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-encoder" -version = "0.41.2" +version = "0.202.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972f97a5d8318f908dded23594188a90bcd09365986b1163e66d70170e5287ae" +checksum = "bfd106365a7f5f7aa3c1916a98cbb3ad477f5ff96ddb130285a91c6e7429e67a" dependencies = [ "leb128", ] @@ -7470,9 +7874,9 @@ checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" [[package]] name = "wast" -version = "71.0.1" +version = "202.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "647c3ac4354da32688537e8fc4d2fe6c578df51896298cb64727d98088a1fd26" +checksum = "1fbcb11204515c953c9b42ede0a46a1c5e17f82af05c4fae201a8efff1b0f4fe" dependencies = [ "bumpalo", "leb128", @@ -7483,9 +7887,9 @@ dependencies = [ [[package]] name = "wat" -version = "1.0.88" +version = "1.202.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b69c36f634411568a2c6d24828b674961e37ea03340fe1d605c337ed8162d901" +checksum = "4de4b15a47135c56a3573406e9977b9518787a6154459b4842a9b9d3d1684848" dependencies = [ "wast", ] @@ -7870,12 +8274,13 @@ dependencies = [ "account-compression", "account-compression-state", "anyhow", - "ark-ff", + "ark-ff 0.4.2", "clap 4.4.11", "groth16-solana 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "light-concurrent-merkle-tree", "light-hasher", "light-indexed-merkle-tree", + "light-merkle-tree-program", "light-utils", "quote", "sha2 0.10.8", @@ -7908,7 +8313,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -7928,7 +8333,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.55", ] [[package]] @@ -7960,23 +8365,3 @@ dependencies = [ "libc", "pkg-config", ] - -[[patch.unused]] -name = "ark-bn254" -version = "0.3.0" -source = "git+https://github.com/Lightprotocol/curves?branch=release-0.3.0#7c901afc3ec80bf3eaea654237ffe73356f68c86" - -[[patch.unused]] -name = "ark-ec" -version = "0.3.0" -source = "git+https://github.com/Lightprotocol/algebra?branch=release-0.3.0#d45d741649114ab36dca7a88d08c044174f6b8b5" - -[[patch.unused]] -name = "ark-ff" -version = "0.3.0" -source = "git+https://github.com/Lightprotocol/algebra?branch=release-0.3.0#d45d741649114ab36dca7a88d08c044174f6b8b5" - -[[patch.unused]] -name = "ark-serialize" -version = "0.3.0" -source = "git+https://github.com/Lightprotocol/algebra?branch=release-0.3.0#d45d741649114ab36dca7a88d08c044174f6b8b5" diff --git a/programs/compressed-token/src/lib.rs b/programs/compressed-token/src/lib.rs index b5c05f953e..28bef45dd8 100644 --- a/programs/compressed-token/src/lib.rs +++ b/programs/compressed-token/src/lib.rs @@ -1,10 +1,13 @@ use anchor_lang::prelude::*; +pub mod process_create_compressed_mint; pub mod process_mint; pub mod process_transfer; +pub use process_create_compressed_mint::*; pub use process_mint::*; pub use process_transfer::*; +use psp_compressed_pda::utils::CompressedProof; declare_id!("9sixVEthz2kMSKfeApZXHwuboT6DZuT6crAYJTciUCqE"); @@ -34,6 +37,20 @@ pub mod psp_compressed_token { Ok(()) } + /// Currently has no functionality + /// Test case to create a compressed account with address + pub fn create_compressed_mint_account<'info>( + ctx: Context<'_, '_, '_, 'info, CreateCompressedMintAccountInstruction<'info>>, + address_non_inclusion_proof: CompressedProof, + address_merkle_tree_root_index: u16, + ) -> Result<()> { + process_create_compressed_mint_account( + ctx, + address_non_inclusion_proof, + address_merkle_tree_root_index, + ) + } + pub fn mint_to<'info>( ctx: Context<'_, '_, '_, 'info, MintToInstruction<'info>>, public_keys: Vec, diff --git a/programs/compressed-token/src/process_create_compressed_mint.rs b/programs/compressed-token/src/process_create_compressed_mint.rs new file mode 100644 index 0000000000..3fac4d178d --- /dev/null +++ b/programs/compressed-token/src/process_create_compressed_mint.rs @@ -0,0 +1,224 @@ +use std::vec; + +use crate::MINT_AUTHORITY_SEED; +use anchor_lang::prelude::*; +use anchor_lang::solana_program::program_option::COption; +use anchor_spl::token::Mint; +use light_hasher::poseidon::Poseidon; +use light_hasher::Hasher; +use light_utils::hash_to_bn254_field_size_le; +use psp_compressed_pda::compressed_account::derive_address; +use psp_compressed_pda::utils::CompressedProof; +use psp_compressed_pda::{ + compressed_account::{CompressedAccount, CompressedAccountData}, + InstructionDataTransfer, +}; +/// creates a token pool account which is owned by the token authority pda +#[derive(Accounts)] +pub struct CreateCompressedMintAccountInstruction<'info> { + #[account(mut)] + pub fee_payer: Signer<'info>, + #[account(mut)] + pub authority: Signer<'info>, + /// CHECK: + pub mint: Account<'info, Mint>, + /// CHECK: + #[account(mut, seeds=[MINT_AUTHORITY_SEED, authority.key().to_bytes().as_slice(), mint.key().to_bytes().as_slice()], bump)] + pub mint_authority_pda: AccountInfo<'info>, + pub compressed_pda_program: Program<'info, psp_compressed_pda::program::PspCompressedPda>, + /// CHECK: this account + #[account(mut)] + pub registered_program_pda: UncheckedAccount<'info>, + /// CHECK: this account + pub noop_program: UncheckedAccount<'info>, + /// CHECK: this account in psp account compression program + #[account(mut, seeds = [b"cpi_authority", account_compression::ID.to_bytes().as_slice()], bump, seeds::program = psp_compressed_pda::ID,)] + pub psp_account_compression_authority: UncheckedAccount<'info>, + /// CHECK: this account in psp account compression program + pub account_compression_program: + Program<'info, account_compression::program::AccountCompression>, + /// CHECK: this account will be checked by psp compressed pda program + #[account(mut)] + pub merkle_tree: UncheckedAccount<'info>, + /// CHECK: this account will be checked by psp compressed pda program + pub address_merkle_tree: UncheckedAccount<'info>, + /// CHECK: this account will be checked by psp compressed pda program + #[account(mut)] + pub address_merkle_tree_queue: UncheckedAccount<'info>, +} + +pub fn process_create_compressed_mint_account<'info>( + ctx: Context<'_, '_, '_, 'info, CreateCompressedMintAccountInstruction<'info>>, + address_non_inclusion_proof: CompressedProof, + address_merkle_tree_root_index: u16, +) -> Result<()> { + let seed = ctx.accounts.mint.key().to_bytes(); + let address = derive_address(&ctx.accounts.address_merkle_tree.key(), &seed)?; + let data: CompressedAccountData = CompressedAccountData { + discriminator: 1u64.to_le_bytes(), + data: ctx.accounts.mint.to_account_info().data.borrow().to_vec(), + data_hash: data_hash(&ctx.accounts.mint).unwrap(), + }; + let output_compressed_account = CompressedAccount { + owner: crate::ID, + lamports: 0u64, + data: Some(data), + address: Some(address), + }; + + cpi_execute_compressed_transaction_create_compressed_mint( + &ctx, + &[output_compressed_account], + address_non_inclusion_proof, + seed, + address_merkle_tree_root_index, + ) +} + +#[inline(never)] +pub fn cpi_execute_compressed_transaction_create_compressed_mint<'info>( + ctx: &Context<'_, '_, '_, 'info, CreateCompressedMintAccountInstruction<'info>>, + output_compressed_accounts: &[CompressedAccount], + address_non_inclusion_proof: CompressedProof, + seed: [u8; 32], + address_merkle_tree_root_index: u16, +) -> Result<()> { + let inputs_struct = InstructionDataTransfer { + relay_fee: None, + input_compressed_accounts_with_merkle_context: Vec::new(), + output_compressed_accounts: output_compressed_accounts.to_vec(), + output_state_merkle_tree_account_indices: vec![0u8], + input_root_indices: Vec::new(), + proof: Some(address_non_inclusion_proof), + new_address_seeds: vec![seed], + address_merkle_tree_root_indices: vec![address_merkle_tree_root_index], + address_merkle_tree_account_indices: vec![1u8], + address_queue_account_indices: vec![2u8], + }; + + let mut inputs = Vec::new(); + InstructionDataTransfer::serialize(&inputs_struct, &mut inputs).unwrap(); + let authority_bytes = ctx.accounts.authority.key().to_bytes(); + let mint_bytes = ctx.accounts.mint.key().to_bytes(); + let seeds = [ + MINT_AUTHORITY_SEED, + authority_bytes.as_slice(), + mint_bytes.as_slice(), + ]; + let (_, bump) = + anchor_lang::prelude::Pubkey::find_program_address(seeds.as_slice(), ctx.program_id); + let bump = &[bump]; + let seeds = [ + MINT_AUTHORITY_SEED, + authority_bytes.as_slice(), + mint_bytes.as_slice(), + bump, + ]; + + let signer_seeds = &[&seeds[..]]; + let cpi_accounts = psp_compressed_pda::cpi::accounts::TransferInstruction { + signer: ctx.accounts.mint_authority_pda.to_account_info(), + registered_program_pda: ctx.accounts.registered_program_pda.to_account_info(), + noop_program: ctx.accounts.noop_program.to_account_info(), + psp_account_compression_authority: ctx + .accounts + .psp_account_compression_authority + .to_account_info(), + account_compression_program: ctx.accounts.account_compression_program.to_account_info(), + cpi_signature_account: None, + invoking_program: None, + }; + let mut cpi_ctx = CpiContext::new_with_signer( + ctx.accounts.compressed_pda_program.to_account_info(), + cpi_accounts, + signer_seeds, + ); + + cpi_ctx.remaining_accounts = vec![ + ctx.accounts.merkle_tree.to_account_info(), + ctx.accounts.address_merkle_tree.to_account_info(), + ctx.accounts.address_merkle_tree_queue.to_account_info(), + ]; + psp_compressed_pda::cpi::execute_compressed_transaction(cpi_ctx, inputs)?; + Ok(()) +} + +pub fn data_hash( + mint: &Mint, +) -> std::prelude::v1::Result<[u8; 32], light_hasher::errors::HasherError> { + let mint_authority = match mint.mint_authority { + COption::Some(mint_authority) => { + hash_to_bn254_field_size_le(mint_authority.to_bytes().as_slice()) + .unwrap() + .0 + } + COption::None => [0u8; 32], + }; + let freeze_authority = match mint.freeze_authority { + COption::Some(freeze_authority) => { + hash_to_bn254_field_size_le(freeze_authority.to_bytes().as_slice()) + .unwrap() + .0 + } + COption::None => [0u8; 32], + }; + Poseidon::hashv(&[ + mint_authority.as_slice(), + mint.supply.to_le_bytes().as_slice(), + mint.decimals.to_le_bytes().as_slice(), + [mint.is_initialized as u8].as_slice(), + freeze_authority.as_slice(), + ]) +} + +#[cfg(not(target_os = "solana"))] +pub mod create_compressed_mint_sdk { + use account_compression::NOOP_PROGRAM_ID; + use anchor_lang::{InstructionData, ToAccountMetas}; + use psp_compressed_pda::utils::CompressedProof; + use solana_sdk::{instruction::Instruction, pubkey::Pubkey}; + + use crate::get_token_authority_pda; + + pub fn create_compressed_mint_account_to_instruction( + fee_payer: &Pubkey, + authority: &Pubkey, + mint: &Pubkey, + merkle_tree: &Pubkey, + address_merkle_tree: &Pubkey, + address_merkle_tree_queue: &Pubkey, + address_non_inclusion_proof: CompressedProof, + address_merkle_tree_root_index: u16, + ) -> Instruction { + let mint_authority_pda = get_token_authority_pda(authority, mint); + let instruction_data = crate::instruction::CreateCompressedMintAccount { + address_non_inclusion_proof, + address_merkle_tree_root_index, + }; + + let accounts = crate::accounts::CreateCompressedMintAccountInstruction { + fee_payer: *fee_payer, + authority: *authority, + mint_authority_pda, + mint: *mint, + compressed_pda_program: psp_compressed_pda::ID, + registered_program_pda: psp_compressed_pda::utils::get_registered_program_pda( + &psp_compressed_pda::ID, + ), + noop_program: NOOP_PROGRAM_ID, + psp_account_compression_authority: psp_compressed_pda::utils::get_cpi_authority_pda( + &psp_compressed_pda::ID, + ), + account_compression_program: account_compression::ID, + merkle_tree: *merkle_tree, + address_merkle_tree: *address_merkle_tree, + address_merkle_tree_queue: *address_merkle_tree_queue, + }; + + Instruction { + program_id: crate::ID, + accounts: accounts.to_account_metas(Some(true)), + data: instruction_data.data(), + } + } +} diff --git a/programs/compressed-token/tests/test.rs b/programs/compressed-token/tests/test.rs index 26e513e593..0b02d2ec50 100644 --- a/programs/compressed-token/tests/test.rs +++ b/programs/compressed-token/tests/test.rs @@ -1,4 +1,4 @@ -#![cfg(feature = "test-sbf")] +// #![cfg(feature = "test-sbf")] use account_compression::{ utils::constants::{ @@ -6,7 +6,7 @@ use account_compression::{ }, StateMerkleTreeAccount, }; -use anchor_lang::AnchorSerialize; +use anchor_lang::{AccountDeserialize, AnchorSerialize}; use circuitlib_rs::{ gnark::{ constants::{INCLUSION_PATH, SERVER_ADDRESS}, @@ -29,6 +29,7 @@ use psp_compressed_pda::{ utils::CompressedProof, }; use psp_compressed_token::{ + create_compressed_mint_sdk::create_compressed_mint_account_to_instruction, get_token_authority_pda, get_token_pool_pda, mint_sdk::{create_initialize_mint_instruction, create_mint_to_instruction}, transfer_sdk, AccountState, ErrorCode, TokenData, TokenTransferOutputData, @@ -127,13 +128,97 @@ async fn assert_create_mint( assert_eq!(mint_account.owner, mint_authority); } +async fn assert_create_compressed_mint( + context: &mut ProgramTestContext, + authority: &Pubkey, + mint: &Pubkey, + mock_indexer: &MockIndexer, +) { + let mint_account: spl_token::state::Mint = spl_token::state::Mint::unpack( + &context + .banks_client + .get_account(*mint) + .await + .unwrap() + .unwrap() + .data, + ) + .unwrap(); + let mint_authority = get_token_authority_pda(authority, mint); + assert_eq!(mint_account.supply, 0); + assert_eq!(mint_account.decimals, 2); + assert_eq!(mint_account.mint_authority.unwrap(), mint_authority); + assert_eq!(mint_account.freeze_authority, None.into()); + assert_eq!(mint_account.is_initialized, true); + assert_eq!( + mock_indexer.compressed_accounts.len(), + 1, + "Compressed account not created" + ); + let compressed_account = mock_indexer.compressed_accounts[0] + .compressed_account + .clone(); + println!("{:?}", compressed_account); + assert_eq!( + compressed_account.owner, + psp_compressed_token::ID, + "Owner not set correctly" + ); + assert_eq!( + compressed_account.lamports, 0u64, + "Lamports not set correctly" + ); + assert_eq!( + compressed_account.data.as_ref().unwrap().discriminator, + 1u64.to_le_bytes(), + "Discriminator not set correctly" + ); + assert_eq!( + compressed_account.data.as_ref().unwrap().data.len(), + anchor_spl::token::Mint::LEN, + "Data not set correctly" + ); + + let deserialized_compressed_mint_account = anchor_spl::token::Mint::try_deserialize_unchecked( + &mut compressed_account.data.as_ref().unwrap().data.as_slice(), + ) + .unwrap(); + assert_eq!( + mint_account.decimals, + deserialized_compressed_mint_account.decimals + ); + assert_eq!( + mint_account.supply, + deserialized_compressed_mint_account.supply + ); + assert_eq!( + mint_account.mint_authority.unwrap(), + deserialized_compressed_mint_account.mint_authority.unwrap() + ); + assert_eq!( + mint_account.freeze_authority, + deserialized_compressed_mint_account.freeze_authority + ); + assert_eq!( + mint_account.is_initialized, + deserialized_compressed_mint_account.is_initialized + ); +} + #[tokio::test] async fn test_create_mint() { let env: light_test_utils::test_env::EnvWithAccounts = setup_test_programs_with_accounts().await; let mut context = env.context; + let payer = context.payer.insecure_clone(); let payer_pubkey = payer.pubkey(); + let mock_indexer = MockIndexer::new( + env.merkle_tree_pubkey, + env.indexed_array_pubkey, + payer.insecure_clone(), + None, + ); let rent = context .banks_client .get_rent() @@ -148,6 +233,42 @@ async fn test_create_mint() { .await .unwrap(); assert_create_mint(&mut context, &payer_pubkey, &mint.pubkey(), &pool).await; + + let mock_inclusion_proof = CompressedProof { + a: [0u8; 32], + b: [0u8; 64], + c: [0u8; 32], + }; + let instruction = create_compressed_mint_account_to_instruction( + &payer_pubkey, + &payer_pubkey, + &mint.pubkey(), + &env.merkle_tree_pubkey, + &env.address_merkle_tree_pubkey, + &env.address_merkle_tree_queue_pubkey, + mock_inclusion_proof, + 0u16, + ); + // create_and_send_transaction(&mut context, &[instruction], &payer_pubkey, &[&payer]) + // .await + // .unwrap(); + let transaction = Transaction::new_signed_with_payer( + &[instruction], + Some(&payer_pubkey), + &[&payer], + context.last_blockhash, + ); + let res = solana_program_test::BanksClient::process_transaction_with_metadata( + &mut context.banks_client, + transaction, + ) + .await + .unwrap(); + let mut mock_indexer = mock_indexer.await; + mock_indexer + .add_lamport_compressed_accounts(res.metadata.unwrap().return_data.unwrap().data.to_vec()); + + assert_create_compressed_mint(&mut context, &payer_pubkey, &mint.pubkey(), &mock_indexer).await; } async fn create_mint_helper(context: &mut ProgramTestContext, payer: &Keypair) -> Pubkey {