From db909598d31ad3603499e76312f976d1c4135d3c Mon Sep 17 00:00:00 2001 From: Nikhil Acharya Prakash Date: Tue, 20 Feb 2024 15:01:22 +0530 Subject: [PATCH] token-extensions: Upstream t22 blockbuster changes (#5) --- .github/workflows/test.yml | 3 - Cargo.lock | 1559 ++++++++--------- blockbuster/Cargo.toml | 33 +- blockbuster/src/program_handler.rs | 2 +- blockbuster/src/programs/bubblegum/mod.rs | 126 +- blockbuster/src/programs/candy_guard/mod.rs | 83 - blockbuster/src/programs/candy_machine/mod.rs | 91 - .../src/programs/candy_machine/state.rs | 123 -- .../src/programs/candy_machine_core/mod.rs | 68 - blockbuster/src/programs/mod.rs | 26 +- .../programs/token_extensions/extension.rs | 547 ++++++ .../src/programs/token_extensions/mod.rs | 244 +++ .../src/programs/token_metadata/mod.rs | 44 +- blockbuster/tests/bubblegum_parser_test.rs | 154 +- .../tests/candy_machine_parser_test.rs | 388 ---- blockbuster/tests/helpers.rs | 5 +- blockbuster/tests/instructions_test.rs | 21 +- 17 files changed, 1724 insertions(+), 1793 deletions(-) delete mode 100644 blockbuster/src/programs/candy_guard/mod.rs delete mode 100644 blockbuster/src/programs/candy_machine/mod.rs delete mode 100644 blockbuster/src/programs/candy_machine/state.rs delete mode 100644 blockbuster/src/programs/candy_machine_core/mod.rs create mode 100644 blockbuster/src/programs/token_extensions/extension.rs create mode 100644 blockbuster/src/programs/token_extensions/mod.rs delete mode 100644 blockbuster/tests/candy_machine_parser_test.rs diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f82f29b2..8d353407 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,9 +4,6 @@ on: branches: - main pull_request: - # Sequence of patterns matched against refs/heads - branches: - - main env: RUST_TOOLCHAIN: stable jobs: diff --git a/Cargo.lock b/Cargo.lock index aba5f303..4aa147a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,6 +12,15 @@ dependencies = [ "regex", ] +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + [[package]] name = "adler" version = "1.0.2" @@ -79,9 +88,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.4" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -109,8 +118,8 @@ checksum = "faa5be5b72abea167f87c868379ba3c2be356bfca9e6f474fd055fa0f7eeb4f2" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "regex", "syn 1.0.109", ] @@ -124,8 +133,8 @@ dependencies = [ "anchor-syn", "anyhow", "bs58 0.5.0", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "rustversion", "syn 1.0.109", ] @@ -137,7 +146,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59948e7f9ef8144c2aefb3f32a40c5fce2798baeec765ba038389e82301017ef" dependencies = [ "anchor-syn", - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "syn 1.0.109", ] @@ -148,8 +157,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc753c9d1c7981cb8948cf7e162fb0f64558999c0413058e2d43df1df5448086" dependencies = [ "anchor-syn", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", ] @@ -161,8 +170,8 @@ checksum = "f38b4e172ba1b52078f53fdc9f11e3dc0668ad27997838a0aad2d148afac8c97" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", ] @@ -174,8 +183,8 @@ checksum = "4eebd21543606ab61e2d83d9da37d24d3886a49f390f9c43a1964735e8c0f0d5" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", ] @@ -187,8 +196,8 @@ checksum = "ec4720d899b3686396cced9508f23dab420f1308344456ec78ef76f98fda42af" dependencies = [ "anchor-syn", "anyhow", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", ] @@ -198,8 +207,8 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f495e85480bd96ddeb77b71d499247c7d4e8b501e75ecb234e9ef7ae7bd6552a" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", ] @@ -227,19 +236,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "anchor-spl" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f860599da1c2354e7234c768783049eb42e2f54509ecfc942d2e0076a2da7b" -dependencies = [ - "anchor-lang", - "solana-program", - "spl-associated-token-account 1.1.3", - "spl-token 3.5.0", - "spl-token-2022 0.6.1", -] - [[package]] name = "anchor-syn" version = "0.28.0" @@ -249,11 +245,11 @@ dependencies = [ "anyhow", "bs58 0.5.0", "heck", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "serde", "serde_json", - "sha2 0.10.7", + "sha2 0.10.8", "syn 1.0.109", "thiserror", ] @@ -284,9 +280,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.74" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c6f84b74db2535ebae81eede2f39b947dcbf01d093ae5f791e5dd414a1bf289" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "ark-bn254" @@ -329,7 +325,7 @@ dependencies = [ "derivative", "digest 0.10.7", "itertools", - "num-bigint 0.4.3", + "num-bigint 0.4.4", "num-traits", "paste", "rustc_version", @@ -342,7 +338,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" dependencies = [ - "quote 1.0.32", + "quote 1.0.33", "syn 1.0.109", ] @@ -352,10 +348,10 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ - "num-bigint 0.4.3", + "num-bigint 0.4.4", "num-traits", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", ] @@ -381,7 +377,7 @@ dependencies = [ "ark-serialize-derive", "ark-std", "digest 0.10.7", - "num-bigint 0.4.3", + "num-bigint 0.4.4", ] [[package]] @@ -390,8 +386,8 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", ] @@ -442,7 +438,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.25", + "time", ] [[package]] @@ -451,8 +447,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", "synstructure", ] @@ -463,8 +459,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", ] @@ -487,9 +483,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.3.15" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" +checksum = "bb42b2197bf15ccb092b62c74515dbd8b86d0effd934795f6687c93b6e679a2c" dependencies = [ "brotli", "flate2", @@ -514,9 +510,9 @@ version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] @@ -536,6 +532,21 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" version = "0.12.3" @@ -550,9 +561,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "base64ct" @@ -592,9 +603,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", "arrayvec", @@ -631,7 +642,7 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "blockbuster" -version = "0.8.0" +version = "1.0.1" dependencies = [ "anchor-lang", "async-trait", @@ -641,8 +652,6 @@ dependencies = [ "lazy_static", "log", "mpl-bubblegum", - "mpl-candy-guard", - "mpl-candy-machine-core", "mpl-token-metadata", "plerkle_serialization", "rand 0.8.5", @@ -653,8 +662,8 @@ dependencies = [ "solana-transaction-status", "spl-account-compression", "spl-concurrent-merkle-tree", - "spl-noop 0.1.3", - "spl-token 3.5.0", + "spl-noop", + "spl-token", "thiserror", ] @@ -687,7 +696,7 @@ dependencies = [ "borsh-derive-internal 0.9.3", "borsh-schema-derive-internal 0.9.3", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "syn 1.0.109", ] @@ -700,7 +709,7 @@ dependencies = [ "borsh-derive-internal 0.10.3", "borsh-schema-derive-internal 0.10.3", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "syn 1.0.109", ] @@ -710,8 +719,8 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", ] @@ -721,8 +730,8 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", ] @@ -732,8 +741,8 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", ] @@ -743,16 +752,16 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", ] [[package]] name = "brotli" -version = "3.3.4" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -761,9 +770,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.3.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" +checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -786,9 +795,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bv" @@ -802,35 +811,35 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "caps" @@ -844,9 +853,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", @@ -860,18 +869,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.48.5", ] [[package]] @@ -938,9 +946,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" dependencies = [ "crossbeam-utils", ] @@ -1116,38 +1124,14 @@ dependencies = [ "zeroize", ] -[[package]] -name = "darling" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" -dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", -] - [[package]] name = "darling" version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core 0.20.3", - "darling_macro 0.20.3", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2 1.0.66", - "quote 1.0.32", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -1158,21 +1142,10 @@ checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "strsim 0.10.0", - "syn 2.0.28", -] - -[[package]] -name = "darling_macro" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" -dependencies = [ - "darling_core 0.13.4", - "quote 1.0.32", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] @@ -1181,9 +1154,9 @@ version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core 0.20.3", - "quote 1.0.32", - "syn 2.0.28", + "darling_core", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] @@ -1210,16 +1183,19 @@ dependencies = [ "asn1-rs", "displaydoc", "nom", - "num-bigint 0.4.3", + "num-bigint 0.4.4", "num-traits", "rusticata-macros", ] [[package]] name = "deranged" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +dependencies = [ + "serde", +] [[package]] name = "derivation-path" @@ -1233,8 +1209,8 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", ] @@ -1276,9 +1252,9 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] @@ -1342,7 +1318,7 @@ dependencies = [ "derivation-path", "ed25519-dalek", "hmac 0.12.1", - "sha2 0.10.7", + "sha2 0.10.8", ] [[package]] @@ -1359,9 +1335,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -1381,9 +1357,9 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] @@ -1407,25 +1383,14 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.2" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" 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", -] - [[package]] name = "event-listener" version = "2.5.3" @@ -1434,9 +1399,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fastrand" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "feature-probe" @@ -1533,9 +1498,9 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] @@ -1615,6 +1580,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + [[package]] name = "goblin" version = "0.5.4" @@ -1628,9 +1599,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -1680,9 +1651,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" @@ -1704,9 +1675,15 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "histogram" @@ -1801,7 +1778,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -1810,15 +1787,16 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ + "futures-util", "http", "hyper", - "rustls", + "rustls 0.21.7", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -1884,23 +1862,25 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", + "serde", ] [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.1", + "serde", ] [[package]] name = "indicatif" -version = "0.17.6" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b297dc40733f23a0e52728a58fa9489a5b7638a324932de16b41adc3ef80730" +checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" dependencies = [ "console", "instant", @@ -1941,9 +1921,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] @@ -1972,6 +1952,15 @@ dependencies = [ "serde_json", ] +[[package]] +name = "kaigan" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a26f49495f94a283312e7ef45a243540ef20c9356bb01c8d84a61ac8ba5339b" +dependencies = [ + "borsh 0.10.3", +] + [[package]] name = "keccak" version = "0.1.4" @@ -1989,9 +1978,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libsecp256k1" @@ -2043,9 +2032,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lock_api" @@ -2065,9 +2054,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memmap2" @@ -2131,171 +2120,55 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.14" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "log", - "miow", - "ntapi", - "winapi", -] - -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", ] [[package]] name = "mpl-bubblegum" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ef961b70007089d0f2432d13bd2a544722b249e0afdb4ddb4722fed1aab3f76" -dependencies = [ - "anchor-lang", - "anchor-spl", - "bytemuck", - "mpl-token-metadata", - "num-traits", - "solana-program", - "spl-account-compression", - "spl-associated-token-account 2.0.0", - "spl-token 4.0.0", -] - -[[package]] -name = "mpl-candy-guard" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c5c2ffb233226e0c531f1cf800909e46120e98722eeb53dae68b0996303a38" -dependencies = [ - "anchor-lang", - "arrayref", - "mpl-candy-guard-derive", - "mpl-candy-machine-core", - "mpl-token-auth-rules", - "mpl-token-metadata", - "solana-gateway", - "solana-program", - "spl-associated-token-account 2.0.0", - "spl-token 4.0.0", - "spl-token-2022 0.7.0", -] - -[[package]] -name = "mpl-candy-guard-derive" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e4d3002ea881e94a238798faf87a006a687297a24bd4b3f810fbb63611173d" -dependencies = [ - "quote 1.0.32", - "syn 1.0.109", -] - -[[package]] -name = "mpl-candy-machine-core" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e3a24906f7680f3aa4700b2818d679d519c21b9795ed320f8addabb9feee7b8" -dependencies = [ - "anchor-lang", - "arrayref", - "mpl-token-auth-rules", - "mpl-token-metadata", - "solana-program", - "spl-associated-token-account 2.0.0", - "spl-token 4.0.0", -] - -[[package]] -name = "mpl-token-auth-rules" -version = "1.4.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b1ec5ee0570f688cc84ff4624c5c50732f1a2bfc789f6b34af5b563428d971" +checksum = "b3cbca5deb859e66a1a21ada94f2eaab3eb5caa4584c0c8ade0efac29a5414b8" dependencies = [ "borsh 0.10.3", - "bytemuck", - "mpl-token-metadata-context-derive 0.2.1", + "kaigan", "num-derive 0.3.3", "num-traits", - "rmp-serde", - "serde", - "shank", "solana-program", - "solana-zk-token-sdk", "thiserror", ] [[package]] name = "mpl-token-metadata" -version = "2.0.0-beta.1" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3545bd5fe73416f6514cd93899612e0e138619e72df8bc7d19906a12688c69e" +checksum = "b4b2de608098eb2ef2a5392069dea83084967e25a4d69d0380a6bb02454fc0fe" dependencies = [ - "arrayref", "borsh 0.10.3", - "mpl-token-auth-rules", - "mpl-token-metadata-context-derive 0.3.0", - "mpl-utils", "num-derive 0.3.3", "num-traits", "serde", - "serde_with 1.14.0", - "shank", + "serde_with 3.6.0", "solana-program", - "spl-associated-token-account 2.0.0", - "spl-token 4.0.0", "thiserror", ] -[[package]] -name = "mpl-token-metadata-context-derive" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12989bc45715b0ee91944855130131479f9c772e198a910c3eb0ea327d5bffc3" -dependencies = [ - "quote 1.0.32", - "syn 1.0.109", -] - -[[package]] -name = "mpl-token-metadata-context-derive" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a739019e11d93661a64ef5fe108ab17c79b35961e944442ff6efdd460ad01a" -dependencies = [ - "quote 1.0.32", - "syn 1.0.109", -] - -[[package]] -name = "mpl-utils" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f2e4f92aec317d5853c0cc4c03c55f5178511c45bb3dbb441aea63117bf3dc9" -dependencies = [ - "arrayref", - "solana-program", - "spl-token-2022 0.6.1", -] - [[package]] name = "nix" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", "memoffset 0.7.1", "pin-utils", - "static_assertions", ] [[package]] @@ -2308,15 +2181,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "ntapi" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" -dependencies = [ - "winapi", -] - [[package]] name = "num" version = "0.2.1" @@ -2344,9 +2208,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -2369,20 +2233,20 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", ] [[package]] name = "num-derive" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e6a0fd4f737c707bd9086cc16c925f294943eb62eb71499e9fd4cf71f8b9f4e" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] @@ -2420,9 +2284,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] @@ -2433,50 +2297,50 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.3", "libc", ] [[package]] name = "num_enum" -version = "0.5.11" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" dependencies = [ - "num_enum_derive 0.5.11", + "num_enum_derive 0.6.1", ] [[package]] name = "num_enum" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +checksum = "70bf6736f74634d299d00086f02986875b3c2d924781a6a2cb6c201e73da0ceb" dependencies = [ - "num_enum_derive 0.6.1", + "num_enum_derive 0.7.0", ] [[package]] name = "num_enum_derive" -version = "0.5.11" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] name = "num_enum_derive" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +checksum = "56ea360eafe1022f7cc56cd7b869ed57330fb2453d0c7831d99b74c65d2f5597" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] @@ -2485,6 +2349,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + [[package]] name = "oid-registry" version = "0.6.1" @@ -2518,17 +2391,6 @@ version = "6.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - [[package]] name = "parking_lot" version = "0.12.1" @@ -2536,21 +2398,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -2561,9 +2409,9 @@ checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall", "smallvec", - "windows-targets 0.48.2", + "windows-targets 0.48.5", ] [[package]] @@ -2616,9 +2464,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -2678,9 +2526,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f32154ba0af3a075eefa1eda8bb414ee928f62303a54ea85b8d6638ff1a6ee9e" +checksum = "31114a898e107c51bb1609ffaf55a0e011cf6a4d7f1170d0015a165082c0338b" [[package]] name = "ppv-lite86" @@ -2718,9 +2566,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -2745,7 +2593,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls", + "rustls 0.20.9", "thiserror", "tokio", "tracing", @@ -2754,15 +2602,15 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.4" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31999cfc7927c4e212e60fd50934ab40e8e8bfd2d493d6095d2d306bc0764d9" +checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" dependencies = [ "bytes", "rand 0.8.5", - "ring", + "ring 0.16.20", "rustc-hash", - "rustls", + "rustls 0.20.9", "rustls-native-certs", "slab", "thiserror", @@ -2779,7 +2627,7 @@ checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4" dependencies = [ "libc", "quinn-proto", - "socket2", + "socket2 0.4.9", "tracing", "windows-sys 0.42.0", ] @@ -2795,11 +2643,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", ] [[package]] @@ -2884,9 +2732,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -2894,14 +2742,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -2911,20 +2757,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ "pem", - "ring", - "time 0.3.25", + "ring 0.16.20", + "time", "yasna", ] -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.3.5" @@ -2936,9 +2773,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.3" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +checksum = "d119d7c7ca818f8a53c300863d4f87566aac09943aef5b355bb83969dae75d87" dependencies = [ "aho-corasick", "memchr", @@ -2948,9 +2785,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.6" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b" dependencies = [ "aho-corasick", "memchr", @@ -2959,18 +2796,18 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "56d84fdd47036b038fc80dd333d10b6aab10d5d31f4a366e20014def75328d33" [[package]] name = "reqwest" -version = "0.11.17" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ "async-compression", - "base64 0.21.2", + "base64 0.21.4", "bytes", "encoding_rs", "futures-core", @@ -2987,20 +2824,21 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", + "rustls 0.21.7", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-util", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", + "webpki-roots 0.25.2", "winreg", ] @@ -3013,32 +2851,24 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi", ] [[package]] -name = "rmp" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" -dependencies = [ - "byteorder", - "num-traits", - "paste", -] - -[[package]] -name = "rmp-serde" -version = "1.1.2" +name = "ring" +version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffea85eea980d8a74453e5d02a8d93028f3c34725de143085a844ebe953258a" +checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e" dependencies = [ - "byteorder", - "rmp", - "serde", + "cc", + "getrandom 0.2.10", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", ] [[package]] @@ -3094,9 +2924,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.8" +version = "0.38.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" dependencies = [ "bitflags 2.4.0", "errno", @@ -3107,16 +2937,28 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ "log", - "ring", + "ring 0.16.20", "sct", "webpki", ] +[[package]] +name = "rustls" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +dependencies = [ + "log", + "ring 0.16.20", + "rustls-webpki", + "sct", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -3135,7 +2977,17 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -3180,9 +3032,9 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] @@ -3191,8 +3043,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -3220,15 +3072,15 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.183" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] @@ -3244,20 +3096,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.183" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] name = "serde_json" -version = "1.0.104" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -3278,46 +3130,53 @@ dependencies = [ [[package]] name = "serde_with" -version = "1.14.0" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" dependencies = [ "serde", - "serde_with_macros 1.5.2", + "serde_with_macros 2.3.3", ] [[package]] name = "serde_with" -version = "2.3.3" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" +checksum = "1b0ed1662c5a68664f45b76d18deb0e234aff37207086803165c961eb695e981" dependencies = [ + "base64 0.21.4", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.0.2", "serde", - "serde_with_macros 2.3.3", + "serde_json", + "serde_with_macros 3.6.0", + "time", ] [[package]] name = "serde_with_macros" -version = "1.5.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ - "darling 0.13.4", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "darling", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] name = "serde_with_macros" -version = "2.3.3" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" +checksum = "568577ff0ef47b879f736cd66740e022f3672788cdf002a05a4e609ea5a6fb15" dependencies = [ - "darling 0.20.3", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "darling", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] @@ -3346,9 +3205,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -3377,40 +3236,6 @@ dependencies = [ "keccak", ] -[[package]] -name = "shank" -version = "0.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b63e565b5e95ad88ab38f312e89444c749360641c509ef2de0093b49f55974a5" -dependencies = [ - "shank_macro", -] - -[[package]] -name = "shank_macro" -version = "0.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63927d22a1e8b74bda98cc6e151fcdf178b7abb0dc6c4f81e0bbf5ffe2fc4ec8" -dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "shank_macro_impl", - "syn 1.0.109", -] - -[[package]] -name = "shank_macro_impl" -version = "0.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ce03403df682f80f4dc1efafa87a4d0cb89b03726d0565e6364bdca5b9a441" -dependencies = [ - "anyhow", - "proc-macro2 1.0.66", - "quote 1.0.32", - "serde", - "syn 1.0.109", -] - [[package]] name = "shell-words" version = "1.1.0" @@ -3444,18 +3269,18 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "socket2" @@ -3467,14 +3292,24 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "solana-account-decoder" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af3fd71c1b3a1bd76840b627a85e0580dc85a5db59259d6f2129eb4bea8ff628" +checksum = "f52aec62a85932e26d1085864b0f7b99b31934aec8dd132429bfef6d7fb1d3a6" dependencies = [ "Inflector", - "base64 0.21.2", + "base64 0.21.4", "bincode", "bs58 0.4.0", "bv", @@ -3485,17 +3320,18 @@ dependencies = [ "solana-address-lookup-table-program", "solana-config-program", "solana-sdk", - "spl-token 3.5.0", - "spl-token-2022 0.6.1", + "spl-token", + "spl-token-2022", + "spl-token-metadata-interface", "thiserror", "zstd", ] [[package]] name = "solana-address-lookup-table-program" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147c6ac17124380edf2e5a505da0e2c22ad300c3b532cad4497a6da3a9bc54dc" +checksum = "ee0bd25f4ba0a15fc16c57b41b1e1b14f5271b83214fda158fdedb58758d394e" dependencies = [ "bincode", "bytemuck", @@ -3514,9 +3350,9 @@ dependencies = [ [[package]] name = "solana-clap-utils" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce466531351ab81e9931122bd779369af20f4816f2706b4af47c3ea989de5447" +checksum = "e963043668c640183d48472b281ebb9f713e0c36df0271961d23e6a394e09070" dependencies = [ "chrono", "clap 2.34.0", @@ -3532,9 +3368,9 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59d5c898cc260d747f1fafc38faf3005b94737c660047381236b57448a008b10" +checksum = "52ccf7bb34fb81c74582a9011babaa2e0220da56c71186e77f45a6f352017fdb" dependencies = [ "async-trait", "bincode", @@ -3565,9 +3401,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaee2ae2c20c8f4d1f4a71fdef18b846ed526a62f3960c1dd397e3214a5c3636" +checksum = "7fd0fc1efb91a1661aeb1ff6a691156c3b1bffdaed0aa096589499dd83f9e50b" dependencies = [ "bincode", "chrono", @@ -3579,9 +3415,9 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3a18a36fe35598469fbfd3909fcdee3790225367d4a1b6ac3bb77d333cc72" +checksum = "8759e9cb9b1e92a94c31812169ecb5e65b5e215fb70fb68691e03655de5b7b6c" dependencies = [ "async-trait", "bincode", @@ -3600,9 +3436,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99cfa99557c93f82428f19629d7aa0bb069a740f5caf0ae0654853e9930cd4c" +checksum = "02eb4f0ed3eade20f4abdcc0031167344237cd6e16808bd0f33945f9db7861fe" dependencies = [ "ahash 0.8.3", "blake3", @@ -3625,7 +3461,7 @@ dependencies = [ "serde_bytes", "serde_derive", "serde_json", - "sha2 0.10.7", + "sha2 0.10.8", "solana-frozen-abi-macro", "subtle", "thiserror", @@ -3633,34 +3469,21 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f9a943b7e086970c1f131c82bed6788b788b49c6b3579388f4989cfcfb47db" +checksum = "f28514761a285944cbad5b3d7930546369b80a713ba37d84bcf6ed2753611765" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "rustc_version", - "syn 2.0.28", -] - -[[package]] -name = "solana-gateway" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d148eb75d0799f6825dc2a840b85c065e3d6d12212845add3e059163f98770e" -dependencies = [ - "borsh 0.10.3", - "num-derive 0.4.0", - "num-traits", - "solana-program", - "thiserror", + "syn 2.0.38", ] [[package]] name = "solana-geyser-plugin-interface" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c4df2917c76697a17a94dfe2c5fa776e2184103d8720d5da6b3c709d0564c3" +checksum = "512372f741974113777872cecd560beee189cf79c3fb2eb84e1c28be69f011d1" dependencies = [ "log", "solana-sdk", @@ -3670,9 +3493,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc71a75f90306445902cd0fb1082761bcf5a5b244738e557edfd6ca75f94019a" +checksum = "2c310c6749435ce1ea25a9ae3edfb2fd2c2aed2aa4d4f7e0487a8077a0b1ee30" dependencies = [ "env_logger", "lazy_static", @@ -3681,9 +3504,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2426169e601a2bb12b966b076d5fc33943227e555abb36216f7bf20584cde8e7" +checksum = "0d171357580e62aa4ca19c780e25f4e74de064e2780cb8b9f6b6901d986fcd23" dependencies = [ "log", "solana-sdk", @@ -3691,9 +3514,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88eab2455a9c2ecf436a503fdc15c64bf8079dbb18f55172b88bcf3b9a3b0a56" +checksum = "013cbb3c82588278d2be18d3317ece5286cb54a3a06d5d38fc31e2a76a6d5e2d" dependencies = [ "crossbeam-channel", "gethostname", @@ -3705,9 +3528,9 @@ dependencies = [ [[package]] name = "solana-net-utils" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6bb6bbfc5b19829d0ae30cb77f6942600ddf013b3ea9529c50ca61a18cedd59" +checksum = "c50d7cac0694b1fe07499de25404a0c7d6836457e359aba3b08c3983c3dc5eb6" dependencies = [ "bincode", "clap 3.2.25", @@ -3717,7 +3540,7 @@ dependencies = [ "rand 0.7.3", "serde", "serde_derive", - "socket2", + "socket2 0.4.9", "solana-logger", "solana-sdk", "solana-version", @@ -3727,9 +3550,9 @@ dependencies = [ [[package]] name = "solana-perf" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d981579ffa092782bc6deb4510106ce230a0c8074c932bb2564d5e1d9cbe72b" +checksum = "395d559e5be2c439551298e9fa95561807f24921fd9a1e08bb82a3dc05c02dea" dependencies = [ "ahash 0.8.3", "bincode", @@ -3754,16 +3577,16 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27f0785c04ca7709464aa99e3e960a5c09e2318da8658833d410e157b3292a69" +checksum = "cff2aa5434a77413e9d43e971ceb47bdb003f2e8bbc0365a25b684aca2605c25" dependencies = [ "ark-bn254", "ark-ec", "ark-ff", "ark-serialize", "array-bytes", - "base64 0.21.2", + "base64 0.21.4", "bincode", "bitflags 1.3.2", "blake3", @@ -3784,10 +3607,10 @@ dependencies = [ "libsecp256k1", "log", "memoffset 0.9.0", - "num-bigint 0.4.3", + "num-bigint 0.4.4", "num-derive 0.3.3", "num-traits", - "parking_lot 0.12.1", + "parking_lot", "rand 0.7.3", "rand_chacha 0.2.2", "rustc_version", @@ -3796,7 +3619,7 @@ dependencies = [ "serde_bytes", "serde_derive", "serde_json", - "sha2 0.10.7", + "sha2 0.10.8", "sha3 0.10.8", "solana-frozen-abi", "solana-frozen-abi-macro", @@ -3809,11 +3632,11 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76c947ee87c148f646f961d67580402fbe69825e017053fc3cd271afb3eefe" +checksum = "9d1832fefc2187142dac169812518ec20da68b09abad86e4a78f8ae1787e4f56" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "bincode", "eager", "enum-iterator", @@ -3837,9 +3660,9 @@ dependencies = [ [[package]] name = "solana-pubsub-client" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89db8eabe8a22f565a8c26449a65dc80acd9ae5332a2008649c464e75714039" +checksum = "89388addbc3192407d948634f82c95c4dbe1efbe578582abfd136720e059556e" dependencies = [ "crossbeam-channel", "futures-util", @@ -3862,9 +3685,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a944cbeec6904d1023186dd9387f3f498b369c54f2bb7e55e2d76ab6a069bf" +checksum = "b7897b876a6df2d97b3a5ddfd764155c0591e3497e863fd7fdf32b54de4e2644" dependencies = [ "async-mutex", "async-trait", @@ -3876,7 +3699,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rcgen", - "rustls", + "rustls 0.20.9", "solana-connection-cache", "solana-measure", "solana-metrics", @@ -3890,9 +3713,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c699b849a013036f6bda8219ecb2803708df2a829042ae909ceb939c77b44970" +checksum = "6ba17a930f9974a17a9a6c6e82e7f89b40127e9cc0f9c17cfc29fc5b149d2c38" dependencies = [ "lazy_static", "num_cpus", @@ -3900,16 +3723,16 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "056e7531f56893258151396b97a0da757f4deea55192c08df9c62cb62b82e957" +checksum = "80fb35e3fa78ef1d08a6a1d852e2c357e6ae388cb307d24fad359f57c34429f0" dependencies = [ "console", "dialoguer", "log", "num-derive 0.3.3", "num-traits", - "parking_lot 0.12.1", + "parking_lot", "qstring", "semver", "solana-sdk", @@ -3919,12 +3742,12 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d904dc51c52242b2e9e14b927af70ea04f0f74c99fa5db42981598885061b6" +checksum = "c512944689d747a87f76936c89bb59f5be6c9a3189631857f49746cfa47d5bd1" dependencies = [ "async-trait", - "base64 0.21.2", + "base64 0.21.4", "bincode", "bs58 0.4.0", "indicatif", @@ -3945,11 +3768,11 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bdf329e0d27ecbbfb73e5a060a23e9f9a26619b5ed56f673465342da1609e7c" +checksum = "6e918b75f8ac4c358a6b512bf8b7dafc8166ddcb52ded5164c6235e0693ccb09" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "bs58 0.4.0", "jsonrpc-core", "reqwest", @@ -3961,15 +3784,15 @@ dependencies = [ "solana-sdk", "solana-transaction-status", "solana-version", - "spl-token-2022 0.6.1", + "spl-token-2022", "thiserror", ] [[package]] name = "solana-rpc-client-nonce-utils" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf7e472d24e18f6d8e7e2dd7b5c71c02b0768898bad4cf4465542bdca91be9a" +checksum = "c6e360ea2f3a756bdf6256c1f6ef13f8b01b5d2a7855b4f16cafb4a4017f0557" dependencies = [ "clap 2.34.0", "solana-clap-utils", @@ -3980,12 +3803,12 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01ba95264245a5e9597362e4e6e3a50b538fbe5aaaf017af665a49b541beb25" +checksum = "8b1002048941cedbd7dd6a96fdaa3dc5238b998aaa70b81946b1e3ec108cc2be" dependencies = [ "assert_matches", - "base64 0.21.2", + "base64 0.21.4", "bincode", "bitflags 1.3.2", "borsh 0.10.3", @@ -4019,7 +3842,7 @@ dependencies = [ "serde_derive", "serde_json", "serde_with 2.3.3", - "sha2 0.10.7", + "sha2 0.10.8", "sha3 0.10.8", "solana-frozen-abi", "solana-frozen-abi-macro", @@ -4033,22 +3856,22 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0d5ec9d1e765173704cbe8ea7d8c8d69a9f879d7e71ae7deb0632f9f0ee429" +checksum = "4b41b63b2da4a37ce323aba108db21f4c7bfa638dd1bf58fdc870f83bdce48ba" dependencies = [ "bs58 0.4.0", - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "rustversion", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] name = "solana-streamer" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7889fb97171c64e06ec4f0efd236aca6873254888a6bf51bb4292e1436b3fdb1" +checksum = "f00e575f2bd5ae2776870fbd1d7379d4ad392c015e2a4e2a328953b821a9d36d" dependencies = [ "async-channel", "bytes", @@ -4068,7 +3891,7 @@ dependencies = [ "quinn-udp", "rand 0.7.3", "rcgen", - "rustls", + "rustls 0.20.9", "solana-metrics", "solana-perf", "solana-sdk", @@ -4079,9 +3902,9 @@ dependencies = [ [[package]] name = "solana-thin-client" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fa94bf1d27b4b4d9c593843f365d635bd276925fa61a7cedbe6bb816225128d" +checksum = "df328e2624cce68c9949a53eac317a264eceb997131cb9bd22175698a5f5dc74" dependencies = [ "bincode", "log", @@ -4094,9 +3917,9 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ab6dbd623ec97b471b490f741795559a48299af860b9cab4c7ccd2c916d0fd" +checksum = "6a8ce6fe221c0e1fd8aa3078b8fcb0cc3f4c27942f1256b57a60608d81ae5348" dependencies = [ "async-trait", "bincode", @@ -4119,14 +3942,14 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95e5aba173da8ee65e38e4ac55390eaccebff160117e919a73e1d28085e8a203" +checksum = "db0b811793e78a908119cc02edca3ff8b54d5660104ebd06cc0e2e7e2f66900b" dependencies = [ "Inflector", - "base64 0.21.2", + "base64 0.21.4", "bincode", - "borsh 0.9.3", + "borsh 0.10.3", "bs58 0.4.0", "lazy_static", "log", @@ -4136,18 +3959,18 @@ dependencies = [ "solana-account-decoder", "solana-address-lookup-table-program", "solana-sdk", - "spl-associated-token-account 1.1.3", + "spl-associated-token-account", "spl-memo", - "spl-token 3.5.0", - "spl-token-2022 0.6.1", + "spl-token", + "spl-token-2022", "thiserror", ] [[package]] name = "solana-udp-client" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "265ce6ae58aacdb5e04a9a579afefc3d0bb61c7c5a00df2dcde2315ace0031e5" +checksum = "897ff303a15ba956e80573dee4cf96d94d41a69adc5362898b98851e347505ad" dependencies = [ "async-trait", "solana-connection-cache", @@ -4160,9 +3983,9 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "192ed87b9562c2a15015f51ff5de560b59fa2cd244d2bb0146524af0a693a3b1" +checksum = "9513754d3b2203a0e1045a211c5d68e72e4ed135e477344c21d096897fd2bf70" dependencies = [ "log", "rustc_version", @@ -4176,9 +3999,9 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1910068b362f9b57748e6a0310b178b6c2dc377f3ba9489fd7d66d994ed7ca36" +checksum = "3b6bfc5302ce0383eb129aa3a916705a20d22c4ad448144ef684b7b028d4053f" dependencies = [ "bincode", "log", @@ -4198,12 +4021,12 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.16.8" +version = "1.16.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2822252ffc52c7415fcd0c468fa3c13cbc50bd181087d366fe511d891445cd" +checksum = "5d1fe77918563768a65fd5d6cd2fa06cf0aeb11e529a1ef8c230b0fe018600e3" dependencies = [ "aes-gcm-siv", - "base64 0.21.2", + "base64 0.21.4", "bincode", "bytemuck", "byteorder", @@ -4227,9 +4050,9 @@ dependencies = [ [[package]] name = "solana_rbpf" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3082ec3a1d4ef7879eb5b84916d5acde057abd59733eec3647e0ab8885283ef" +checksum = "17d4ba1e58947346e360fabde0697029d36ba83c42f669199b16a8931313cf29" dependencies = [ "byteorder", "combine", @@ -4250,6 +4073,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "spki" version = "0.5.4" @@ -4269,38 +4098,22 @@ dependencies = [ "anchor-lang", "bytemuck", "spl-concurrent-merkle-tree", - "spl-noop 0.2.0", -] - -[[package]] -name = "spl-associated-token-account" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978dba3bcbe88d0c2c58366c254d9ea41c5f73357e72fc0bdee4d6b5fc99c8f4" -dependencies = [ - "assert_matches", - "borsh 0.9.3", - "num-derive 0.3.3", - "num-traits", - "solana-program", - "spl-token 3.5.0", - "spl-token-2022 0.6.1", - "thiserror", + "spl-noop", ] [[package]] name = "spl-associated-token-account" -version = "2.0.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02693d7b36cea2b45318b87f22406909879226963296f31f4ebb0fc7f6e1aeb3" +checksum = "385e31c29981488f2820b2022d8e731aae3b02e6e18e2fd854e4c9a94dc44fc3" dependencies = [ "assert_matches", "borsh 0.10.3", - "num-derive 0.3.3", + "num-derive 0.4.1", "num-traits", "solana-program", - "spl-token 4.0.0", - "spl-token-2022 0.7.0", + "spl-token", + "spl-token-2022", "thiserror", ] @@ -4328,62 +4141,66 @@ dependencies = [ [[package]] name = "spl-discriminator-derive" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4fa8f409b5c5e0ac571df17c981ae1424b204743daa4428430627d38717caf5" +checksum = "fadbefec4f3c678215ca72bd71862697bb06b41fd77c0088902dd3203354387b" dependencies = [ - "quote 1.0.32", + "quote 1.0.33", "spl-discriminator-syn", - "syn 2.0.28", + "syn 2.0.38", ] [[package]] name = "spl-discriminator-syn" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21968d7da2f0a624c509f24580c3fee70b364a6886d90709e679e64f572eca2f" +checksum = "0e5f2044ca42c8938d54d1255ce599c79a1ffd86b677dfab695caa20f9ffc3f2" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "solana-program", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "sha2 0.10.8", + "syn 2.0.38", "thiserror", ] [[package]] name = "spl-memo" -version = "3.0.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd0dc6f70db6bacea7ff25870b016a65ba1d1b6013536f08e4fd79a8f9005325" +checksum = "f0f180b03318c3dbab3ef4e1e4d46d5211ae3c780940dd0a28695aba4b59a75a" dependencies = [ "solana-program", ] [[package]] name = "spl-noop" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558536c75b5aed018113bfca39cddb414cd7ca77da7658d668e751d977830cda" +checksum = "6dd67ea3d0070a12ff141f5da46f9695f49384a03bce1203a5608f5739437950" dependencies = [ "solana-program", ] [[package]] -name = "spl-noop" -version = "0.2.0" +name = "spl-pod" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd67ea3d0070a12ff141f5da46f9695f49384a03bce1203a5608f5739437950" +checksum = "2881dddfca792737c0706fa0175345ab282b1b0879c7d877bad129645737c079" dependencies = [ + "borsh 0.10.3", + "bytemuck", "solana-program", + "solana-zk-token-sdk", + "spl-program-error", ] [[package]] name = "spl-program-error" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af92f74cd3b0fdfda59fef4b571a92123e4df0f67cc43f73163975d31118ef82" +checksum = "249e0318493b6bcf27ae9902600566c689b7dfba9f1bdff5893e92253374e78c" dependencies = [ - "num-derive 0.3.3", + "num-derive 0.4.1", "num-traits", "solana-program", "spl-program-error-derive", @@ -4392,43 +4209,30 @@ dependencies = [ [[package]] name = "spl-program-error-derive" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "173f3cc506847882189b3a5b67299f617fed2f9730f122dd197b82e1e213dee5" +checksum = "ab5269c8e868da17b6552ef35a51355a017bd8e0eae269c201fef830d35fa52c" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "sha2 0.10.8", + "syn 2.0.38", ] [[package]] name = "spl-tlv-account-resolution" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82149a5a06b5f158d03904066375eaf0c8a2422557cc3d5a25d277260d9a3b16" +checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" dependencies = [ "bytemuck", "solana-program", "spl-discriminator", + "spl-pod", "spl-program-error", "spl-type-length-value", ] -[[package]] -name = "spl-token" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e85e168a785e82564160dcb87b2a8e04cee9bfd1f4d488c729d53d6a4bd300d" -dependencies = [ - "arrayref", - "bytemuck", - "num-derive 0.3.3", - "num-traits", - "num_enum 0.5.11", - "solana-program", - "thiserror", -] - [[package]] name = "spl-token" version = "4.0.0" @@ -4446,77 +4250,69 @@ dependencies = [ [[package]] name = "spl-token-2022" -version = "0.6.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0043b590232c400bad5ee9eb983ced003d15163c4c5d56b090ac6d9a57457b47" +checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" dependencies = [ "arrayref", "bytemuck", - "num-derive 0.3.3", + "num-derive 0.4.1", "num-traits", - "num_enum 0.5.11", + "num_enum 0.7.0", "solana-program", "solana-zk-token-sdk", "spl-memo", - "spl-token 3.5.0", + "spl-pod", + "spl-token", + "spl-token-metadata-interface", + "spl-transfer-hook-interface", + "spl-type-length-value", "thiserror", ] [[package]] -name = "spl-token-2022" -version = "0.7.0" +name = "spl-token-metadata-interface" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b24ac5786a3fefbf59f5606312c61abf87b23154e7a717e5d18216fbea4711db" +checksum = "4c16ce3ba6979645fb7627aa1e435576172dd63088dc7848cb09aa331fa1fe4f" dependencies = [ - "arrayref", - "bytemuck", - "num-derive 0.3.3", - "num-traits", - "num_enum 0.6.1", + "borsh 0.10.3", "solana-program", - "solana-zk-token-sdk", - "spl-memo", - "spl-token 4.0.0", - "spl-transfer-hook-interface", - "thiserror", + "spl-discriminator", + "spl-pod", + "spl-program-error", + "spl-type-length-value", ] [[package]] name = "spl-transfer-hook-interface" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a2326852adf88716fbac7f54cd6ee2c8a0b5a14ede24db3b4519c4ff13df04b" +checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" dependencies = [ "arrayref", "bytemuck", - "num-derive 0.3.3", - "num-traits", - "num_enum 0.6.1", "solana-program", "spl-discriminator", + "spl-pod", + "spl-program-error", "spl-tlv-account-resolution", "spl-type-length-value", - "thiserror", ] [[package]] name = "spl-type-length-value" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1d085f426b33b8365fb98383d1b8b3925e21bdfe579c851ceaa7f511dbec191" +checksum = "a468e6f6371f9c69aae760186ea9f1a01c2908351b06a5e0026d21cfc4d7ecac" dependencies = [ "bytemuck", "solana-program", "spl-discriminator", + "spl-pod", "spl-program-error", ] -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "strsim" version = "0.8.0" @@ -4552,19 +4348,19 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.28" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "unicode-ident", ] @@ -4574,30 +4370,51 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", + "proc-macro2 1.0.69", + "quote 1.0.33", "syn 1.0.109", "unicode-xid 0.2.4", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tempfile" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.3.5", + "redox_syscall", "rustix", "windows-sys 0.48.0", ] [[package]] name = "termcolor" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] @@ -4619,40 +4436,29 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.46" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9207952ae1a003f42d3d5e892dac3c6ba42aa6ac0c79a6a91a2b5cb4253e75c" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.46" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1728216d3244de4f14f14f8c15c79be1a7c67867d28d69b719690e2a19fb445" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] name = "time" -version = "0.1.45" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" +checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" dependencies = [ "deranged", "itoa", @@ -4663,15 +4469,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -4712,33 +4518,32 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.14.1" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d0183f6f6001549ab68f8c7585093bb732beefbcf6d23a10b9b95c73a1dd49" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", "mio", "num_cpus", - "once_cell", - "parking_lot 0.11.2", + "parking_lot", "pin-project-lite", "signal-hook-registry", + "socket2 0.5.4", "tokio-macros", - "winapi", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 1.0.109", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] @@ -4747,16 +4552,26 @@ version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls", + "rustls 0.20.9", "tokio", "webpki", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.7", + "tokio", +] + [[package]] name = "tokio-stream" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite", @@ -4771,19 +4586,19 @@ checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" dependencies = [ "futures-util", "log", - "rustls", + "rustls 0.20.9", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", "tungstenite", "webpki", - "webpki-roots", + "webpki-roots 0.22.6", ] [[package]] name = "tokio-util" -version = "0.7.2" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f988a1a1adc2fb21f9c12aa96441da33a1728193ae0b95d2be22dbd17fcb4e5c" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", @@ -4810,11 +4625,11 @@ checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "toml_datetime", "winnow", ] @@ -4843,9 +4658,9 @@ version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] @@ -4876,20 +4691,20 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls", + "rustls 0.20.9", "sha-1", "thiserror", "url", "utf-8", "webpki", - "webpki-roots", + "webpki-roots 0.22.6", ] [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" @@ -4899,9 +4714,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -4920,9 +4735,9 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -4961,6 +4776,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "uriparse" version = "0.6.4" @@ -4973,9 +4794,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -5021,12 +4842,6 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -5052,9 +4867,9 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -5076,7 +4891,7 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ - "quote 1.0.32", + "quote 1.0.33", "wasm-bindgen-macro-support", ] @@ -5086,9 +4901,9 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5111,12 +4926,12 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.0" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring", - "untrusted", + "ring 0.17.3", + "untrusted 0.9.0", ] [[package]] @@ -5128,6 +4943,12 @@ dependencies = [ "webpki", ] +[[package]] +name = "webpki-roots" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" + [[package]] name = "winapi" version = "0.3.9" @@ -5146,9 +4967,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -5165,7 +4986,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.2", + "windows-targets 0.48.5", ] [[package]] @@ -5198,7 +5019,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.2", + "windows-targets 0.48.5", ] [[package]] @@ -5218,17 +5039,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1eeca1c172a285ee6c2c84c341ccea837e7c01b12fbb2d0fe3c9e550ce49ec8" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.2", - "windows_aarch64_msvc 0.48.2", - "windows_i686_gnu 0.48.2", - "windows_i686_msvc 0.48.2", - "windows_x86_64_gnu 0.48.2", - "windows_x86_64_gnullvm 0.48.2", - "windows_x86_64_msvc 0.48.2", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -5239,9 +5060,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10d0c968ba7f6166195e13d593af609ec2e3d24f916f081690695cf5eaffb2f" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -5251,9 +5072,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571d8d4e62f26d4932099a9efe89660e8bd5087775a2ab5cdd8b747b811f1058" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -5263,9 +5084,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2229ad223e178db5fbbc8bd8d3835e51e566b8474bfca58d2e6150c48bb723cd" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -5275,9 +5096,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "600956e2d840c194eedfc5d18f8242bc2e17c7775b6684488af3a9fff6fe3287" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -5287,9 +5108,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea99ff3f8b49fb7a8e0d305e5aec485bd068c2ba691b6e277d29eaeac945868a" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -5299,9 +5120,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1a05a1ece9a7a0d5a7ccf30ba2c33e3a61a30e042ffd247567d1de1d94120d" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -5311,26 +5132,27 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d419259aba16b663966e29e6d7c6ecfa0bb8425818bb96f6f1f3c3eb71a6e7b9" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.10" +version = "0.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5504cc7644f4b593cbc05c4a55bf9bd4e94b867c3c0bd440934174d50482427d" +checksum = "037711d82167854aff2018dfd193aa0fef5370f456732f0d5a0c59b0f1b4b907" dependencies = [ "memchr", ] [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] @@ -5348,7 +5170,7 @@ dependencies = [ "oid-registry", "rusticata-macros", "thiserror", - "time 0.3.25", + "time", ] [[package]] @@ -5357,7 +5179,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ - "time 0.3.25", + "time", ] [[package]] @@ -5375,9 +5197,9 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "proc-macro2 1.0.66", - "quote 1.0.32", - "syn 2.0.28", + "proc-macro2 1.0.69", + "quote 1.0.33", + "syn 2.0.38", ] [[package]] @@ -5401,11 +5223,10 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/blockbuster/Cargo.toml b/blockbuster/Cargo.toml index cda936e4..cfb0415b 100644 --- a/blockbuster/Cargo.toml +++ b/blockbuster/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "blockbuster" description = "Metaplex canonical program parsers, for indexing, analytics etc...." -version = "0.8.0" +version = "1.0.1" authors = ["Metaplex Developers "] repository = "https://github.com/metaplex-foundation/blockbuster" license = "AGPL-3.0" @@ -9,28 +9,33 @@ edition = "2021" readme = "../README.md" [dependencies] -spl-account-compression = { version = "0.2.0", features = ["no-entrypoint"] } -spl-noop = { version = "0.1.3", features = ["no-entrypoint"] } -mpl-bubblegum = { version = "0.10.1", features = ["no-entrypoint"] } -mpl-candy-guard = { version="2.0.0", features = ["no-entrypoint"] } -mpl-candy-machine-core = { version = "2.0.0", features = ["no-entrypoint"] } -mpl-token-metadata = { version = "2.0.0-beta.1", features = ["no-entrypoint", "serde-feature"] } +bytemuck = { version = "1.14.0", features = ["derive"] } +spl-token-2022 = { version = "1.0", features = ["no-entrypoint"] } +spl-account-compression = { version = "0.3.0", features = ["no-entrypoint"] } +spl-noop = { version = "0.2.0", features = ["no-entrypoint"] } +mpl-bubblegum = "1.2.0" +mpl-token-metadata = { version = "4.1.1", features = ["serde"] } plerkle_serialization = { version = "1.6.0" } -spl-token = { version = ">= 3.5.0, < 5.0", features = ["no-entrypoint"] } +spl-token = { version = "4.0.0", features = ["no-entrypoint"] } async-trait = "0.1.57" -bs58="0.4.0" +bs58 = "0.4.0" lazy_static = "1.4.0" flatbuffers = "23.1.21" borsh = "~0.10.3" thiserror = "1.0.32" -solana-sdk = "~1.16.5" -anchor-lang = { version = "0.28.0"} log = "0.4.17" +solana-sdk = "1.17.16" +spl-token-metadata-interface = "0.2.0" +spl-token-group-interface = "0.1.0" +spl-pod = { version = "0.1.0", features = ["serde-traits"] } +serde = "1.0.140" +solana-zk-token-sdk = "1.17.16" +anchor-lang = { version = "0.29.0"} [dev-dependencies] rand = "0.8.5" spl-concurrent-merkle-tree = "0.2.0" -solana-client = "~1.16.5" -solana-transaction-status = "~1.16.5" -solana-geyser-plugin-interface = "~1.16.5" +solana-client = "1.17.16" +solana-transaction-status = "1.17.16" +solana-geyser-plugin-interface = "1.17.16" serde_json="1.0.89" diff --git a/blockbuster/src/program_handler.rs b/blockbuster/src/program_handler.rs index 45ab2e4d..0016e4cf 100644 --- a/blockbuster/src/program_handler.rs +++ b/blockbuster/src/program_handler.rs @@ -1,7 +1,7 @@ use crate::{ error::BlockbusterError, instruction::InstructionBundle, programs::ProgramParseResult, }; -use plerkle_serialization::{AccountInfo}; +use plerkle_serialization::AccountInfo; use solana_sdk::pubkey::Pubkey; pub trait ParseResult: Sync + Send { diff --git a/blockbuster/src/programs/bubblegum/mod.rs b/blockbuster/src/programs/bubblegum/mod.rs index 8be8f0be..fa22d8a0 100644 --- a/blockbuster/src/programs/bubblegum/mod.rs +++ b/blockbuster/src/programs/bubblegum/mod.rs @@ -10,12 +10,14 @@ use crate::{program_handler::NotUsed, programs::ProgramParseResult}; use borsh::de::BorshDeserialize; use mpl_bubblegum::{ get_instruction_type, - state::{metaplex_adapter::MetadataArgs, BubblegumEventType}, + instructions::{ + UnverifyCreatorInstructionArgs, UpdateMetadataInstructionArgs, VerifyCreatorInstructionArgs, + }, + types::{BubblegumEventType, MetadataArgs, UpdateArgs}, }; pub use mpl_bubblegum::{ - id as program_id, - state::leaf_schema::{LeafSchema, LeafSchemaEvent}, - InstructionName, + types::{LeafSchema, UseMethod}, + InstructionName, LeafSchemaEvent, ID, }; use plerkle_serialization::AccountInfo; use solana_sdk::pubkey::Pubkey; @@ -29,11 +31,31 @@ use spl_noop; #[derive(Eq, PartialEq)] pub enum Payload { Unknown, - MintV1 { args: MetadataArgs }, - Decompress { args: MetadataArgs }, - CancelRedeem { root: [u8; 32] }, - CreatorVerification { creator: Pubkey, verify: bool }, - CollectionVerification { collection: Pubkey, verify: bool }, + MintV1 { + args: MetadataArgs, + authority: [u8; 32], + tree_id: [u8; 32], + }, + Decompress { + args: MetadataArgs, + }, + CancelRedeem { + root: [u8; 32], + }, + CreatorVerification { + metadata: MetadataArgs, + creator: Pubkey, + verify: bool, + }, + CollectionVerification { + collection: Pubkey, + verify: bool, + }, + UpdateMetadata { + current_metadata: MetadataArgs, + update_args: UpdateArgs, + tree_id: [u8; 32], + }, } //TODO add more of the parsing here to minimize program transformer code pub struct BubblegumInstruction { @@ -70,11 +92,11 @@ pub struct BubblegumParser; impl ProgramParser for BubblegumParser { fn key(&self) -> Pubkey { - program_id() + ID } fn key_match(&self, key: &Pubkey) -> bool { - key == &program_id() + key == &ID } fn handles_account_updates(&self) -> bool { false @@ -169,15 +191,11 @@ impl ProgramParser for BubblegumParser { if !ix_data.is_empty() { match b_inst.instruction { InstructionName::MintV1 => { - let args: MetadataArgs = MetadataArgs::try_from_slice(ix_data)?; - b_inst.payload = Some(Payload::MintV1 { args }); + b_inst.payload = Some(build_mint_v1_payload(keys, ix_data, false)?); } + InstructionName::MintToCollectionV1 => { - let mut args: MetadataArgs = MetadataArgs::try_from_slice(ix_data)?; - if let Some(ref mut col) = args.collection { - col.verified = true; - } - b_inst.payload = Some(Payload::MintV1 { args }); + b_inst.payload = Some(build_mint_v1_payload(keys, ix_data, true)?); } InstructionName::DecompressV1 => { let args: MetadataArgs = MetadataArgs::try_from_slice(ix_data)?; @@ -190,10 +208,12 @@ impl ProgramParser for BubblegumParser { b_inst.payload = Some(Payload::CancelRedeem { root: slice }); } InstructionName::VerifyCreator => { - b_inst.payload = Some(build_creator_verification_payload(keys, true)?); + b_inst.payload = + Some(build_creator_verification_payload(keys, ix_data, true)?); } InstructionName::UnverifyCreator => { - b_inst.payload = Some(build_creator_verification_payload(keys, false)?); + b_inst.payload = + Some(build_creator_verification_payload(keys, ix_data, false)?); } InstructionName::VerifyCollection | InstructionName::SetAndVerifyCollection => { b_inst.payload = Some(build_collection_verification_payload(keys, true)?); @@ -201,7 +221,9 @@ impl ProgramParser for BubblegumParser { InstructionName::UnverifyCollection => { b_inst.payload = Some(build_collection_verification_payload(keys, false)?); } - InstructionName::Unknown => {} + InstructionName::UpdateMetadata => { + b_inst.payload = Some(build_update_metadata_payload(keys, ix_data)?); + } _ => {} }; } @@ -215,13 +237,22 @@ impl ProgramParser for BubblegumParser { // https://github.com/metaplex-foundation/mpl-bubblegum/blob/main/programs/bubblegum/README.md#-verify_creator-and-unverify_creator fn build_creator_verification_payload( keys: &[plerkle_serialization::Pubkey], + ix_data: &[u8], verify: bool, ) -> Result { + let metadata = if verify { + VerifyCreatorInstructionArgs::try_from_slice(ix_data)?.metadata + } else { + UnverifyCreatorInstructionArgs::try_from_slice(ix_data)?.metadata + }; + let creator = keys .get(5) .ok_or(BlockbusterError::InstructionParsingError)? .0; + Ok(Payload::CreatorVerification { + metadata, creator: Pubkey::new_from_array(creator), verify, }) @@ -229,7 +260,7 @@ fn build_creator_verification_payload( // See Bubblegum for offsets and positions: // https://github.com/metaplex-foundation/mpl-bubblegum/blob/main/programs/bubblegum/README.md#-verify_collection-unverify_collection-and-set_and_verify_collection -// NOTE: Unverfication does not include collection. This needs to be fixed in the README. +// This uses the account. The collection is only provided as an argument for `set_and_verify_collection`. fn build_collection_verification_payload( keys: &[plerkle_serialization::Pubkey], verify: bool, @@ -241,3 +272,54 @@ fn build_collection_verification_payload( let collection: Pubkey = Pubkey::try_from_slice(&collection_raw)?; Ok(Payload::CollectionVerification { collection, verify }) } + +// See Bubblegum for offsets and positions: +// https://github.com/metaplex-foundation/mpl-bubblegum/blob/main/programs/bubblegum/README.md +fn build_mint_v1_payload( + keys: &[plerkle_serialization::Pubkey], + ix_data: &[u8], + set_verify: bool, +) -> Result { + let mut args: MetadataArgs = MetadataArgs::try_from_slice(ix_data)?; + if set_verify { + if let Some(ref mut col) = args.collection { + col.verified = true; + } + } + + let authority = keys + .get(0) + .ok_or(BlockbusterError::InstructionParsingError)? + .0; + + let tree_id = keys + .get(3) + .ok_or(BlockbusterError::InstructionParsingError)? + .0; + + Ok(Payload::MintV1 { + args, + authority, + tree_id, + }) +} + +// See Bubblegum for offsets and positions: +// https://github.com/metaplex-foundation/mpl-bubblegum/blob/main/programs/bubblegum/README.md +fn build_update_metadata_payload( + keys: &[plerkle_serialization::Pubkey], + ix_data: &[u8], +) -> Result { + let args = UpdateMetadataInstructionArgs::try_from_slice(ix_data)?; + + let tree_id = keys + .get(8) + .ok_or(BlockbusterError::InstructionParsingError)? + .0; + + Ok(Payload::UpdateMetadata { + current_metadata: args.current_metadata, + update_args: args.update_args, + tree_id, + }) +} diff --git a/blockbuster/src/programs/candy_guard/mod.rs b/blockbuster/src/programs/candy_guard/mod.rs deleted file mode 100644 index 5cb46f7a..00000000 --- a/blockbuster/src/programs/candy_guard/mod.rs +++ /dev/null @@ -1,83 +0,0 @@ -use crate::{ - error::BlockbusterError, - program_handler::{ParseResult, ProgramParser}, - programs::ProgramParseResult, -}; -use mpl_candy_guard::{ - guards::MintCounter, - state::{CandyGuard, CandyGuardData, DATA_OFFSET}, -}; -use plerkle_serialization::AccountInfo; -use solana_sdk::{borsh0_10::try_from_slice_unchecked, pubkey::Pubkey, pubkeys}; -use std::convert::TryInto; - -pubkeys!( - candy_guard_id, - "Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g" -); - -// Anchor account discriminators. -const CANDY_GUARD_DISCRIMINATOR: [u8; 8] = [44, 207, 199, 184, 112, 103, 34, 181]; -const MINT_COUNTER_DISCRIMINATOR: [u8; 8] = [29, 59, 15, 69, 46, 22, 227, 173]; - -pub enum CandyGuardAccountData { - CandyGuard(CandyGuard, Box), - MintCounter(MintCounter), -} - -impl ParseResult for CandyGuardAccountData { - fn result_type(&self) -> ProgramParseResult { - ProgramParseResult::CandyGuard(self) - } -} - -pub struct CandyGuardParser; - -impl ProgramParser for CandyGuardParser { - fn key(&self) -> Pubkey { - candy_guard_id() - } - - fn key_match(&self, key: &Pubkey) -> bool { - key == &candy_guard_id() - } - fn handles_account_updates(&self) -> bool { - true - } - - fn handles_instructions(&self) -> bool { - false - } - fn handle_account( - &self, - account_info: &AccountInfo, - ) -> Result, BlockbusterError> { - let account_data = if let Some(account_info) = account_info.data() { - account_info.iter().collect::>() - } else { - return Err(BlockbusterError::DeserializationError); - }; - - let discriminator: [u8; 8] = account_data[0..8].try_into().unwrap(); - - let account_type = match discriminator { - CANDY_GUARD_DISCRIMINATOR => { - let candy_guard = try_from_slice_unchecked(&account_data[8..])?; - let candy_guard_data = - CandyGuardData::load(&account_data[DATA_OFFSET..]).map_err(|_| { - BlockbusterError::CustomDeserializationError( - "Candy Guard Data Deserialization Error".to_string(), - ) - })?; - CandyGuardAccountData::CandyGuard(candy_guard, candy_guard_data) - } - MINT_COUNTER_DISCRIMINATOR => { - let mint_counter = try_from_slice_unchecked(&account_data[8..])?; - CandyGuardAccountData::MintCounter(mint_counter) - } - _ => return Err(BlockbusterError::UnknownAccountDiscriminator), - }; - - Ok(Box::new(account_type)) - } -} diff --git a/blockbuster/src/programs/candy_machine/mod.rs b/blockbuster/src/programs/candy_machine/mod.rs deleted file mode 100644 index 5aabc34f..00000000 --- a/blockbuster/src/programs/candy_machine/mod.rs +++ /dev/null @@ -1,91 +0,0 @@ -use crate::{ - error::BlockbusterError, - program_handler::{ParseResult, ProgramParser}, - programs::{ - candy_machine::state::{CandyMachine, CollectionPDA, FreezePDA}, - ProgramParseResult, - }, -}; -use plerkle_serialization::AccountInfo; -use solana_sdk::{borsh0_10::try_from_slice_unchecked, pubkey::Pubkey, pubkeys}; -use std::convert::TryInto; - -pub mod state; - -pubkeys!( - candy_machine_id, - "cndy3Z4yapfJBmL3ShUp5exZKqR3z33thTzeNMm2gRZ" -); - -// Anchor account discriminators. -pub const CANDY_MACHINE_DISCRIMINATOR: [u8; 8] = [51, 173, 177, 113, 25, 241, 109, 189]; -pub const COLLECTION_PDA_DISCRIMINATOR: [u8; 8] = [203, 128, 119, 125, 234, 89, 232, 157]; -pub const FREEZE_PDA_DISCRIMINATOR: [u8; 8] = [154, 58, 148, 24, 101, 200, 243, 127]; - -#[allow(clippy::large_enum_variant)] -pub enum CandyMachineAccountData { - CandyMachine(CandyMachine), - CollectionPDA(CollectionPDA), - FreezePDA(FreezePDA), -} - -impl ParseResult for CandyMachineAccountData { - fn result(&self) -> &Self - where - Self: Sized, - { - self - } - fn result_type(&self) -> ProgramParseResult { - ProgramParseResult::CandyMachine(self) - } -} - -pub struct CandyMachineParser; - -impl ProgramParser for CandyMachineParser { - fn key(&self) -> Pubkey { - candy_machine_id() - } - - fn key_match(&self, key: &Pubkey) -> bool { - key == &candy_machine_id() - } - fn handles_account_updates(&self) -> bool { - true - } - - fn handles_instructions(&self) -> bool { - false - } - fn handle_account( - &self, - account_info: &AccountInfo, - ) -> Result, BlockbusterError> { - let account_data = if let Some(account_info) = account_info.data() { - account_info.iter().collect::>() - } else { - return Err(BlockbusterError::DeserializationError); - }; - - let discriminator: [u8; 8] = account_data[0..8].try_into().unwrap(); - - let account_type = match discriminator { - CANDY_MACHINE_DISCRIMINATOR => { - let candy_machine = try_from_slice_unchecked(&account_data[8..])?; - CandyMachineAccountData::CandyMachine(candy_machine) - } - COLLECTION_PDA_DISCRIMINATOR => { - let collection_pda = try_from_slice_unchecked(&account_data[8..])?; - CandyMachineAccountData::CollectionPDA(collection_pda) - } - FREEZE_PDA_DISCRIMINATOR => { - let freeze_pda = try_from_slice_unchecked(&account_data[8..])?; - CandyMachineAccountData::FreezePDA(freeze_pda) - } - _ => return Err(BlockbusterError::UnknownAccountDiscriminator), - }; - - Ok(Box::new(account_type)) - } -} diff --git a/blockbuster/src/programs/candy_machine/state.rs b/blockbuster/src/programs/candy_machine/state.rs deleted file mode 100644 index f3d9f27a..00000000 --- a/blockbuster/src/programs/candy_machine/state.rs +++ /dev/null @@ -1,123 +0,0 @@ -/// These are copied over from mpl-candy-machine due to current Solana/Anchor version conflict -/// between that program and mpl-bubblegum, spl-account-compression, and spl-noop. -use borsh::{BorshDeserialize, BorshSerialize}; -use solana_sdk::pubkey::Pubkey; - -/// Candy machine state and config data. -#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Default, Debug, Clone)] -pub struct CandyMachine { - pub authority: Pubkey, - pub wallet: Pubkey, - pub token_mint: Option, - pub items_redeemed: u64, - pub data: CandyMachineData, - // there's a borsh vec u32 denoting how many actual lines of data there are currently (eventually equals items available) - // There is actually lines and lines of data after this but we explicitly never want them deserialized. - // here there is a borsh vec u32 indicating number of bytes in bitmask array. - // here there is a number of bytes equal to ceil(max_number_of_lines/8) and it is a bit mask used to figure out when to increment borsh vec u32 -} - -/// Collection PDA account -#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Default, Debug, Clone)] -pub struct CollectionPDA { - pub mint: Pubkey, - pub candy_machine: Pubkey, -} - -/// Collection PDA account -#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Default, Debug, Clone)] -pub struct FreezePDA { - // duplicate key in order to find the candy machine without txn crawling - pub candy_machine: Pubkey, // 32 - pub allow_thaw: bool, // 1 - pub frozen_count: u64, // 8 - pub mint_start: Option, // 1 + 8 - pub freeze_time: i64, // 8 - pub freeze_fee: u64, // 8 -} - -/// Candy machine settings data. -#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Default, Debug, Clone)] -pub struct CandyMachineData { - pub uuid: String, - pub price: u64, - /// The symbol for the asset - pub symbol: String, - /// Royalty basis points that goes to creators in secondary sales (0-10000) - pub seller_fee_basis_points: u16, - pub max_supply: u64, - pub is_mutable: bool, - pub retain_authority: bool, - pub go_live_date: Option, - pub end_settings: Option, - pub creators: Vec, - pub hidden_settings: Option, - pub whitelist_mint_settings: Option, - pub items_available: u64, - /// If [`Some`] requires gateway tokens on mint - pub gatekeeper: Option, -} - -/// Individual config line for storing NFT data pre-mint. -#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] -pub struct ConfigLine { - pub name: String, - /// URI pointing to JSON representing the asset - pub uri: String, -} - -#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] -pub struct EndSettings { - pub end_setting_type: EndSettingType, - pub number: u64, -} - -#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] -pub enum EndSettingType { - Date, - Amount, -} - -// Unfortunate duplication of token metadata so that IDL picks it up. -#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] -pub struct Creator { - pub address: Pubkey, - pub verified: bool, - // In percentages, NOT basis points ;) Watch out! - pub share: u8, -} - -/// Hidden Settings for large mints used with offline data. -#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] -pub struct HiddenSettings { - pub name: String, - pub uri: String, - pub hash: [u8; 32], -} - -#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] -pub struct WhitelistMintSettings { - pub mode: WhitelistMintMode, - pub mint: Pubkey, - pub presale: bool, - pub discount_price: Option, -} - -#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Debug, Clone)] -pub enum WhitelistMintMode { - // Only captcha uses the bytes, the others just need to have same length - // for front end borsh to not crap itself - // Holds the validation window - BurnEveryTime, - NeverBurn, -} - -/// Configurations options for the gatekeeper. -#[derive(BorshSerialize, BorshDeserialize, PartialEq, Eq, Default, Debug, Clone)] -pub struct GatekeeperConfig { - /// The network for the gateway token required - pub gatekeeper_network: Pubkey, - /// Whether or not the token should expire after minting. - /// The gatekeeper network must support this if true. - pub expire_on_use: bool, -} diff --git a/blockbuster/src/programs/candy_machine_core/mod.rs b/blockbuster/src/programs/candy_machine_core/mod.rs deleted file mode 100644 index daea16b3..00000000 --- a/blockbuster/src/programs/candy_machine_core/mod.rs +++ /dev/null @@ -1,68 +0,0 @@ -use crate::{ - error::BlockbusterError, - program_handler::{ParseResult, ProgramParser}, - programs::ProgramParseResult, -}; -use mpl_candy_machine_core::CandyMachine; -use plerkle_serialization::AccountInfo; -use solana_sdk::{borsh0_10::try_from_slice_unchecked, pubkey::Pubkey, pubkeys}; -use std::convert::TryInto; - -pubkeys!( - candy_machine_core_id, - "CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR" -); - -// Anchor account discriminators. -const CANDY_MACHINE_DISCRIMINATOR: [u8; 8] = [51, 173, 177, 113, 25, 241, 109, 189]; - -pub enum CandyMachineCoreAccountData { - CandyMachineCore(CandyMachine), -} - -impl ParseResult for CandyMachineCoreAccountData { - fn result_type(&self) -> ProgramParseResult { - ProgramParseResult::CandyMachineCore(self) - } -} - -pub struct CandyMachineParser; - -impl ProgramParser for CandyMachineParser { - fn key(&self) -> Pubkey { - candy_machine_core_id() - } - - fn key_match(&self, key: &Pubkey) -> bool { - key == &candy_machine_core_id() - } - fn handles_account_updates(&self) -> bool { - true - } - - fn handles_instructions(&self) -> bool { - false - } - fn handle_account( - &self, - account_info: &AccountInfo, - ) -> Result, BlockbusterError> { - let account_data = if let Some(account_info) = account_info.data() { - account_info.iter().collect::>() - } else { - return Err(BlockbusterError::DeserializationError); - }; - - let discriminator: [u8; 8] = account_data[0..8].try_into().unwrap(); - - let account_type = match discriminator { - CANDY_MACHINE_DISCRIMINATOR => { - let candy_machine = try_from_slice_unchecked(&account_data[8..])?; - CandyMachineCoreAccountData::CandyMachineCore(candy_machine) - } - _ => return Err(BlockbusterError::UnknownAccountDiscriminator), - }; - - Ok(Box::new(account_type)) - } -} diff --git a/blockbuster/src/programs/mod.rs b/blockbuster/src/programs/mod.rs index 46aa0f06..5cd6f736 100644 --- a/blockbuster/src/programs/mod.rs +++ b/blockbuster/src/programs/mod.rs @@ -1,23 +1,31 @@ use bubblegum::BubblegumInstruction; -use candy_guard::CandyGuardAccountData; -use candy_machine::CandyMachineAccountData; -use candy_machine_core::CandyMachineCoreAccountData; use token_account::TokenProgramAccount; +use token_extensions::TokenExtensionsProgramAccount; use token_metadata::TokenMetadataAccountState; pub mod bubblegum; -pub mod candy_guard; -pub mod candy_machine; -pub mod candy_machine_core; pub mod token_account; +pub mod token_extensions; pub mod token_metadata; +// Note: `ProgramParseResult` used to contain the following variants that have been deprecated and +// removed from blockbuster since the `version-1.16` tag: +// CandyGuard(&'a CandyGuardAccountData), +// CandyMachine(&'a CandyMachineAccountData), +// CandyMachineCore(&'a CandyMachineCoreAccountData), +// +// Candy Machine V3 parsing was removed because Candy Guard (`mpl-candy-guard`) and +// Candy Machine Core (`mpl-candy-machine-core`) were dependent upon a specific Solana +// version (1.16), there was no Candy Machine parsing in DAS (`digital-asset-rpc-infrastructure`), +// and we wanted to use the Rust clients for Bubblegum and Token Metadata so that going forward we +// could more easily update blockbuster to new Solana versions. +// +// Candy Machine V2 (`mpl-candy-machine`) parsing was removed at the same time as V3 because even +// though it did not depend on the `mpl-candy-machine` crate, it was also not being used by DAS. pub enum ProgramParseResult<'a> { Bubblegum(&'a BubblegumInstruction), TokenMetadata(&'a TokenMetadataAccountState), TokenProgramAccount(&'a TokenProgramAccount), - CandyGuard(&'a CandyGuardAccountData), - CandyMachine(&'a CandyMachineAccountData), - CandyMachineCore(&'a CandyMachineCoreAccountData), + TokenExtensionsProgramAccount(&'a TokenExtensionsProgramAccount), Unknown, } diff --git a/blockbuster/src/programs/token_extensions/extension.rs b/blockbuster/src/programs/token_extensions/extension.rs new file mode 100644 index 00000000..d186fe86 --- /dev/null +++ b/blockbuster/src/programs/token_extensions/extension.rs @@ -0,0 +1,547 @@ +use bytemuck::Zeroable; +use serde::{Deserialize, Serialize}; +use solana_zk_token_sdk::zk_token_elgamal::pod::{AeCiphertext, ElGamalCiphertext, ElGamalPubkey}; +use spl_pod::{ + optional_keys::{OptionalNonZeroElGamalPubkey, OptionalNonZeroPubkey}, + primitives::{PodBool, PodI64, PodU16, PodU32, PodU64}, +}; + +use spl_token_2022::extension::{ + confidential_transfer::{ConfidentialTransferAccount, ConfidentialTransferMint}, + confidential_transfer_fee::{ConfidentialTransferFeeAmount, ConfidentialTransferFeeConfig}, + cpi_guard::CpiGuard, + default_account_state::DefaultAccountState, + group_member_pointer::GroupMemberPointer, + group_pointer::GroupPointer, + immutable_owner::ImmutableOwner, + interest_bearing_mint::{BasisPoints, InterestBearingConfig}, + memo_transfer::MemoTransfer, + metadata_pointer::MetadataPointer, + mint_close_authority::MintCloseAuthority, + permanent_delegate::PermanentDelegate, + transfer_fee::{TransferFee, TransferFeeAmount, TransferFeeConfig}, + transfer_hook::TransferHook, +}; +use std::fmt; + +use spl_token_group_interface::state::{TokenGroup, TokenGroupMember}; +use spl_token_metadata_interface::state::TokenMetadata; + +const AE_CIPHERTEXT_LEN: usize = 36; +const UNIT_LEN: usize = 32; +const RISTRETTO_POINT_LEN: usize = UNIT_LEN; +pub(crate) const DECRYPT_HANDLE_LEN: usize = RISTRETTO_POINT_LEN; +pub(crate) const PEDERSEN_COMMITMENT_LEN: usize = RISTRETTO_POINT_LEN; +const ELGAMAL_PUBKEY_LEN: usize = RISTRETTO_POINT_LEN; +const ELGAMAL_CIPHERTEXT_LEN: usize = PEDERSEN_COMMITMENT_LEN + DECRYPT_HANDLE_LEN; +type PodAccountState = u8; +pub type UnixTimestamp = PodI64; +pub type EncryptedBalance = ShadowElGamalCiphertext; +pub type DecryptableBalance = ShadowAeCiphertext; +pub type EncryptedWithheldAmount = ShadowElGamalCiphertext; + +use serde::{ + de::{self, SeqAccess, Visitor}, + Deserializer, Serializer, +}; + +/// Bs58 encoded public key string. Used for storing Pubkeys in a human readable format. +/// Ideally we'd store them as is in the DB and later convert them to bs58 for display on the API. +/// But, +/// - We currently store them in DB as JSONB. +/// - `Pubkey` serializes to an u8 vector, unlike sth like `OptionalNonZeroElGamalPubkey` which serializes to a string. +/// So `Pubkey` is stored as a u8 vector in the DB. +/// - `Pubkey` doesn't implement something like `schemars::JsonSchema` so we can't convert them back to the rust struct either. +type PublicKeyString = String; + +struct ShadowAeCiphertextVisitor; + +struct ShadowElGamalCiphertextVisitor; + +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct ShadowAeCiphertext(pub [u8; AE_CIPHERTEXT_LEN]); + +#[derive(Clone, Copy, Debug, PartialEq, Zeroable)] +pub struct ShadowElGamalCiphertext(pub [u8; ELGAMAL_CIPHERTEXT_LEN]); + +#[derive(Clone, Copy, Debug, Default, Zeroable, PartialEq, Eq, Serialize, Deserialize)] +pub struct ShadowElGamalPubkey(pub [u8; ELGAMAL_PUBKEY_LEN]); + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowCpiGuard { + pub lock_cpi: PodBool, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowDefaultAccountState { + pub state: PodAccountState, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowImmutableOwner; + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowInterestBearingConfig { + pub rate_authority: OptionalNonZeroPubkey, + pub initialization_timestamp: UnixTimestamp, + pub pre_update_average_rate: BasisPoints, + pub last_update_timestamp: UnixTimestamp, + pub current_rate: BasisPoints, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowMemoTransfer { + /// Require transfers into this account to be accompanied by a memo + pub require_incoming_transfer_memos: PodBool, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowMetadataPointer { + pub authority: OptionalNonZeroPubkey, + pub metadata_address: OptionalNonZeroPubkey, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowGroupMemberPointer { + pub authority: OptionalNonZeroPubkey, + pub member_address: OptionalNonZeroPubkey, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowGroupPointer { + /// Authority that can set the group address + pub authority: OptionalNonZeroPubkey, + /// Account address that holds the group + pub group_address: OptionalNonZeroPubkey, +} + +#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +pub struct ShadowTokenGroup { + /// The authority that can sign to update the group + pub update_authority: OptionalNonZeroPubkey, + /// The associated mint, used to counter spoofing to be sure that group + /// belongs to a particular mint + pub mint: PublicKeyString, + /// The current number of group members + pub size: PodU32, + /// The maximum number of group members + pub max_size: PodU32, +} + +#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +pub struct ShadowTokenGroupMember { + /// The associated mint, used to counter spoofing to be sure that member + /// belongs to a particular mint + pub mint: PublicKeyString, + /// The pubkey of the `TokenGroup` + pub group: PublicKeyString, + /// The member number + pub member_number: PodU32, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowMintCloseAuthority { + pub close_authority: OptionalNonZeroPubkey, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct NonTransferableAccount; + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowPermanentDelegate { + pub delegate: OptionalNonZeroPubkey, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowTransferFee { + pub epoch: PodU64, + pub maximum_fee: PodU64, + pub transfer_fee_basis_points: PodU16, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowTransferHook { + pub authority: OptionalNonZeroPubkey, + pub program_id: OptionalNonZeroPubkey, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowConfidentialTransferMint { + pub authority: OptionalNonZeroPubkey, + pub auto_approve_new_accounts: PodBool, + pub auditor_elgamal_pubkey: OptionalNonZeroElGamalPubkey, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize)] +pub struct ShadowConfidentialTransferAccount { + pub approved: PodBool, + pub elgamal_pubkey: ShadowElGamalPubkey, + pub pending_balance_lo: EncryptedBalance, + pub pending_balance_hi: EncryptedBalance, + pub available_balance: EncryptedBalance, + pub decryptable_available_balance: DecryptableBalance, + pub allow_confidential_credits: PodBool, + pub allow_non_confidential_credits: PodBool, + pub pending_balance_credit_counter: PodU64, + pub maximum_pending_balance_credit_counter: PodU64, + pub expected_pending_balance_credit_counter: PodU64, + pub actual_pending_balance_credit_counter: PodU64, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowConfidentialTransferFeeConfig { + pub authority: OptionalNonZeroPubkey, + pub withdraw_withheld_authority_elgamal_pubkey: ShadowElGamalPubkey, + pub harvest_to_mint_enabled: PodBool, + pub withheld_amount: EncryptedWithheldAmount, +} + +pub struct ShadowConfidentialTransferFeeAmount { + pub withheld_amount: EncryptedWithheldAmount, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowTransferFeeAmount { + pub withheld_amount: PodU64, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Zeroable, Serialize, Deserialize)] +pub struct ShadowTransferFeeConfig { + pub transfer_fee_config_authority: OptionalNonZeroPubkey, + pub withdraw_withheld_authority: OptionalNonZeroPubkey, + pub withheld_amount: PodU64, + pub older_transfer_fee: ShadowTransferFee, + pub newer_transfer_fee: ShadowTransferFee, +} + +#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +pub struct ShadowMetadata { + pub update_authority: OptionalNonZeroPubkey, + pub mint: PublicKeyString, + pub name: String, + pub symbol: String, + pub uri: String, + pub additional_metadata: Vec<(String, String)>, +} + +impl Serialize for ShadowAeCiphertext { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_bytes(&self.0) + } +} + +impl<'de> Visitor<'de> for ShadowElGamalCiphertextVisitor { + type Value = ShadowElGamalCiphertext; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a byte array of length ELGAMAL_CIPHERTEXT_LEN") + } + + fn visit_bytes(self, v: &[u8]) -> Result + where + E: de::Error, + { + if v.len() == ELGAMAL_CIPHERTEXT_LEN { + let mut arr = [0u8; ELGAMAL_CIPHERTEXT_LEN]; + arr.copy_from_slice(v); + Ok(ShadowElGamalCiphertext(arr)) + } else { + Err(E::invalid_length(v.len(), &self)) + } + } +} + +impl<'de> Deserialize<'de> for ShadowElGamalCiphertext { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_bytes(ShadowElGamalCiphertextVisitor) + } +} + +impl Default for ShadowElGamalCiphertext { + fn default() -> Self { + ShadowElGamalCiphertext([0u8; ELGAMAL_CIPHERTEXT_LEN]) + } +} + +impl Default for ShadowAeCiphertext { + fn default() -> Self { + ShadowAeCiphertext([0u8; AE_CIPHERTEXT_LEN]) + } +} + +impl<'de> Visitor<'de> for ShadowAeCiphertextVisitor { + type Value = ShadowAeCiphertext; + + fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + formatter.write_str("a byte array of length AE_CIPHERTEXT_LEN") + } + + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + let mut arr = [0u8; AE_CIPHERTEXT_LEN]; + for i in 0..AE_CIPHERTEXT_LEN { + arr[i] = seq + .next_element()? + .ok_or(de::Error::invalid_length(i, &self))?; + } + Ok(ShadowAeCiphertext(arr)) + } +} + +impl<'de> Deserialize<'de> for ShadowAeCiphertext { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_tuple(AE_CIPHERTEXT_LEN, ShadowAeCiphertextVisitor) + } +} + +impl Serialize for ShadowElGamalCiphertext { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_bytes(&self.0) + } +} + +impl From for ShadowAeCiphertext { + fn from(original: AeCiphertext) -> Self { + ShadowAeCiphertext(original.0) + } +} + +impl From for ShadowElGamalCiphertext { + fn from(original: ElGamalCiphertext) -> Self { + ShadowElGamalCiphertext(original.0) + } +} + +impl From for ShadowElGamalPubkey { + fn from(original: ElGamalPubkey) -> Self { + ShadowElGamalPubkey(original.0) + } +} + +impl From for ShadowCpiGuard { + fn from(original: CpiGuard) -> Self { + ShadowCpiGuard { + lock_cpi: original.lock_cpi, + } + } +} + +impl From for ShadowDefaultAccountState { + fn from(original: DefaultAccountState) -> Self { + ShadowDefaultAccountState { + state: original.state, + } + } +} + +impl From for ShadowImmutableOwner { + fn from(_: ImmutableOwner) -> Self { + ShadowImmutableOwner + } +} + +impl From for ShadowConfidentialTransferFeeAmount { + fn from(original: ConfidentialTransferFeeAmount) -> Self { + ShadowConfidentialTransferFeeAmount { + withheld_amount: original.withheld_amount.into(), + } + } +} + +impl From for ShadowTransferFeeAmount { + fn from(original: TransferFeeAmount) -> Self { + ShadowTransferFeeAmount { + withheld_amount: original.withheld_amount, + } + } +} + +impl From for ShadowMemoTransfer { + fn from(original: MemoTransfer) -> Self { + ShadowMemoTransfer { + require_incoming_transfer_memos: original.require_incoming_transfer_memos, + } + } +} + +impl From for ShadowMetadataPointer { + fn from(original: MetadataPointer) -> Self { + ShadowMetadataPointer { + authority: original.authority, + metadata_address: original.metadata_address, + } + } +} + +impl From for ShadowGroupPointer { + fn from(original: GroupPointer) -> Self { + ShadowGroupPointer { + authority: original.authority, + group_address: original.group_address, + } + } +} + +impl From for ShadowTokenGroup { + fn from(original: TokenGroup) -> Self { + ShadowTokenGroup { + update_authority: original.update_authority, + mint: bs58::encode(original.mint).into_string(), + size: original.size, + max_size: original.max_size, + } + } +} + +impl From for ShadowTokenGroupMember { + fn from(original: TokenGroupMember) -> Self { + ShadowTokenGroupMember { + mint: bs58::encode(original.mint).into_string(), + group: bs58::encode(original.group).into_string(), + member_number: original.member_number, + } + } +} + +impl From for ShadowGroupMemberPointer { + fn from(original: GroupMemberPointer) -> Self { + ShadowGroupMemberPointer { + authority: original.authority, + member_address: original.member_address, + } + } +} + +impl From for ShadowTransferFee { + fn from(original: TransferFee) -> Self { + ShadowTransferFee { + epoch: original.epoch, + maximum_fee: original.maximum_fee, + transfer_fee_basis_points: original.transfer_fee_basis_points, + } + } +} + +impl From for ShadowTransferFeeConfig { + fn from(original: TransferFeeConfig) -> Self { + ShadowTransferFeeConfig { + transfer_fee_config_authority: original.transfer_fee_config_authority, + withdraw_withheld_authority: original.withdraw_withheld_authority, + withheld_amount: original.withheld_amount, + older_transfer_fee: ShadowTransferFee::from(original.older_transfer_fee), + newer_transfer_fee: ShadowTransferFee::from(original.newer_transfer_fee), + } + } +} + +impl From for ShadowInterestBearingConfig { + fn from(original: InterestBearingConfig) -> Self { + ShadowInterestBearingConfig { + rate_authority: original.rate_authority, + initialization_timestamp: original.initialization_timestamp, + pre_update_average_rate: original.pre_update_average_rate, + last_update_timestamp: original.last_update_timestamp, + current_rate: original.current_rate, + } + } +} + +impl From for ShadowMintCloseAuthority { + fn from(original: MintCloseAuthority) -> Self { + ShadowMintCloseAuthority { + close_authority: original.close_authority, + } + } +} + +impl From for ShadowPermanentDelegate { + fn from(original: PermanentDelegate) -> Self { + ShadowPermanentDelegate { + delegate: original.delegate, + } + } +} + +impl From for ShadowTransferHook { + fn from(original: TransferHook) -> Self { + ShadowTransferHook { + authority: original.authority, + program_id: original.program_id, + } + } +} + +impl From for ShadowConfidentialTransferMint { + fn from(original: ConfidentialTransferMint) -> Self { + ShadowConfidentialTransferMint { + authority: original.authority, + auto_approve_new_accounts: original.auto_approve_new_accounts, + auditor_elgamal_pubkey: original.auditor_elgamal_pubkey, + } + } +} + +impl From for ShadowConfidentialTransferAccount { + fn from(original: ConfidentialTransferAccount) -> Self { + ShadowConfidentialTransferAccount { + approved: original.approved.into(), + elgamal_pubkey: original.elgamal_pubkey.into(), + pending_balance_lo: original.pending_balance_lo.into(), + pending_balance_hi: original.pending_balance_hi.into(), + available_balance: original.available_balance.into(), + decryptable_available_balance: original.decryptable_available_balance.into(), + allow_confidential_credits: original.allow_confidential_credits.into(), + allow_non_confidential_credits: original.allow_non_confidential_credits.into(), + pending_balance_credit_counter: original.pending_balance_credit_counter.into(), + maximum_pending_balance_credit_counter: original + .maximum_pending_balance_credit_counter + .into(), + expected_pending_balance_credit_counter: original + .expected_pending_balance_credit_counter + .into(), + actual_pending_balance_credit_counter: original + .actual_pending_balance_credit_counter + .into(), + } + } +} + +impl From for ShadowConfidentialTransferFeeConfig { + fn from(original: ConfidentialTransferFeeConfig) -> Self { + ShadowConfidentialTransferFeeConfig { + authority: original.authority, + withdraw_withheld_authority_elgamal_pubkey: original + .withdraw_withheld_authority_elgamal_pubkey + .into(), + harvest_to_mint_enabled: original.harvest_to_mint_enabled, + withheld_amount: original.withheld_amount.into(), + } + } +} + +impl From for ShadowMetadata { + fn from(original: TokenMetadata) -> Self { + ShadowMetadata { + update_authority: original.update_authority, + mint: bs58::encode(original.mint).into_string(), + name: original.name, + symbol: original.symbol, + uri: original.uri, + additional_metadata: original.additional_metadata, + } + } +} diff --git a/blockbuster/src/programs/token_extensions/mod.rs b/blockbuster/src/programs/token_extensions/mod.rs new file mode 100644 index 00000000..0d7bb184 --- /dev/null +++ b/blockbuster/src/programs/token_extensions/mod.rs @@ -0,0 +1,244 @@ +pub mod extension; +use crate::{ + error::BlockbusterError, + program_handler::{ParseResult, ProgramParser}, + programs::ProgramParseResult, +}; +use plerkle_serialization::AccountInfo; +use serde::{Deserialize, Serialize}; +use solana_sdk::{pubkey::Pubkey, pubkeys}; +use spl_token_2022::{ + extension::{ + confidential_transfer::{ConfidentialTransferAccount, ConfidentialTransferMint}, + confidential_transfer_fee::ConfidentialTransferFeeConfig, + cpi_guard::CpiGuard, + default_account_state::DefaultAccountState, + group_member_pointer::GroupMemberPointer, + group_pointer::GroupPointer, + interest_bearing_mint::InterestBearingConfig, + memo_transfer::MemoTransfer, + metadata_pointer::MetadataPointer, + mint_close_authority::MintCloseAuthority, + permanent_delegate::PermanentDelegate, + transfer_fee::{TransferFeeAmount, TransferFeeConfig}, + transfer_hook::TransferHook, + BaseStateWithExtensions, StateWithExtensions, + }, + state::{Account, Mint}, +}; +use spl_token_group_interface::state::{TokenGroup, TokenGroupMember}; +use spl_token_metadata_interface::state::TokenMetadata; + +use self::extension::{ + ShadowConfidentialTransferAccount, ShadowConfidentialTransferFeeConfig, + ShadowConfidentialTransferMint, ShadowCpiGuard, ShadowDefaultAccountState, + ShadowGroupMemberPointer, ShadowGroupPointer, ShadowInterestBearingConfig, ShadowMemoTransfer, + ShadowMetadata, ShadowMetadataPointer, ShadowMintCloseAuthority, ShadowPermanentDelegate, + ShadowTokenGroup, ShadowTokenGroupMember, ShadowTransferFeeAmount, ShadowTransferFeeConfig, + ShadowTransferHook, +}; + +#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +pub struct MintAccountExtensions { + pub default_account_state: Option, + pub confidential_transfer_mint: Option, + pub confidential_transfer_account: Option, + pub confidential_transfer_fee_config: Option, + pub interest_bearing_config: Option, + pub transfer_fee_config: Option, + pub mint_close_authority: Option, + pub permanent_delegate: Option, + pub metadata_pointer: Option, + pub metadata: Option, + pub transfer_hook: Option, + pub group_pointer: Option, + pub token_group: Option, + pub group_member_pointer: Option, + pub token_group_member: Option, +} + +#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +pub struct TokenAccountExtensions { + pub confidential_transfer: Option, + pub cpi_guard: Option, + pub memo_transfer: Option, + pub transfer_fee_amount: Option, +} +#[derive(Debug, PartialEq)] +pub struct TokenAccount { + pub account: Account, + pub extensions: TokenAccountExtensions, +} + +#[derive(Debug, PartialEq)] +pub struct MintAccount { + pub account: Mint, + pub extensions: MintAccountExtensions, +} + +pubkeys!( + token_program_id, + "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb" +); + +pub struct Token2022AccountParser; + +pub enum TokenExtensionsProgramAccount { + TokenAccount(TokenAccount), + MintAccount(MintAccount), + EmptyAccount, +} + +impl ParseResult for TokenExtensionsProgramAccount { + fn result(&self) -> &Self + where + Self: Sized, + { + self + } + fn result_type(&self) -> ProgramParseResult { + ProgramParseResult::TokenExtensionsProgramAccount(self) + } +} + +impl ProgramParser for Token2022AccountParser { + fn key(&self) -> Pubkey { + token_program_id() + } + fn key_match(&self, key: &Pubkey) -> bool { + key == &token_program_id() + } + fn handles_account_updates(&self) -> bool { + true + } + + fn handles_instructions(&self) -> bool { + false + } + + fn handle_account( + &self, + account_info: &AccountInfo, + ) -> Result, BlockbusterError> { + let account_data = if let Some(account_info) = account_info.data() { + account_info.iter().collect::>() + } else { + return Ok(Box::new(TokenExtensionsProgramAccount::EmptyAccount)); + }; + + let result: TokenExtensionsProgramAccount; + + if let Ok(account) = StateWithExtensions::::unpack(&account_data) { + let confidential_transfer = account + .get_extension::() + .ok() + .map(|x| x.clone()); + let cpi_guard = account.get_extension::().ok().map(|x| x.clone()); + let memo_transfer = account + .get_extension::() + .ok() + .map(|x| x.clone()); + let transfer_fee_amount = account + .get_extension::() + .ok() + .map(|x| x.clone()); + + // Create a structured account with extensions + let structured_account = TokenAccount { + account: account.base.clone(), + extensions: TokenAccountExtensions { + confidential_transfer: confidential_transfer + .map(ShadowConfidentialTransferAccount::from), + cpi_guard: cpi_guard.map(ShadowCpiGuard::from), + memo_transfer: memo_transfer.map(ShadowMemoTransfer::from), + transfer_fee_amount: transfer_fee_amount.map(ShadowTransferFeeAmount::from), + }, + }; + + result = TokenExtensionsProgramAccount::TokenAccount(structured_account); + } else if let Ok(mint) = StateWithExtensions::::unpack(&account_data) { + let confidential_transfer_mint = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let confidential_transfer_account = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let confidential_transfer_fee_config = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let default_account_state = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let interest_bearing_config = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let transfer_fee_config = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let mint_close_authority = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let permanent_delegate = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let metadata_pointer = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let metadata = mint + .get_variable_len_extension::() + .ok() + .map(|x| x.clone()); + let group_pointer = mint.get_extension::().ok().map(|x| x.clone()); + let token_group = mint.get_extension::().ok().map(|x| x.clone()); + let group_member_pointer = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let token_group_member = mint + .get_extension::() + .ok() + .map(|x| x.clone()); + let transfer_hook = mint.get_extension::().ok().map(|x| x.clone()); + + let structured_mint = MintAccount { + account: mint.base.clone(), + extensions: MintAccountExtensions { + confidential_transfer_mint: confidential_transfer_mint + .map(ShadowConfidentialTransferMint::from), + confidential_transfer_account: confidential_transfer_account + .map(ShadowConfidentialTransferAccount::from), + confidential_transfer_fee_config: confidential_transfer_fee_config + .map(ShadowConfidentialTransferFeeConfig::from), + default_account_state: default_account_state + .map(ShadowDefaultAccountState::from), + interest_bearing_config: interest_bearing_config + .map(ShadowInterestBearingConfig::from), + transfer_fee_config: transfer_fee_config.map(ShadowTransferFeeConfig::from), + mint_close_authority: mint_close_authority.map(ShadowMintCloseAuthority::from), + permanent_delegate: permanent_delegate.map(ShadowPermanentDelegate::from), + metadata_pointer: metadata_pointer.map(ShadowMetadataPointer::from), + metadata: metadata.map(ShadowMetadata::from), + transfer_hook: transfer_hook.map(ShadowTransferHook::from), + group_pointer: group_pointer.map(ShadowGroupPointer::from), + token_group: token_group.map(ShadowTokenGroup::from), + group_member_pointer: group_member_pointer.map(ShadowGroupMemberPointer::from), + token_group_member: token_group_member.map(ShadowTokenGroupMember::from), + }, + }; + result = TokenExtensionsProgramAccount::MintAccount(structured_mint); + } else { + return Err(BlockbusterError::InvalidDataLength); + }; + + Ok(Box::new(result)) + } +} diff --git a/blockbuster/src/programs/token_metadata/mod.rs b/blockbuster/src/programs/token_metadata/mod.rs index e3b756c2..d69908bd 100644 --- a/blockbuster/src/programs/token_metadata/mod.rs +++ b/blockbuster/src/programs/token_metadata/mod.rs @@ -8,16 +8,12 @@ use solana_sdk::{borsh0_10::try_from_slice_unchecked, pubkey::Pubkey, pubkeys}; use plerkle_serialization::AccountInfo; -pub use mpl_bubblegum::{ - state::leaf_schema::{LeafSchema, LeafSchemaEvent}, - InstructionName, -}; use mpl_token_metadata::{ - state::{ - CollectionAuthorityRecord, Edition, EditionMarker, Key, MasterEditionV1, MasterEditionV2, - Metadata, ReservationListV1, ReservationListV2, UseAuthorityRecord, + accounts::{ + CollectionAuthorityRecord, DeprecatedMasterEditionV1, Edition, EditionMarker, + MasterEdition, Metadata, UseAuthorityRecord, }, - utils::meta_deser_unchecked, + types::Key, }; pubkeys!( @@ -28,14 +24,12 @@ pubkeys!( #[allow(clippy::large_enum_variant)] pub enum TokenMetadataAccountData { EditionV1(Edition), - MasterEditionV1(MasterEditionV1), + MasterEditionV1(DeprecatedMasterEditionV1), MetadataV1(Metadata), - MasterEditionV2(MasterEditionV2), + MasterEditionV2(MasterEdition), EditionMarker(EditionMarker), UseAuthorityRecord(UseAuthorityRecord), CollectionAuthorityRecord(CollectionAuthorityRecord), - ReservationListV2(ReservationListV2), - ReservationListV1(ReservationListV1), EmptyAccount, } @@ -103,19 +97,19 @@ impl ProgramParser for TokenMetadataParser { } } Key::MasterEditionV1 => { - let account: MasterEditionV2 = try_from_slice_unchecked(&account_data)?; + let account: DeprecatedMasterEditionV1 = try_from_slice_unchecked(&account_data)?; TokenMetadataAccountState { key: account.key, - data: TokenMetadataAccountData::MasterEditionV2(account), + data: TokenMetadataAccountData::MasterEditionV1(account), } } Key::MasterEditionV2 => { - let account: MasterEditionV1 = try_from_slice_unchecked(&account_data)?; + let account: MasterEdition = try_from_slice_unchecked(&account_data)?; TokenMetadataAccountState { key: account.key, - data: TokenMetadataAccountData::MasterEditionV1(account), + data: TokenMetadataAccountData::MasterEditionV2(account), } } Key::UseAuthorityRecord => { @@ -143,29 +137,13 @@ impl ProgramParser for TokenMetadataParser { } } Key::MetadataV1 => { - let account: Metadata = meta_deser_unchecked(&mut account_data.as_slice())?; + let account = Metadata::safe_deserialize(&account_data)?; TokenMetadataAccountState { key: account.key, data: TokenMetadataAccountData::MetadataV1(account), } } - Key::ReservationListV1 => { - let account: ReservationListV1 = try_from_slice_unchecked(&account_data)?; - - TokenMetadataAccountState { - key: account.key, - data: TokenMetadataAccountData::ReservationListV1(account), - } - } - Key::ReservationListV2 => { - let account: ReservationListV2 = try_from_slice_unchecked(&account_data)?; - - TokenMetadataAccountState { - key: account.key, - data: TokenMetadataAccountData::ReservationListV2(account), - } - } Key::Uninitialized => { return Err(BlockbusterError::UninitializedAccount); } diff --git a/blockbuster/tests/bubblegum_parser_test.rs b/blockbuster/tests/bubblegum_parser_test.rs index 213eee81..3ac73332 100644 --- a/blockbuster/tests/bubblegum_parser_test.rs +++ b/blockbuster/tests/bubblegum_parser_test.rs @@ -1,26 +1,19 @@ - - #[cfg(test)] -use anchor_lang::{prelude::*, InstructionData}; use blockbuster::{ - instruction::{InstructionBundle}, + instruction::InstructionBundle, program_handler::ProgramParser, programs::{bubblegum::BubblegumParser, ProgramParseResult}, }; -use borsh::ser::BorshSerialize; use flatbuffers::FlatBufferBuilder; use helpers::*; -pub use mpl_bubblegum::id as program_id; -use mpl_bubblegum::state::{ - leaf_schema::{LeafSchema, Version}, - metaplex_adapter::{Creator, MetadataArgs, TokenProgramVersion}, - BubblegumEventType, +use mpl_bubblegum::{ + instructions::{MintV1InstructionArgs, TransferInstructionArgs}, + types::{BubblegumEventType, Creator, LeafSchema, MetadataArgs, TokenProgramVersion, Version}, + LeafSchemaEvent, }; -use plerkle_serialization::{Pubkey}; +use plerkle_serialization::Pubkey; use spl_account_compression::{ - events::{ - AccountCompressionEvent, ApplicationDataEvent, ApplicationDataEventV1, ChangeLogEvent, - }, + events::{AccountCompressionEvent, ChangeLogEvent}, state::PathNode, }; @@ -29,17 +22,26 @@ mod helpers; #[test] fn test_setup() { let subject = BubblegumParser {}; - assert_eq!(subject.key(), program_id()); - assert!(subject.key_match(&program_id())); + assert_eq!(subject.key(), mpl_bubblegum::ID); + assert!(subject.key_match(&mpl_bubblegum::ID)); } #[test] fn test_mint() { let subject = BubblegumParser {}; - let accounts = random_list_of(8, |_i| Pubkey(random_pubkey().to_bytes())); - let account_indexes: Vec = accounts.iter().enumerate().map(|(i, _)| i as u8).collect(); - let message = MetadataArgs { + let accounts = random_list_of(9, |_i| random_pubkey()); + let fb_accounts: Vec = accounts + .iter() + .map(|account| Pubkey(account.to_bytes())) + .collect(); + let fb_account_indexes: Vec = fb_accounts + .iter() + .enumerate() + .map(|(i, _)| i as u8) + .collect(); + + let metadata = MetadataArgs { name: "test".to_string(), symbol: "test".to_string(), uri: "www.solana.pos".to_owned(), @@ -57,35 +59,24 @@ fn test_mint() { share: 20, }], }; - let ix = mpl_bubblegum::instruction::MintV1 { message }; - let _lse = mpl_bubblegum::state::leaf_schema::LeafSchemaEvent { - event_type: BubblegumEventType::LeafSchemaEvent, - version: Version::V1, - schema: LeafSchema::V1 { - id: random_pubkey(), - owner: random_pubkey(), - delegate: random_pubkey(), - nonce: 0, - data_hash: [0; 32], - creator_hash: [0; 32], - }, - leaf_hash: [0; 32], + // We are only using this to get the instruction data, so the accounts don't actually matter + // here. + let mut accounts_iter = accounts.iter(); + let ix = mpl_bubblegum::instructions::MintV1 { + tree_config: *accounts_iter.next().unwrap(), + leaf_owner: *accounts_iter.next().unwrap(), + leaf_delegate: *accounts_iter.next().unwrap(), + merkle_tree: *accounts_iter.next().unwrap(), + payer: *accounts_iter.next().unwrap(), + tree_creator_or_delegate: *accounts_iter.next().unwrap(), + log_wrapper: *accounts_iter.next().unwrap(), + compression_program: *accounts_iter.next().unwrap(), + system_program: *accounts_iter.next().unwrap(), }; + let ix_data = ix.instruction(MintV1InstructionArgs { metadata }).data; - let cs = ChangeLogEvent::new( - random_pubkey(), - vec![PathNode { - node: [0; 32], - index: 0, - }], - 0, - 0, - ); - - let _cs_event = AccountCompressionEvent::ChangeLog(cs); - - let lse = mpl_bubblegum::state::leaf_schema::LeafSchemaEvent { + let lse = LeafSchemaEvent { event_type: BubblegumEventType::LeafSchemaEvent, version: Version::V1, schema: LeafSchema::V1 { @@ -99,13 +90,6 @@ fn test_mint() { leaf_hash: [0; 32], }; - let lse_versioned = ApplicationDataEventV1 { - application_data: lse.try_to_vec().unwrap(), - }; - - let _lse_event = - AccountCompressionEvent::ApplicationData(ApplicationDataEvent::V1(lse_versioned)); - let cs = ChangeLogEvent::new( random_pubkey(), vec![PathNode { @@ -115,11 +99,9 @@ fn test_mint() { 0, 0, ); - let cs_event = AccountCompressionEvent::ChangeLog(cs); - let ix_data = ix.data(); + let mut ix_b = InstructionBundle::default(); - // this is horrifying, we need to re write the flatbuffers sdk let mut fbb1 = FlatBufferBuilder::new(); let mut fbb2 = FlatBufferBuilder::new(); let mut fbb3 = FlatBufferBuilder::new(); @@ -130,8 +112,8 @@ fn test_mint() { &mut fbb2, &mut fbb3, &mut fbb4, - &accounts, - &account_indexes, + &fb_accounts, + &fb_account_indexes, &ix_data, lse, cs_event, @@ -158,18 +140,41 @@ fn test_mint() { fn test_basic_success_parsing() { let subject = BubblegumParser {}; - let accounts = random_list_of(8, |_i| Pubkey(random_pubkey().to_bytes())); - let account_indexes: Vec = accounts.iter().enumerate().map(|(i, _)| i as u8).collect(); - - let ix = mpl_bubblegum::instruction::Transfer { - creator_hash: [0; 32], - index: 0, - data_hash: [0; 32], - nonce: 0, - root: [0; 32], + let accounts = random_list_of(8, |_i| random_pubkey()); + let fb_accounts: Vec = accounts + .iter() + .map(|account| Pubkey(account.to_bytes())) + .collect(); + let fb_account_indexes: Vec = fb_accounts + .iter() + .enumerate() + .map(|(i, _)| i as u8) + .collect(); + + // We are only using this to get the instruction data, so the accounts don't actually matter + // here. + let mut accounts_iter = accounts.iter(); + let ix = mpl_bubblegum::instructions::Transfer { + tree_config: *accounts_iter.next().unwrap(), + leaf_owner: (*accounts_iter.next().unwrap(), true), + leaf_delegate: (*accounts_iter.next().unwrap(), false), + merkle_tree: *accounts_iter.next().unwrap(), + log_wrapper: *accounts_iter.next().unwrap(), + compression_program: *accounts_iter.next().unwrap(), + system_program: *accounts_iter.next().unwrap(), + new_leaf_owner: *accounts_iter.next().unwrap(), }; + let ix_data = ix + .instruction(TransferInstructionArgs { + root: [0; 32], + data_hash: [0; 32], + creator_hash: [0; 32], + nonce: 0, + index: 0, + }) + .data; - let lse = mpl_bubblegum::state::leaf_schema::LeafSchemaEvent { + let lse = LeafSchemaEvent { event_type: BubblegumEventType::LeafSchemaEvent, version: Version::V1, schema: LeafSchema::V1 { @@ -183,13 +188,6 @@ fn test_basic_success_parsing() { leaf_hash: [0; 32], }; - let lse_versioned = ApplicationDataEventV1 { - application_data: lse.try_to_vec().unwrap(), - }; - - let _lse_event = - AccountCompressionEvent::ApplicationData(ApplicationDataEvent::V1(lse_versioned)); - let cs = ChangeLogEvent::new( random_pubkey(), vec![PathNode { @@ -199,11 +197,9 @@ fn test_basic_success_parsing() { 0, 0, ); - let cs_event = AccountCompressionEvent::ChangeLog(cs); - let ix_data = ix.data(); + let mut ix_b = InstructionBundle::default(); - // this is horrifying, we need to re write the flatbuffers sdk let mut fbb1 = FlatBufferBuilder::new(); let mut fbb2 = FlatBufferBuilder::new(); let mut fbb3 = FlatBufferBuilder::new(); @@ -214,8 +210,8 @@ fn test_basic_success_parsing() { &mut fbb2, &mut fbb3, &mut fbb4, - &accounts, - &account_indexes, + &fb_accounts, + &fb_account_indexes, &ix_data, lse, cs_event, diff --git a/blockbuster/tests/candy_machine_parser_test.rs b/blockbuster/tests/candy_machine_parser_test.rs deleted file mode 100644 index b42dd5a7..00000000 --- a/blockbuster/tests/candy_machine_parser_test.rs +++ /dev/null @@ -1,388 +0,0 @@ -#[cfg(test)] -use blockbuster::{ - error::BlockbusterError, - instruction::InstructionBundle, - program_handler::ProgramParser, - programs::{ - candy_machine::{ - candy_machine_id, - state::{ - CandyMachine as CandyMachineAccountType, - CandyMachineData as CandyMachineDataAccountType, - CollectionPDA as CollectionPDAAccountType, Creator, EndSettingType, EndSettings, - FreezePDA as FreezePDAAccountType, GatekeeperConfig, HiddenSettings, - WhitelistMintMode, WhitelistMintSettings, - }, - CandyMachineAccountData::{CandyMachine, CollectionPDA, FreezePDA}, - CandyMachineParser, CANDY_MACHINE_DISCRIMINATOR, COLLECTION_PDA_DISCRIMINATOR, - FREEZE_PDA_DISCRIMINATOR, - }, - ProgramParseResult, - }, -}; -use helpers::{build_random_account_update, build_random_instruction, random_list, random_pubkey}; -use plerkle_serialization::root_as_compiled_instruction; - -use borsh::BorshSerialize; -use flatbuffers::FlatBufferBuilder; - -mod helpers; - -fn get_test_candy_machine() -> CandyMachineAccountType { - // Create CandyMachine test data. - let end_settings = EndSettings { - end_setting_type: EndSettingType::Amount, - number: 5000, - }; - - let creators = vec![ - Creator { - address: random_pubkey(), - verified: true, - share: 33, - }, - Creator { - address: random_pubkey(), - verified: false, - share: 33, - }, - Creator { - address: random_pubkey(), - verified: false, - share: 33, - }, - Creator { - address: random_pubkey(), - verified: true, - share: 1, - }, - ]; - - let hidden_settings = HiddenSettings { - name: String::from("name"), - uri: String::from("uri"), - hash: random_list(32, u8::MAX).try_into().unwrap(), - }; - - let whitelist_mint_settings = WhitelistMintSettings { - mode: WhitelistMintMode::BurnEveryTime, - mint: random_pubkey(), - presale: true, - discount_price: Some(12345), - }; - - let gatekeeper_config = GatekeeperConfig { - gatekeeper_network: random_pubkey(), - expire_on_use: true, - }; - - let candy_machine_data = CandyMachineDataAccountType { - uuid: String::from("uri"), - price: 991177, - symbol: String::from("ABC"), - seller_fee_basis_points: 44, - max_supply: 100000, - is_mutable: true, - retain_authority: false, - go_live_date: Some(1663833216), - end_settings: Some(end_settings), - creators, - hidden_settings: Some(hidden_settings), - whitelist_mint_settings: Some(whitelist_mint_settings), - items_available: 55, - gatekeeper: Some(gatekeeper_config), - }; - - CandyMachineAccountType { - authority: random_pubkey(), - wallet: random_pubkey(), - token_mint: Some(random_pubkey()), - items_redeemed: 33, - data: candy_machine_data, - } -} - -#[test] -fn test_setup() { - let subject = CandyMachineParser {}; - assert_eq!(subject.key(), candy_machine_id()); - assert!(subject.key_match(&candy_machine_id())); -} - -#[test] -fn test_unused_instruction_parsing() { - // Build a random test instruction. - let mut fbb = FlatBufferBuilder::new(); - let offset = build_random_instruction(&mut fbb, 10, 3); - fbb.finish_minimal(offset); - let data = fbb.finished_data(); - let outer_ix = root_as_compiled_instruction(data).expect("Could not create random instruction"); - - // Bundle the instruction with more random data. - let bundle = InstructionBundle { - txn_id: "", - program: plerkle_serialization::Pubkey(random_pubkey().to_bytes()), - instruction: Some(outer_ix), - inner_ix: None, - keys: &[plerkle_serialization::Pubkey(random_pubkey().to_bytes())], - slot: 0, - }; - - // Use `CandyMachineParser` to parse the account update. - let subject = CandyMachineParser {}; - let result = subject.handle_instruction(&bundle); - - // Check `ProgramParseResult` and make sure it expected variant. - assert!(result.is_ok()); - match result.unwrap().result_type() { - ProgramParseResult::Unknown => (), - _ => panic!("Unexpected ProgramParseResult variant"), - } -} - -#[test] -fn test_zero_length_data_fails() { - // Empty byte slice. - let data: &[u8] = &[]; - - // Flatbuffer serialize the data. - let mut fbb = FlatBufferBuilder::new(); - let account_info = - build_random_account_update(&mut fbb, data).expect("Could not build account update"); - - // Use `CandyMachineParser` to parse the account update. - let subject = CandyMachineParser {}; - let result = subject.handle_account(&account_info); - - // Validate expected error. - assert!(result.is_err()); - if let Err(err) = result { - match err { - BlockbusterError::DeserializationError => (), - _ => panic!("Unexpected error: {}", err,), - } - } -} - -#[test] -fn test_unknown_discriminator_fails() { - // Borsh serialize the CandyMachine discriminator. - let mut data = CANDY_MACHINE_DISCRIMINATOR.to_vec(); - - // Corrupt the discriminator. - data[0] = 0; - - // Flatbuffer serialize the data. - let mut fbb = FlatBufferBuilder::new(); - let account_info = - build_random_account_update(&mut fbb, &data).expect("Could not build account update"); - - // Use `CandyMachineParser` to parse the account update. - let subject = CandyMachineParser {}; - let result = subject.handle_account(&account_info); - - // Validate expected error. - assert!(result.is_err()); - if let Err(err) = result { - match err { - BlockbusterError::UnknownAccountDiscriminator => (), - _ => panic!("Unexpected error: {}", err), - } - } -} - -#[test] -fn test_basic_success_parsing_candy_machine_account() { - // Get CandyMachine test data. - let test_candy_machine = get_test_candy_machine(); - - // Borsh serialize the CandyMachine test data. - let mut data = CANDY_MACHINE_DISCRIMINATOR.to_vec(); - test_candy_machine - .serialize(&mut data) - .expect("Could not serialize candy machine data"); - - // Flatbuffer serialize the data. - let mut fbb = FlatBufferBuilder::new(); - let account_info = - build_random_account_update(&mut fbb, &data).expect("Could not build account update"); - - // Use `CandyMachineParser` to parse the account update. - let subject = CandyMachineParser {}; - let result = subject.handle_account(&account_info); - assert!(result.is_ok()); - - // Check `ProgramParseResult` and make sure the data is parsed and matches the test data. - if let ProgramParseResult::CandyMachine(candy_machine_account_data) = - result.unwrap().result_type() - { - match candy_machine_account_data { - CandyMachine(parsed_candy_machine) => { - assert_eq!(*parsed_candy_machine, test_candy_machine); - } - _ => panic!("Unexpected CandyMachineAccountData variant"), - } - } else { - panic!("Unexpected ProgramParseResult variant"); - } -} - -#[test] -fn test_wrong_size_candy_machine_account_fails() { - // Borsh serialize the CandyMachine discriminator. - let mut data = CANDY_MACHINE_DISCRIMINATOR.to_vec(); - // Add some random data. - data.append(&mut random_list(32, u8::MAX)); - - // Flatbuffer serialize the data. - let mut fbb = FlatBufferBuilder::new(); - let account_info = - build_random_account_update(&mut fbb, &data).expect("Could not build account update"); - - // Use `CandyMachineParser` to parse the account update. - let subject = CandyMachineParser {}; - let result = subject.handle_account(&account_info); - - // Validate expected error. - assert!(result.is_err()); - if let Err(err) = result { - match err { - BlockbusterError::IOError(_) => (), - _ => panic!("Unexpected error: {}", err), - } - } -} - -#[test] -fn test_basic_success_parsing_collection_pda_account() { - // Create CollectionPDA test data. - let test_collection_pda = CollectionPDAAccountType { - mint: random_pubkey(), - candy_machine: random_pubkey(), - }; - - // Borsh serialize the CandyMachine test data. - let mut data = COLLECTION_PDA_DISCRIMINATOR.to_vec(); - test_collection_pda - .serialize(&mut data) - .expect("Could not serialize CollectionPDA data"); - - // Flatbuffer serialize the data. - let mut fbb = FlatBufferBuilder::new(); - let account_info = - build_random_account_update(&mut fbb, &data).expect("Could not build account update"); - - // Use `CandyMachineParser` to parse the account update. - let subject = CandyMachineParser {}; - let result = subject.handle_account(&account_info); - assert!(result.is_ok()); - - // Check `ProgramParseResult` and make sure the data is parsed and matches the test data. - if let ProgramParseResult::CandyMachine(candy_machine_account_data) = - result.unwrap().result_type() - { - match candy_machine_account_data { - CollectionPDA(parsed_collection_pda) => { - assert_eq!(*parsed_collection_pda, test_collection_pda); - } - _ => panic!("Unexpected CandyMachineAccountData variant"), - } - } else { - panic!("Unexpected ProgramParseResult variant"); - } -} - -#[test] -fn test_wrong_size_collection_pda_account_fails() { - // Borsh serialize the CandyMachine discriminator. - let mut data = COLLECTION_PDA_DISCRIMINATOR.to_vec(); - // Add some random data. - data.append(&mut random_list(8, u8::MAX)); - - // Flatbuffer serialize the data. - let mut fbb = FlatBufferBuilder::new(); - let account_info = - build_random_account_update(&mut fbb, &data).expect("Could not build account update"); - - // Use `CandyMachineParser` to parse the account update. - let subject = CandyMachineParser {}; - let result = subject.handle_account(&account_info); - - // Validate expected error. - assert!(result.is_err()); - if let Err(err) = result { - match err { - BlockbusterError::IOError(_) => (), - _ => panic!("Unexpected error: {}", err), - } - } -} - -#[test] -fn test_basic_success_parsing_freeze_pda_account() { - // Create FreezePDA test data. - let test_freeze_pda = FreezePDAAccountType { - candy_machine: random_pubkey(), - allow_thaw: true, - frozen_count: 3, - mint_start: Some(1663833216), - freeze_time: 300, - freeze_fee: 1000000, - }; - - // Borsh serialize the CandyMachine test data. - let mut data = FREEZE_PDA_DISCRIMINATOR.to_vec(); - test_freeze_pda - .serialize(&mut data) - .expect("Could not serialize FreezePDA data"); - - // Flatbuffer serialize the data. - let mut fbb = FlatBufferBuilder::new(); - let account_info = - build_random_account_update(&mut fbb, &data).expect("Could not build account update"); - - // Use `CandyMachineParser` to parse the account update. - let subject = CandyMachineParser {}; - let result = subject.handle_account(&account_info); - assert!(result.is_ok()); - - // Check `ProgramParseResult` and make sure the data is parsed and matches the test data. - if let ProgramParseResult::CandyMachine(candy_machine_account_data) = - result.unwrap().result_type() - { - match candy_machine_account_data { - FreezePDA(parsed_freeze_pda) => { - assert_eq!(*parsed_freeze_pda, test_freeze_pda); - } - _ => panic!("Unexpected CandyMachineAccountData variant"), - } - } else { - panic!("Unexpected ProgramParseResult variant"); - } -} - -#[test] -fn test_wrong_size_freeze_pda_account_fails() { - // Borsh serialize the CandyMachine discriminator. - let mut data = FREEZE_PDA_DISCRIMINATOR.to_vec(); - // Add some random data. - data.append(&mut random_list(32, u8::MAX)); - - // Flatbuffer serialize the data. - let mut fbb = FlatBufferBuilder::new(); - let account_info = - build_random_account_update(&mut fbb, &data).expect("Could not build account update"); - - // Use `CandyMachineParser` to parse the account update. - let subject = CandyMachineParser {}; - let result = subject.handle_account(&account_info); - - // Validate expected error. - assert!(result.is_err()); - if let Err(err) = result { - match err { - BlockbusterError::IOError(_) => (), - _ => panic!("Unexpected error: {}", err), - } - } -} diff --git a/blockbuster/tests/helpers.rs b/blockbuster/tests/helpers.rs index d9da1eef..c1e1a3b9 100644 --- a/blockbuster/tests/helpers.rs +++ b/blockbuster/tests/helpers.rs @@ -6,8 +6,7 @@ use blockbuster::{ }; use borsh::ser::BorshSerialize; use flatbuffers::{FlatBufferBuilder, WIPOffset}; -pub use mpl_bubblegum::id as program_id; -use mpl_bubblegum::state::leaf_schema::LeafSchemaEvent; +use mpl_bubblegum::LeafSchemaEvent; use plerkle_serialization::{ root_as_account_info, root_as_compiled_instruction, serializer::seralize_encoded_transaction_with_status, AccountInfo, AccountInfoArgs, @@ -299,7 +298,7 @@ pub fn build_bubblegum_bundle<'a>( let inner_ix = vec![noop_bgum_ix, gummy_roll_ix, noop_compression_ix]; - ixb.program = FBPubkey(program_id().to_bytes()); + ixb.program = FBPubkey(mpl_bubblegum::ID.to_bytes()); ixb.inner_ix = Some(inner_ix); ixb.keys = accounts.as_slice(); ixb.instruction = Some(outer_ix); diff --git a/blockbuster/tests/instructions_test.rs b/blockbuster/tests/instructions_test.rs index 626726a3..0739c2f8 100644 --- a/blockbuster/tests/instructions_test.rs +++ b/blockbuster/tests/instructions_test.rs @@ -5,8 +5,7 @@ use blockbuster::{ instruction::{order_instructions, InstructionBundle}, program_handler::ProgramParser, programs::{ - bubblegum::{BubblegumParser, Payload}, - token_metadata::LeafSchemaEvent, + bubblegum::{BubblegumParser, LeafSchemaEvent, Payload}, ProgramParseResult, }, }; @@ -60,7 +59,7 @@ fn helium_nested() { let txn = prepare_fixture(fbb, "helium_nested"); let txn = root_as_transaction_info(txn.finished_data()).expect("Fail deser"); let mut prog = HashSet::new(); - let id = mpl_bubblegum::id(); + let id = mpl_bubblegum::ID; let slot = txn.slot(); prog.insert(id.as_ref()); let res = order_instructions(prog, &txn); @@ -74,7 +73,7 @@ fn helium_nested() { let contains = res .iter() - .any(|(ib, _inner)| ib.0 .0.as_ref() == mpl_bubblegum::id().as_ref()); + .any(|(ib, _inner)| ib.0 .0.as_ref() == mpl_bubblegum::ID.as_ref()); assert!(contains, "Must containe bgum at hoisted root"); let subject = BubblegumParser {}; for (outer_ix, inner_ix) in res.into_iter() { @@ -107,7 +106,15 @@ fn helium_nested() { _ => panic!("Wrong type"), }; - if let (Some(_le), Some(_cl), Some(Payload::MintV1 { args: _ })) = ( + if let ( + Some(_le), + Some(_cl), + Some(Payload::MintV1 { + args: _, + authority: _, + tree_id: _, + }), + ) = ( &parse_result.leaf_update, &parse_result.tree_update, &parse_result.payload, @@ -130,7 +137,7 @@ fn test_double_mint() { assert_eq!(ix.len(), 2); let contains = ix .iter() - .filter(|(ib, _inner)| ib.0 .0.as_ref() == mpl_bubblegum::id().as_ref()); + .filter(|(ib, _inner)| ib.0 .0.as_ref() == mpl_bubblegum::ID.as_ref()); let mut count = 0; contains.for_each(|bix| { count += 1; @@ -178,7 +185,7 @@ fn test_double_tree() { let ix = order_instructions(programs, &txn); let contains = ix .iter() - .filter(|(ib, _inner)| ib.0 .0.as_ref() == mpl_bubblegum::id().as_ref()); + .filter(|(ib, _inner)| ib.0 .0.as_ref() == mpl_bubblegum::ID.as_ref()); let mut count = 0; contains.for_each(|bix| { if let Some(inner) = &bix.1 {