From 2b20ca3b1cc97b3aa9175cab6188132c97df7ae1 Mon Sep 17 00:00:00 2001 From: rustopian <96253492+rustopian@users.noreply.github.com> Date: Fri, 12 Dec 2025 16:26:49 +0400 Subject: [PATCH 1/3] update to use codama macros (squashed) --- .github/workflows/main.yml | 4 + Cargo.lock | 3998 +++++++---------- Cargo.toml | 4 +- Makefile | 3 + .../src/generated/instructions/authorize.ts | 8 +- .../instructions/authorizeChecked.ts | 4 +- .../instructions/authorizeCheckedWithSeed.ts | 4 +- .../instructions/authorizeWithSeed.ts | 4 +- .../src/generated/instructions/deactivate.ts | 4 +- .../instructions/deactivateDelinquent.ts | 8 +- .../generated/instructions/delegateStake.ts | 14 +- .../js/src/generated/instructions/merge.ts | 22 +- .../src/generated/instructions/setLockup.ts | 30 +- .../instructions/setLockupChecked.ts | 30 +- .../js/src/generated/instructions/split.ts | 8 +- .../js/src/generated/instructions/withdraw.ts | 18 +- clients/js/src/generated/types/delegation.ts | 22 +- clients/js/src/generated/types/epoch.ts | 32 + clients/js/src/generated/types/index.ts | 2 + clients/js/src/generated/types/lockup.ts | 30 +- .../js/src/generated/types/unixTimestamp.ts | 35 + clients/rust/Cargo.toml | 8 +- clients/rust/src/generated/errors/stake.rs | 12 +- .../src/generated/instructions/authorize.rs | 208 +- .../instructions/authorize_checked.rs | 211 +- .../authorize_checked_with_seed.rs | 214 +- .../instructions/authorize_with_seed.rs | 196 +- .../src/generated/instructions/deactivate.rs | 165 +- .../instructions/deactivate_delinquent.rs | 177 +- .../generated/instructions/delegate_stake.rs | 229 +- .../instructions/get_minimum_delegation.rs | 95 +- .../src/generated/instructions/initialize.rs | 147 +- .../instructions/initialize_checked.rs | 180 +- .../rust/src/generated/instructions/merge.rs | 226 +- .../generated/instructions/move_lamports.rs | 161 +- .../src/generated/instructions/move_stake.rs | 164 +- .../src/generated/instructions/set_lockup.rs | 171 +- .../instructions/set_lockup_checked.rs | 191 +- .../rust/src/generated/instructions/split.rs | 186 +- .../src/generated/instructions/withdraw.rs | 255 +- clients/rust/src/generated/programs.rs | 2 +- .../rust/src/generated/types/authorized.rs | 2 +- .../rust/src/generated/types/delegation.rs | 7 +- clients/rust/src/generated/types/epoch.rs | 8 + clients/rust/src/generated/types/lockup.rs | 7 +- clients/rust/src/generated/types/mod.rs | 7 +- .../src/generated/types/unix_timestamp.rs | 8 + .../rust/src/hooked/stake_state_account.rs | 6 +- codama.json | 20 + interface/Cargo.toml | 6 + interface/idl.json | 2697 +++++++---- interface/src/bin/generate-idl.rs | 32 + interface/src/error.rs | 85 +- interface/src/instruction.rs | 266 +- interface/src/lib.rs | 3 + interface/src/stake_flags.rs | 3 +- interface/src/state.rs | 29 +- package.json | 3 +- pnpm-lock.yaml | 263 +- program/idl.json | 502 --- program/tests/stake_instruction.rs | 2 + rust-toolchain.toml | 2 +- scripts/generate-clients.mts | 180 +- scripts/solana.dic | 1 + 64 files changed, 5602 insertions(+), 6019 deletions(-) create mode 100644 clients/js/src/generated/types/epoch.ts create mode 100644 clients/js/src/generated/types/unixTimestamp.ts create mode 100644 clients/rust/src/generated/types/epoch.rs create mode 100644 clients/rust/src/generated/types/unix_timestamp.rs create mode 100644 codama.json create mode 100644 interface/src/bin/generate-idl.rs delete mode 100644 program/idl.json diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index db681182..14c97ee0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,6 +10,7 @@ env: RUST_PACKAGES: "['clients-rust', 'interface', 'program']" SBPF_PROGRAM_PACKAGES: "['program']" WASM_PACKAGES: "['interface', 'program']" + IDL_PACKAGES: "['interface']" jobs: set_env: @@ -20,6 +21,7 @@ jobs: SBPF_PROGRAM_PACKAGES: ${{ steps.compute.outputs.SBPF_PROGRAM_PACKAGES }} RUST_PACKAGES: ${{ steps.compute.outputs.RUST_PACKAGES }} WASM_PACKAGES: ${{ steps.compute.outputs.WASM_PACKAGES }} + IDL_PACKAGES: ${{ steps.compute.outputs.IDL_PACKAGES }} RUST_TOOLCHAIN_NIGHTLY: ${{ steps.compute.outputs.RUST_TOOLCHAIN_NIGHTLY }} SOLANA_CLI_VERSION: ${{ steps.compute.outputs.SOLANA_CLI_VERSION }} steps: @@ -34,6 +36,7 @@ jobs: echo "SBPF_PROGRAM_PACKAGES=${{ env.SBPF_PROGRAM_PACKAGES }}" >> $GITHUB_OUTPUT echo "RUST_PACKAGES=${{ env.RUST_PACKAGES }}" >> $GITHUB_OUTPUT echo "WASM_PACKAGES=${{ env.WASM_PACKAGES }}" >> $GITHUB_OUTPUT + echo "IDL_PACKAGES=${{ env.IDL_PACKAGES }}" >> $GITHUB_OUTPUT echo "RUST_TOOLCHAIN_NIGHTLY=$(make rust-toolchain-nightly)" >> "$GITHUB_OUTPUT" echo "SOLANA_CLI_VERSION=$(make solana-cli-version)" >> "$GITHUB_OUTPUT" @@ -45,6 +48,7 @@ jobs: sbpf-program-packages: ${{ needs.set_env.outputs.SBPF_PROGRAM_PACKAGES }} rust-packages: ${{ needs.set_env.outputs.RUST_PACKAGES }} wasm-packages: ${{ needs.set_env.outputs.WASM_PACKAGES }} + idl-packages: ${{ needs.set_env.outputs.IDL_PACKAGES }} wasm-toolchain: ${{ needs.set_env.outputs.RUST_TOOLCHAIN_NIGHTLY }} rustfmt-toolchain: ${{ needs.set_env.outputs.RUST_TOOLCHAIN_NIGHTLY }} clippy-toolchain: ${{ needs.set_env.outputs.RUST_TOOLCHAIN_NIGHTLY }} diff --git a/Cargo.lock b/Cargo.lock index 80310871..e0f746cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,21 +1,12 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 4 - -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] +version = 3 [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aead" @@ -55,23 +46,23 @@ dependencies = [ [[package]] name = "agave-feature-set" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be80c9787c7f30819e2999987cc6208c1ec6f775d7ed2b70f61a00a6e8acc0c8" +checksum = "60d1d6cdea1a6102777bc970c96f5eb80635b097b7bbc0ee8770425fb13e6020" dependencies = [ - "ahash 0.8.11", - "solana-epoch-schedule 3.0.0", + "ahash 0.8.12", + "solana-epoch-schedule", "solana-hash 3.1.0", "solana-pubkey 3.0.0", - "solana-sha256-hasher 3.0.0", + "solana-sha256-hasher", "solana-svm-feature-set", ] [[package]] name = "agave-io-uring" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81f299d8f456e09697966c084619935966c8e0cab4cb2aaf6529f80bd2e359c7" +checksum = "da3349bc98a1ee30343b32a6b4d7e6f2a7efe7b65a359d1c638e00cdcff1c0ba" dependencies = [ "io-uring", "libc", @@ -82,9 +73,9 @@ dependencies = [ [[package]] name = "agave-precompiles" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1a2453f1454c71842928844613289c9d6869ea46faaa30e7c7649e432a429" +checksum = "add43fafbff72439a1a9f3323dd8f3d6ff3cffe926c8e3fe9c79980d620664ab" dependencies = [ "agave-feature-set", "bincode", @@ -94,80 +85,80 @@ dependencies = [ "openssl", "sha3", "solana-ed25519-program", - "solana-message 3.0.0", + "solana-message", "solana-precompile-error", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "solana-secp256k1-program", "solana-secp256r1-program", ] [[package]] name = "agave-reserved-account-keys" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb2704410f79989956488f49d6f48fcc4f66e2e6c11d8b5f40e0e01bfbd6b91" +checksum = "a5e42f6eada9c1a059c32fa416f7885c3c85ffe07f3f2b95bdd8ddd0749e918d" dependencies = [ "agave-feature-set", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", ] [[package]] name = "agave-syscalls" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8605fba7ba3e97426ab19179d565a7cd9d6b5566ff49004784c99e302ac7953" +checksum = "c23bd4d08321e47b656fdeb5c89106d547f6460c84ace049cc4f676074dd1e54" dependencies = [ "bincode", "libsecp256k1", "num-traits", - "solana-account 3.2.0", - "solana-account-info 3.0.0", - "solana-big-mod-exp 3.0.0", - "solana-blake3-hasher 3.0.0", + "solana-account", + "solana-account-info", + "solana-big-mod-exp", + "solana-blake3-hasher", "solana-bn254", - "solana-clock 3.0.0", - "solana-cpi 3.0.0", + "solana-clock", + "solana-cpi", "solana-curve25519", "solana-hash 3.1.0", - "solana-instruction 3.0.0", - "solana-keccak-hasher 3.0.0", - "solana-loader-v3-interface 6.1.0", + "solana-instruction", + "solana-keccak-hasher", + "solana-loader-v3-interface", "solana-poseidon", - "solana-program-entrypoint 3.1.0", + "solana-program-entrypoint", "solana-program-runtime", "solana-pubkey 3.0.0", "solana-sbpf", - "solana-sdk-ids 3.0.0", - "solana-secp256k1-recover 3.0.0", - "solana-sha256-hasher 3.0.0", - "solana-stable-layout 3.0.0", - "solana-stake-interface 2.0.1", + "solana-sdk-ids", + "solana-secp256k1-recover", + "solana-sha256-hasher", + "solana-stable-layout", + "solana-stake-interface 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "solana-svm-callback", "solana-svm-feature-set", "solana-svm-log-collector", "solana-svm-measure", "solana-svm-timings", "solana-svm-type-overrides", - "solana-sysvar 3.0.0", - "solana-sysvar-id 3.0.0", + "solana-sysvar", + "solana-sysvar-id", "solana-transaction-context", "thiserror 2.0.17", ] [[package]] name = "agave-transaction-view" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04daeab9de8d1098156d2a73ec5e8dd019b628884c201e5af3f1e8baeffd1b0" +checksum = "bf111212dc76970e53eeb7e506b73ed8fa42f4de24f8ceced67b0c56bea730d7" dependencies = [ "solana-hash 3.1.0", - "solana-message 3.0.0", + "solana-message", "solana-packet", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-short-vec 3.0.0", + "solana-sdk-ids", + "solana-short-vec", "solana-signature", "solana-svm-transaction", ] @@ -178,19 +169,19 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", - "getrandom 0.2.15", + "getrandom 0.3.4", "once_cell", "version_check", "zerocopy", @@ -198,9 +189,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" dependencies = [ "memchr", ] @@ -220,12 +211,6 @@ dependencies = [ "alloc-no-stdlib", ] -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - [[package]] name = "android_system_properties" version = "0.1.5" @@ -237,9 +222,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.20" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" dependencies = [ "anstyle", "anstyle-parse", @@ -267,22 +252,22 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.10" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -302,7 +287,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -513,14 +498,13 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.18" +version = "0.4.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df895a515f70646414f4b45c0b79082783b80552b373a68283012928df56f522" +checksum = "98ec5f6c2f8bc326c994cb9e241cc257ddaba9afa8555a43cffbb5dd86efaa37" dependencies = [ - "brotli", - "flate2", + "compression-codecs", + "compression-core", "futures-core", - "memchr", "pin-project-lite", "tokio", ] @@ -531,7 +515,7 @@ version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc" dependencies = [ - "event-listener 5.4.0", + "event-listener 5.4.1", "event-listener-strategy", "pin-project-lite", ] @@ -544,29 +528,20 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] -name = "autocfg" -version = "1.4.0" +name = "atomic-waker" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] -name = "backtrace" -version = "0.3.74" +name = "autocfg" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets 0.52.6", -] +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "base16ct" @@ -594,9 +569,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.7.3" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" +checksum = "0e050f626429857a27ddccb31e0aca21356bfa709c04041aefddac081a8f068a" [[package]] name = "bincode" @@ -624,11 +599,11 @@ checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitflags" -version = "2.9.4" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -674,83 +649,38 @@ dependencies = [ [[package]] name = "borsh" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115e54d64eb62cdebad391c19efc9dce4981c690c85a33a12199d99bb9546fee" -dependencies = [ - "borsh-derive 0.10.4", - "hashbrown 0.13.2", -] - -[[package]] -name = "borsh" -version = "1.5.7" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" +checksum = "d1da5ab77c1437701eeff7c88d968729e7766172279eab0676857b3d63af7a6f" dependencies = [ - "borsh-derive 1.5.7", + "borsh-derive", "cfg_aliases", ] [[package]] name = "borsh-derive" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831213f80d9423998dd696e2c5345aba6be7a0bd8cd19e31c5243e13df1cef89" -dependencies = [ - "borsh-derive-internal", - "borsh-schema-derive-internal", - "proc-macro-crate 0.1.5", - "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "borsh-derive" -version = "1.5.7" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3" +checksum = "0686c856aa6aac0c4498f936d7d6a02df690f614c03e4d906d1018062b5c5e2c" dependencies = [ "once_cell", - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "borsh-derive-internal" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65d6ba50644c98714aa2a70d13d7df3cd75cd2b523a2b452bf010443800976b3" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "borsh-schema-derive-internal" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276691d96f063427be83e6692b86148e488ebba9f48f77788724ca027ba3b6d4" -dependencies = [ + "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.111", ] [[package]] name = "boxcar" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c4925bc979b677330a8c7fe7a8c94af2dbb4a2d37b4a20a80d884400f46baa" +checksum = "36f64beae40a84da1b4b26ff2761a5b895c12adc41dc25aaee1c4f2bbfe97a6e" [[package]] name = "brotli" -version = "7.0.0" +version = "8.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" +checksum = "4bd8b9603c7aa97359dbd97ecf258968c95f3adddd6db2f7e7a5bef101c84560" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -759,9 +689,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "4.0.2" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" +checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -778,9 +708,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "bv" @@ -794,22 +724,22 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.23.2" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3995eaeebcdf32f91f980d360f78732ddc061097ab4e39991ae7a6ace9194677" +checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.10.1" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f154e572231cb6ba2bd1176980827e3d5dc04cc183a75dea38109fbdd672d29" +checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -820,9 +750,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" dependencies = [ "serde", ] @@ -839,31 +769,40 @@ dependencies = [ [[package]] name = "bzip2-sys" -version = "0.1.12+1.0.8" +version = "0.1.13+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ebc2f1a417f01e1da30ef264ee86ae31d2dcd2d603ea283d3c244a883ca2a9" +checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" dependencies = [ "cc", - "libc", "pkg-config", ] [[package]] name = "caps" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190baaad529bcfbde9e1a19022c42781bdb6ff9de25721abdb8fd98c0807730b" +checksum = "fd1ddba47aba30b6a889298ad0109c3b8dcb0e8fc993b459daa7067d46f865e0" dependencies = [ "libc", - "thiserror 1.0.69", +] + +[[package]] +name = "cargo_toml" +version = "0.20.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88da5a13c620b4ca0078845707ea9c3faf11edbc3ffd8497d11d686211cd1ac0" +dependencies = [ + "serde", + "toml", ] [[package]] name = "cc" -version = "1.2.13" +version = "1.2.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7777341816418c02e033934a09f20dc0ccaf65a5201ef8a450ae0105a573fda" +checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215" dependencies = [ + "find-msvc-tools", "jobserver", "libc", "shlex", @@ -877,9 +816,9 @@ checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cfg_aliases" @@ -895,20 +834,19 @@ checksum = "45565fc9416b9896014f5732ac776f810ee53a66730c17e4020c3ec064a8f88f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" dependencies = [ - "android-tzdata", "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.6", + "windows-link", ] [[package]] @@ -930,6 +868,149 @@ dependencies = [ "inout", ] +[[package]] +name = "codama" +version = "0.7.0" +source = "git+https://github.com/rustopian/codama-rs.git?branch=multiple-attributes#5adaca859cb8e47ebc0d24d6c37113d2a662b892" +dependencies = [ + "codama-errors", + "codama-korok-plugins", + "codama-korok-visitors", + "codama-koroks", + "codama-macros", + "codama-nodes", + "codama-stores", + "proc-macro2", +] + +[[package]] +name = "codama-attributes" +version = "0.7.0" +source = "git+https://github.com/rustopian/codama-rs.git?branch=multiple-attributes#5adaca859cb8e47ebc0d24d6c37113d2a662b892" +dependencies = [ + "codama-errors", + "codama-nodes", + "codama-syn-helpers", + "derive_more", + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "codama-errors" +version = "0.7.0" +source = "git+https://github.com/rustopian/codama-rs.git?branch=multiple-attributes#5adaca859cb8e47ebc0d24d6c37113d2a662b892" +dependencies = [ + "cargo_toml", + "proc-macro2", + "serde_json", + "syn 2.0.111", + "thiserror 2.0.17", +] + +[[package]] +name = "codama-korok-plugins" +version = "0.7.0" +source = "git+https://github.com/rustopian/codama-rs.git?branch=multiple-attributes#5adaca859cb8e47ebc0d24d6c37113d2a662b892" +dependencies = [ + "codama-errors", + "codama-korok-visitors", + "codama-koroks", +] + +[[package]] +name = "codama-korok-visitors" +version = "0.7.0" +source = "git+https://github.com/rustopian/codama-rs.git?branch=multiple-attributes#5adaca859cb8e47ebc0d24d6c37113d2a662b892" +dependencies = [ + "cargo_toml", + "codama-attributes", + "codama-errors", + "codama-koroks", + "codama-nodes", + "codama-syn-helpers", + "serde_json", + "syn 2.0.111", +] + +[[package]] +name = "codama-koroks" +version = "0.7.0" +source = "git+https://github.com/rustopian/codama-rs.git?branch=multiple-attributes#5adaca859cb8e47ebc0d24d6c37113d2a662b892" +dependencies = [ + "codama-attributes", + "codama-errors", + "codama-nodes", + "codama-stores", + "codama-syn-helpers", + "derive_more", + "proc-macro2", + "syn 2.0.111", +] + +[[package]] +name = "codama-macros" +version = "0.7.0" +source = "git+https://github.com/rustopian/codama-rs.git?branch=multiple-attributes#5adaca859cb8e47ebc0d24d6c37113d2a662b892" +dependencies = [ + "codama-attributes", + "codama-errors", + "codama-koroks", + "codama-stores", + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "codama-nodes" +version = "0.7.0" +source = "git+https://github.com/rustopian/codama-rs.git?branch=multiple-attributes#5adaca859cb8e47ebc0d24d6c37113d2a662b892" +dependencies = [ + "codama-errors", + "codama-nodes-derive", + "derive_more", + "serde", + "serde_json", +] + +[[package]] +name = "codama-nodes-derive" +version = "0.7.0" +source = "git+https://github.com/rustopian/codama-rs.git?branch=multiple-attributes#5adaca859cb8e47ebc0d24d6c37113d2a662b892" +dependencies = [ + "codama-errors", + "codama-syn-helpers", + "derive_more", + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "codama-stores" +version = "0.7.0" +source = "git+https://github.com/rustopian/codama-rs.git?branch=multiple-attributes#5adaca859cb8e47ebc0d24d6c37113d2a662b892" +dependencies = [ + "cargo_toml", + "codama-errors", + "proc-macro2", + "syn 2.0.111", +] + +[[package]] +name = "codama-syn-helpers" +version = "0.7.0" +source = "git+https://github.com/rustopian/codama-rs.git?branch=multiple-attributes#5adaca859cb8e47ebc0d24d6c37113d2a662b892" +dependencies = [ + "codama-errors", + "derive_more", + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "colorchoice" version = "1.0.4" @@ -959,6 +1040,24 @@ dependencies = [ "memchr", ] +[[package]] +name = "compression-codecs" +version = "0.4.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0f7ac3e5b97fdce45e8922fb05cae2c37f7bbd63d30dd94821dacfd8f3f2bf2" +dependencies = [ + "brotli", + "compression-core", + "flate2", + "memchr", +] + +[[package]] +name = "compression-core" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75984efb6ed102a0d42db99afb6c1948f0380d1d91808d5529916e6c08b49d8d" + [[package]] name = "concurrent-queue" version = "2.5.0" @@ -978,27 +1077,7 @@ dependencies = [ "libc", "once_cell", "unicode-width", - "windows-sys 0.61.1", -] - -[[package]] -name = "console_error_panic_hook" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" -dependencies = [ - "cfg-if", - "wasm-bindgen", -] - -[[package]] -name = "console_log" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" -dependencies = [ - "log", - "web-sys", + "windows-sys 0.61.2", ] [[package]] @@ -1040,9 +1119,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] @@ -1083,9 +1162,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "crypto-bigint" @@ -1101,9 +1180,9 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ "generic-array", "rand_core 0.6.4", @@ -1168,7 +1247,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -1192,7 +1271,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -1203,7 +1282,7 @@ checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ "darling_core", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -1223,9 +1302,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "der" @@ -1253,12 +1332,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.11" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" dependencies = [ "powerfmt", - "serde", + "serde_core", ] [[package]] @@ -1280,13 +1359,33 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" +checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", ] [[package]] @@ -1333,7 +1432,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -1356,7 +1455,7 @@ checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -1434,7 +1533,7 @@ dependencies = [ "ed25519 2.2.3", "rand_core 0.6.4", "serde", - "sha2 0.10.8", + "sha2 0.10.9", "subtle", "zeroize", ] @@ -1448,7 +1547,7 @@ dependencies = [ "derivation-path", "ed25519-dalek 2.2.0", "hmac 0.12.1", - "sha2 0.10.8", + "sha2 0.10.9", ] [[package]] @@ -1465,9 +1564,9 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "elliptic-curve" @@ -1505,13 +1604,13 @@ dependencies = [ [[package]] name = "enum-iterator-derive" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" +checksum = "685adfa4d6f3d765a26bc5dbc936577de9abf756c1feeb3089b01dd395034842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -1524,14 +1623,14 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] name = "env_filter" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" +checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" dependencies = [ "log", "regex", @@ -1552,18 +1651,18 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1574,9 +1673,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "5.4.0" +version = "5.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" dependencies = [ "concurrent-queue", "parking", @@ -1585,24 +1684,24 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ - "event-listener 5.4.0", + "event-listener 5.4.1", "pin-project-lite", ] [[package]] name = "fastbloom" -version = "0.9.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27cea6e7f512d43b098939ff4d5a5d6fe3db07971e1d05176fe26c642d33f5b8" +checksum = "18c1ddb9231d8554c2d6bdf4cfaabf0c59251658c68b6c95cd52dd0c513a912a" dependencies = [ - "getrandom 0.3.1", + "getrandom 0.3.4", + "libm", "rand 0.9.2", "siphasher 1.0.1", - "wide", ] [[package]] @@ -1635,23 +1734,29 @@ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "filetime" -version = "0.2.25" +version = "0.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +checksum = "bc0505cd1b6fa6580283f6bdf70a73fcf4aba1184038c90902b92b3dd0df63ed" dependencies = [ "cfg-if", "libc", "libredox", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] +[[package]] +name = "find-msvc-tools" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" + [[package]] name = "five8" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75b8549488b4715defcb0d8a8a1c1c76a80661b5fa106b4ca0e7fce59d7d875" dependencies = [ - "five8_core", + "five8_core 0.1.2", ] [[package]] @@ -1660,29 +1765,35 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23f76610e969fa1784327ded240f1e28a3fd9520c9cec93b636fcf62dd37f772" dependencies = [ - "five8_core", + "five8_core 1.0.0", ] [[package]] name = "five8_const" -version = "0.1.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b4f62f0f8ca357f93ae90c8c2dd1041a1f665fde2f889ea9b1787903829015" +checksum = "1a0f1728185f277989ca573a402716ae0beaaea3f76a8ff87ef9dd8fb19436c5" dependencies = [ - "five8_core", + "five8_core 1.0.0", ] [[package]] name = "five8_core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94474d15a76982be62ca8a39570dccce148d98c238ebb7408b0a21b2c4bdddc4" +checksum = "2551bf44bc5f776c15044b9b94153a00198be06743e262afaaa61f11ac7523a5" + +[[package]] +name = "five8_core" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "059c31d7d36c43fe39d89e55711858b4da8be7eb6dabac23c7289b1a19489406" [[package]] name = "flate2" -version = "1.0.35" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" dependencies = [ "crc32fast", "miniz_oxide", @@ -1720,18 +1831,18 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] [[package]] name = "fragile" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" +checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" [[package]] name = "futures" @@ -1789,7 +1900,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -1862,37 +1973,31 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.13.3+wasi-0.2.2", + "r-efi", + "wasip2", "wasm-bindgen", - "windows-targets 0.52.6", ] -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - [[package]] name = "governor" version = "0.6.3" @@ -1948,7 +2053,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.11", + "ahash 0.8.12", ] [[package]] @@ -1959,9 +2064,9 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" [[package]] name = "heck" @@ -2036,12 +2141,11 @@ dependencies = [ [[package]] name = "http" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" dependencies = [ "bytes", - "fnv", "itoa", ] @@ -2052,7 +2156,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.3.1", + "http 1.4.0", ] [[package]] @@ -2063,37 +2167,39 @@ checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", "futures-core", - "http 1.3.1", + "http 1.4.0", "http-body", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "humantime" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" [[package]] name = "hyper" -version = "1.6.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" dependencies = [ + "atomic-waker", "bytes", "futures-channel", - "futures-util", - "http 1.3.1", + "futures-core", + "http 1.4.0", "http-body", "httparse", "itoa", "pin-project-lite", + "pin-utils", "smallvec", "tokio", "want", @@ -2105,36 +2211,36 @@ version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ - "http 1.3.1", + "http 1.4.0", "hyper", "hyper-util", - "rustls 0.23.32", + "rustls 0.23.35", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.2", + "tokio-rustls 0.26.4", "tower-service", - "webpki-roots 1.0.2", + "webpki-roots 1.0.4", ] [[package]] name = "hyper-util" -version = "0.1.16" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e" +checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" dependencies = [ "base64 0.22.1", "bytes", "futures-channel", "futures-core", "futures-util", - "http 1.3.1", + "http 1.4.0", "http-body", "hyper", "ipnet", "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.0", + "socket2", "tokio", "tower-service", "tracing", @@ -2142,14 +2248,15 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -2165,21 +2272,22 @@ dependencies = [ [[package]] name = "icu_collections" -version = "1.5.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" dependencies = [ "displaydoc", + "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "icu_locale_core" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" dependencies = [ "displaydoc", "litemap", @@ -2188,99 +2296,61 @@ dependencies = [ "zerovec", ] -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - [[package]] name = "icu_normalizer" -version = "1.5.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" dependencies = [ - "displaydoc", "icu_collections", "icu_normalizer_data", "icu_properties", "icu_provider", "smallvec", - "utf16_iter", - "utf8_iter", - "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" [[package]] name = "icu_properties" -version = "1.5.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" dependencies = [ - "displaydoc", "icu_collections", - "icu_locid_transform", + "icu_locale_core", "icu_properties_data", "icu_provider", - "tinystr", + "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" [[package]] name = "icu_provider" -version = "1.5.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" dependencies = [ "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", + "icu_locale_core", "writeable", "yoke", "zerofrom", + "zerotrie", "zerovec", ] -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - [[package]] name = "ident_case" version = "1.0.1" @@ -2289,9 +2359,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", "smallvec", @@ -2300,9 +2370,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", @@ -2356,20 +2426,21 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.10.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown 0.16.1", "serde", + "serde_core", ] [[package]] name = "indicatif" -version = "0.18.0" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a646d946d06bedbbc4cac4c218acf4bbf2d87757a784857025f4d447e4e1cd" +checksum = "9375e112e4b463ec1b1c6c011953545c65a30164fbab5b581df32b3abf0dcb88" dependencies = [ "console", "portable-atomic", @@ -2380,18 +2451,18 @@ dependencies = [ [[package]] name = "inout" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" dependencies = [ "generic-array", ] [[package]] name = "io-uring" -version = "0.7.9" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4" +checksum = "fdd7bddefd0a8833b88a4b68f90dae22c7450d11b354198baee3874fd811b344" dependencies = [ "bitflags", "cfg-if", @@ -2406,9 +2477,9 @@ checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "iri-string" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" +checksum = "4f867b9d1d896b67beb18518eda36fdb77a32ea590de864f1325b294a6d14397" dependencies = [ "memchr", "serde", @@ -2416,9 +2487,9 @@ dependencies = [ [[package]] name = "is_terminal_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itertools" @@ -2440,32 +2511,32 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jiff" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" +checksum = "49cce2b81f2098e7e3efc35bc2e0a6b7abec9d34128283d7a26fa8f32a6dbb35" dependencies = [ "jiff-static", "log", "portable-atomic", "portable-atomic-util", - "serde", + "serde_core", ] [[package]] name = "jiff-static" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" +checksum = "980af8b43c3ad5d8d349ace167ec8170839f753a42d233ba19e08afe1850fa69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -2492,18 +2563,19 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ + "getrandom 0.3.4", "libc", ] [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" dependencies = [ "once_cell", "wasm-bindgen", @@ -2534,7 +2606,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", - "sha2 0.10.8", + "sha2 0.10.9", "signature 2.2.0", ] @@ -2555,15 +2627,21 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.176" +version = "0.2.178" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" + +[[package]] +name = "libm" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "libredox" -version = "0.1.3" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" dependencies = [ "bitflags", "libc", @@ -2632,37 +2710,30 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - -[[package]] -name = "linux-raw-sys" -version = "0.9.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "litemap" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" dependencies = [ - "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.27" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "lru" @@ -2700,9 +2771,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "memmap2" @@ -2715,9 +2786,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.9.7" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "483758ad303d734cec05e5c12b41d7e93e6a6390c5e9dae6bdeb7c1259012d28" +checksum = "744133e4a0e0a658e1374cf3bf8e415c4052a15a111acd372764c55b4177d490" dependencies = [ "libc", ] @@ -2751,22 +2822,23 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.3" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", + "simd-adler32", ] [[package]] name = "mio" -version = "1.0.3" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.61.2", ] [[package]] @@ -2819,9 +2891,9 @@ dependencies = [ [[package]] name = "mollusk-svm" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa2a9a8f63c0ba125cbfb934a6180b321f41ee61f1de96b8b6c081aa1772805" +checksum = "6ed52e82370cbf4f266a65603d7d1cbe7faf94fcf769d068c0b89bb934a882e3" dependencies = [ "agave-feature-set", "agave-syscalls", @@ -2829,42 +2901,42 @@ dependencies = [ "mollusk-svm-error", "mollusk-svm-keys", "mollusk-svm-result", - "solana-account 3.2.0", + "solana-account", "solana-bpf-loader-program", - "solana-clock 3.0.0", + "solana-clock", "solana-compute-budget", - "solana-epoch-rewards 3.0.0", - "solana-epoch-schedule 3.0.0", + "solana-epoch-rewards", + "solana-epoch-schedule", "solana-hash 3.1.0", - "solana-instruction 3.0.0", + "solana-instruction", "solana-instruction-error", - "solana-loader-v3-interface 6.1.0", - "solana-loader-v4-interface 3.1.0", + "solana-loader-v3-interface", + "solana-loader-v4-interface", "solana-loader-v4-program", "solana-logger", "solana-precompile-error", - "solana-program-error 3.0.0", + "solana-program-error", "solana-program-runtime", "solana-pubkey 3.0.0", - "solana-rent 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-slot-hashes 3.0.0", - "solana-stake-interface 2.0.1", - "solana-stake-program 3.0.10", + "solana-rent", + "solana-sdk-ids", + "solana-slot-hashes", + "solana-stake-interface 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-stake-program 3.0.12", "solana-svm-callback", "solana-svm-log-collector", "solana-svm-timings", "solana-system-program", - "solana-sysvar 3.0.0", - "solana-sysvar-id 3.0.0", + "solana-sysvar", + "solana-sysvar-id", "solana-transaction-context", ] [[package]] name = "mollusk-svm-error" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea155b60511338a5a39c077a457baa8268c229629f091e3281f499b0ab3a96b4" +checksum = "682ad3a990ae8f336ee10f402da2e900a37cff38730e29aa8cda2d82e1b2e9f1" dependencies = [ "solana-pubkey 3.0.0", "thiserror 1.0.69", @@ -2872,28 +2944,28 @@ dependencies = [ [[package]] name = "mollusk-svm-keys" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7849281d0ce4f3894742cf508a98b33c3bb284eb7df9d66476ab2168945f128" +checksum = "b97ddf2442ea621ea5ae25b0c21ae2861588ea34abce0d059cb601de24cd646f" dependencies = [ "mollusk-svm-error", - "solana-account 3.2.0", - "solana-instruction 3.0.0", + "solana-account", + "solana-instruction", "solana-pubkey 3.0.0", "solana-transaction-context", ] [[package]] name = "mollusk-svm-result" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f50b90812979ca5bb440f0a86e970355853d0e9466b939f88ad30af188e20525" +checksum = "4f23d402bb19bac3b25b02ada2cf1f58dd4bc8e4b12a38fc1f58aef0090ff0f6" dependencies = [ - "solana-account 3.2.0", - "solana-instruction 3.0.0", - "solana-program-error 3.0.0", + "solana-account", + "solana-instruction", + "solana-program-error", "solana-pubkey 3.0.0", - "solana-rent 3.0.0", + "solana-rent", ] [[package]] @@ -2996,7 +3068,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -3052,9 +3124,9 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a973b4e44ce6cad84ce69d797acf9a044532e4184c4f267913d1b546a0727b7a" +checksum = "b1207a7e20ad57b847bbddc6776b968420d38292bbfe2089accff5e19e82454c" dependencies = [ "num_enum_derive", "rustversion", @@ -3062,23 +3134,14 @@ dependencies = [ [[package]] name = "num_enum_derive" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" +checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.98", -] - -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", + "syn 2.0.111", ] [[package]] @@ -3092,15 +3155,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.3" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "once_cell_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "opaque-debug" @@ -3110,9 +3173,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.72" +version = "0.10.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" +checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" dependencies = [ "bitflags", "cfg-if", @@ -3131,7 +3194,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -3142,18 +3205,18 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-src" -version = "300.5.1+3.5.1" +version = "300.5.4+3.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735230c832b28c000e3bc117119e6466a663ec73506bc0a9907ea4187508e42a" +checksum = "a507b3792995dae9b0df8a1c1e3771e8418b7c2d9f0baeba32e6fe8b06c7cb72" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.107" +version = "0.9.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8288979acd84749c744a9014b4382d42b8f7b2592847b5afb2ed29e5d16ede07" +checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" dependencies = [ "cc", "libc", @@ -3189,9 +3252,9 @@ checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ "lock_api", "parking_lot_core", @@ -3199,15 +3262,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.6", + "windows-link", ] [[package]] @@ -3236,9 +3299,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "percentage" @@ -3251,22 +3314,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfe2e71e1471fe07709406bf725f710b02927c9c54b2b5b2ec0e8087d97c327d" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e859e6e5bd50440ab63c47e3ebabc90f26251f7c73c3d3e837b74a1cc3fa67" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -3293,9 +3356,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "polyval" @@ -3311,9 +3374,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] name = "portable-atomic-util" @@ -3324,6 +3387,15 @@ dependencies = [ "portable-atomic", ] +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -3332,9 +3404,9 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ "zerocopy", ] @@ -3371,20 +3443,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml", -] - -[[package]] -name = "proc-macro-crate" -version = "3.2.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ - "toml_edit", + "toml_edit 0.23.9", ] [[package]] @@ -3410,9 +3473,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" dependencies = [ "unicode-ident", ] @@ -3453,20 +3516,20 @@ checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] name = "quanta" -version = "0.12.5" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd1fe6824cea6538803de3ff1bc0cf3949024db3d43c9643024bfb33a807c0e" +checksum = "f3ab5a9d756f0d97bdc89019bd2e4ea098cf9cde50ee7564dde6b81ccc8f06c7" dependencies = [ "crossbeam-utils", "libc", "once_cell", "raw-cpuid", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", "web-sys", "winapi", ] @@ -3479,9 +3542,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quinn" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626214629cda6781b6dc1d316ba307189c85ba657213ce642d9c77670f8202c8" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" dependencies = [ "bytes", "cfg_aliases", @@ -3489,8 +3552,8 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.32", - "socket2 0.5.10", + "rustls 0.23.35", + "socket2", "thiserror 2.0.17", "tokio", "tracing", @@ -3499,18 +3562,18 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.12" +version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49df843a9161c85bb8aae55f101bc0bac8bcafd637a620d9122fd7e0b2f7422e" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" dependencies = [ "bytes", "fastbloom", - "getrandom 0.3.1", + "getrandom 0.3.4", "lru-slab", "rand 0.9.2", "ring", "rustc-hash", - "rustls 0.23.32", + "rustls 0.23.35", "rustls-pki-types", "rustls-platform-verifier", "slab", @@ -3522,27 +3585,33 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.9" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c40286217b4ba3a71d644d752e6a0b71f13f1b6a2c5311acfcbe0c2418ed904" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.5.10", + "socket2", "tracing", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "rand" version = "0.7.3" @@ -3622,7 +3691,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", ] [[package]] @@ -3631,7 +3700,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom 0.3.1", + "getrandom 0.3.4", ] [[package]] @@ -3663,18 +3732,18 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.3.0" +version = "11.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6928fa44c097620b706542d428957635951bade7143269085389d42c8a4927e" +checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" dependencies = [ "bitflags", ] [[package]] name = "rayon" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" dependencies = [ "either", "rayon-core", @@ -3682,9 +3751,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -3692,9 +3761,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ "bitflags", ] @@ -3716,14 +3785,14 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] name = "regex" -version = "1.11.1" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" dependencies = [ "aho-corasick", "memchr", @@ -3733,9 +3802,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.9" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" dependencies = [ "aho-corasick", "memchr", @@ -3744,23 +3813,22 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" [[package]] name = "reqwest" -version = "0.12.23" +version = "0.12.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb" +checksum = "b6eff9328d40131d43bd911d42d79eb6a47312002a4daefc9e37f17e74a7701a" dependencies = [ - "async-compression", "base64 0.22.1", "bytes", "futures-channel", "futures-core", "futures-util", - "http 1.3.1", + "http 1.4.0", "http-body", "http-body-util", "hyper", @@ -3771,15 +3839,14 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.32", + "rustls 0.23.35", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", "tokio", - "tokio-rustls 0.26.2", - "tokio-util 0.7.16", + "tokio-rustls 0.26.4", "tower", "tower-http", "tower-service", @@ -3787,7 +3854,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 1.0.2", + "webpki-roots 1.0.4", ] [[package]] @@ -3798,7 +3865,7 @@ checksum = "57f17d28a6e6acfe1733fe24bcd30774d13bffa4b8a22535b4c8c98423088d4e" dependencies = [ "anyhow", "async-trait", - "http 1.3.1", + "http 1.4.0", "reqwest", "serde", "thiserror 1.0.69", @@ -3817,13 +3884,13 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.13" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.15", + "getrandom 0.2.16", "libc", "untrusted", "windows-sys 0.52.0", @@ -3831,9 +3898,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" [[package]] name = "rustc-hash" @@ -3861,28 +3928,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", -] - -[[package]] -name = "rustix" -version = "1.0.8" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" dependencies = [ "bitflags", "errno", "libc", - "linux-raw-sys 0.9.4", - "windows-sys 0.60.2", + "linux-raw-sys", + "windows-sys 0.61.2", ] [[package]] @@ -3899,23 +3953,23 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.32" +version = "0.23.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3c25631629d034ce7cd9940adc9d45762d46de2b0f57193c4443b92c6d4d40" +checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.103.7", + "rustls-webpki 0.103.8", "subtle", "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" +checksum = "9980d917ebb0c0536119ba501e90834767bffc3d60641457fd84a1f3fd337923" dependencies = [ "openssl-probe", "rustls-pki-types", @@ -3925,9 +3979,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.12.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +checksum = "708c0f9d5f54ba0272468c1d306a52c495b31fa155e91bc25371e6df7996908c" dependencies = [ "web-time", "zeroize", @@ -3935,23 +3989,23 @@ dependencies = [ [[package]] name = "rustls-platform-verifier" -version = "0.5.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19787cda76408ec5404443dc8b31795c87cd8fec49762dc75fa727740d34acc1" +checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" dependencies = [ "core-foundation", "core-foundation-sys", "jni", "log", "once_cell", - "rustls 0.23.32", + "rustls 0.23.35", "rustls-native-certs", "rustls-platform-verifier-android", - "rustls-webpki 0.103.7", + "rustls-webpki 0.103.8", "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -3972,9 +4026,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.7" +version = "0.103.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10b3f4191e8a80e6b43eebabfac91e5dcecebb27a71f04e820c47ec41d314bf" +checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" dependencies = [ "ring", "rustls-pki-types", @@ -3983,15 +4037,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "rusty-fork" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +checksum = "cc6bf79ff24e648f6da1f8d1f011e9cac26491b619e6b9280f2b47f1774e6ee2" dependencies = [ "fnv", "quick-error", @@ -4001,18 +4055,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" - -[[package]] -name = "safe_arch" -version = "0.7.4" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" -dependencies = [ - "bytemuck", -] +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "same-file" @@ -4034,11 +4079,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -4055,9 +4100,9 @@ dependencies = [ [[package]] name = "schemars" -version = "1.0.4" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +checksum = "9558e172d4e8533736ba97870c4b2cd63f84b382a3d6eb063da41b91cce17289" dependencies = [ "dyn-clone", "ref-cast", @@ -4103,9 +4148,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.2.0" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" +checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" dependencies = [ "bitflags", "core-foundation", @@ -4116,9 +4161,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.14.0" +version = "2.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" dependencies = [ "core-foundation-sys", "libc", @@ -4126,9 +4171,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" [[package]] name = "seqlock" @@ -4160,11 +4205,12 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.15" +version = "0.11.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" dependencies = [ "serde", + "serde_core", ] [[package]] @@ -4184,7 +4230,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -4200,6 +4246,15 @@ dependencies = [ "serde_core", ] +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -4214,17 +4269,17 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.15.1" +version = "3.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa66c845eee442168b2c8134fec70ac50dc20e760769c8ba0ad1319ca1959b04" +checksum = "4fa237f2807440d238e0364a218270b98f767a00d3dada77b1c53ae88940e2e7" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.10.0", + "indexmap 2.12.1", "schemars 0.9.0", - "schemars 1.0.4", + "schemars 1.1.0", "serde_core", "serde_json", "serde_with_macros", @@ -4233,14 +4288,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.15.1" +version = "3.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91a903660542fced4e99881aa481bdbaec1634568ee02e0b8bd57c64cb38955" +checksum = "52a8e3ca0ca629121f70ab50f95249e5a6f925cc0f6ffe8256c45b728875706c" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -4265,7 +4320,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -4294,9 +4349,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -4340,9 +4395,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" dependencies = [ "libc", ] @@ -4363,6 +4418,12 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "simd-adler32" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" + [[package]] name = "siphasher" version = "0.3.11" @@ -4399,35 +4460,12 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "socket2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "socket2" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" dependencies = [ "libc", - "windows-sys 0.59.0", -] - -[[package]] -name = "solana-account" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f949fe4edaeaea78c844023bfc1c898e0b1f5a100f8a8d2d0f85d0a7b090258" -dependencies = [ - "solana-account-info 2.2.1", - "solana-clock 2.2.2", - "solana-instruction 2.3.0", - "solana-pubkey 2.4.0", - "solana-sdk-ids 2.2.1", + "windows-sys 0.60.2", ] [[package]] @@ -4441,64 +4479,51 @@ dependencies = [ "serde", "serde_bytes", "serde_derive", - "solana-account-info 3.0.0", - "solana-clock 3.0.0", + "solana-account-info", + "solana-clock", "solana-instruction-error", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-sysvar 3.0.0", + "solana-sdk-ids", + "solana-sysvar", ] [[package]] name = "solana-account-decoder-client-types" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a254419b647ca675bd0d55749c24a3383691a00e633e38ae58d070223ac01bf2" +checksum = "f30db952cfdee7a817108f0034a1e10ca6ec3e4aebf73b043286069b8c9c2cb9" dependencies = [ "base64 0.22.1", "bs58", "serde", "serde_derive", "serde_json", - "solana-account 3.2.0", + "solana-account", "solana-pubkey 3.0.0", "zstd", ] [[package]] name = "solana-account-info" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c17d606a298a205fae325489fbed88ee6dc4463c111672172327e741c8905d" -dependencies = [ - "bincode", - "serde", - "solana-program-error 2.2.1", - "solana-program-memory 2.2.1", - "solana-pubkey 2.4.0", -] - -[[package]] -name = "solana-account-info" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82f4691b69b172c687d218dd2f1f23fc7ea5e9aa79df9ac26dab3d8dd829ce48" +checksum = "fc3397241392f5756925029acaa8515dc70fcbe3d8059d4885d7d6533baf64fd" dependencies = [ "bincode", - "serde", - "solana-program-error 3.0.0", - "solana-program-memory 3.0.0", - "solana-pubkey 3.0.0", + "serde_core", + "solana-address 2.0.0", + "solana-program-error", + "solana-program-memory", ] [[package]] name = "solana-accounts-db" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81e38e11de48b1f91fcf918bede16d56c961cdbb465dbd7d83d56ac45f4999f4" +checksum = "c4e24246ff12fe39bb7f2d26745d9168caa783d05cc20a53265c747e862dbb94" dependencies = [ "agave-io-uring", - "ahash 0.8.11", + "ahash 0.8.12", "bincode", "blake3", "bv", @@ -4507,13 +4532,13 @@ dependencies = [ "bzip2", "crossbeam-channel", "dashmap", - "indexmap 2.10.0", + "indexmap 2.12.1", "io-uring", "itertools 0.12.1", "libc", "log", "lz4", - "memmap2 0.9.7", + "memmap2 0.9.9", "modular-bitfield", "num_cpus", "num_enum", @@ -4524,31 +4549,31 @@ dependencies = [ "serde_derive", "slab", "smallvec", - "solana-account 3.2.0", - "solana-address-lookup-table-interface 3.0.0", + "solana-account", + "solana-address-lookup-table-interface", "solana-bucket-map", - "solana-clock 3.0.0", - "solana-epoch-schedule 3.0.0", - "solana-fee-calculator 3.0.0", + "solana-clock", + "solana-epoch-schedule", + "solana-fee-calculator", "solana-genesis-config", "solana-hash 3.1.0", "solana-lattice-hash", "solana-measure", - "solana-message 3.0.0", + "solana-message", "solana-metrics", "solana-nohash-hasher", "solana-pubkey 3.0.0", "solana-rayon-threadlimit", "solana-reward-info", - "solana-sha256-hasher 3.0.0", - "solana-slot-hashes 3.0.0", + "solana-sha256-hasher", + "solana-slot-hashes", "solana-svm-transaction", - "solana-system-interface 2.0.0", - "solana-sysvar 3.0.0", + "solana-system-interface", + "solana-sysvar", "solana-time-utils", "solana-transaction", "solana-transaction-context", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "spl-generic-token", "static_assertions", "tar", @@ -4558,43 +4583,35 @@ dependencies = [ [[package]] name = "solana-address" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a7a457086457ea9db9a5199d719dc8734dc2d0342fad0d8f77633c31eb62f19" +checksum = "a2ecac8e1b7f74c2baa9e774c42817e3e75b20787134b76cc4d45e8a604488f5" dependencies = [ - "borsh 1.5.7", + "solana-address 2.0.0", +] + +[[package]] +name = "solana-address" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e37320fd2945c5d654b2c6210624a52d66c3f1f73b653ed211ab91a703b35bdd" +dependencies = [ + "borsh", "bytemuck", "bytemuck_derive", "curve25519-dalek 4.1.3", - "five8 0.2.1", + "five8 1.0.0", "five8_const", "rand 0.8.5", "serde", "serde_derive", - "solana-atomic-u64 3.0.0", - "solana-define-syscall 3.0.0", + "solana-atomic-u64", + "solana-define-syscall 4.0.1", "solana-frozen-abi", "solana-frozen-abi-macro", - "solana-program-error 3.0.0", - "solana-sanitize 3.0.0", - "solana-sha256-hasher 3.0.0", -] - -[[package]] -name = "solana-address-lookup-table-interface" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1673f67efe870b64a65cb39e6194be5b26527691ce5922909939961a6e6b395" -dependencies = [ - "bincode", - "bytemuck", - "serde", - "serde_derive", - "solana-clock 2.2.2", - "solana-instruction 2.3.0", - "solana-pubkey 2.4.0", - "solana-sdk-ids 2.2.1", - "solana-slot-hashes 2.2.1", + "solana-program-error", + "solana-sanitize", + "solana-sha256-hasher", ] [[package]] @@ -4607,21 +4624,12 @@ dependencies = [ "bytemuck", "serde", "serde_derive", - "solana-clock 3.0.0", - "solana-instruction 3.0.0", + "solana-clock", + "solana-instruction", "solana-instruction-error", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-slot-hashes 3.0.0", -] - -[[package]] -name = "solana-atomic-u64" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52e52720efe60465b052b9e7445a01c17550666beec855cce66f44766697bc2" -dependencies = [ - "parking_lot", + "solana-sdk-ids", + "solana-slot-hashes", ] [[package]] @@ -4635,26 +4643,26 @@ dependencies = [ [[package]] name = "solana-banks-client" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac0c8780d1c4216925f72d28d809b172ab83466b687e8110154f39066e228c3d" +checksum = "0fc887eb35277bce8b8ba8f6ac020a5ab94cc9857920fd9f52a7041a235b476c" dependencies = [ - "borsh 1.5.7", + "borsh", "futures", - "solana-account 3.2.0", + "solana-account", "solana-banks-interface", - "solana-clock 3.0.0", + "solana-clock", "solana-commitment-config", "solana-hash 3.1.0", - "solana-message 3.0.0", - "solana-program-pack 3.0.0", + "solana-message", + "solana-program-pack", "solana-pubkey 3.0.0", - "solana-rent 3.0.0", + "solana-rent", "solana-signature", - "solana-sysvar 3.0.0", + "solana-sysvar", "solana-transaction", "solana-transaction-context", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "tarpc", "thiserror 2.0.17", "tokio", @@ -4663,42 +4671,42 @@ dependencies = [ [[package]] name = "solana-banks-interface" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0114282a0c18cdca6beae1d5cd9c92be7b8a2140aa92e3f0a2536f86303b05d8" +checksum = "73b0bb806697ca9f7e6c9082749a6b6f891d126f7c31d3d84a8264880afec16f" dependencies = [ "serde", "serde_derive", - "solana-account 3.2.0", - "solana-clock 3.0.0", + "solana-account", + "solana-clock", "solana-commitment-config", "solana-hash 3.1.0", - "solana-message 3.0.0", + "solana-message", "solana-pubkey 3.0.0", "solana-signature", "solana-transaction", "solana-transaction-context", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "tarpc", ] [[package]] name = "solana-banks-server" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aa01a4c68080b6e91a4d236300612631185a5e0f421caacdf2e53f1ba74fb2a" +checksum = "057ef1b15b16e022338fabd6bd61823eba0a34cf7b082730dfd5c3594f533bed" dependencies = [ "agave-feature-set", "bincode", "crossbeam-channel", "futures", - "solana-account 3.2.0", + "solana-account", "solana-banks-interface", "solana-client", - "solana-clock 3.0.0", + "solana-clock", "solana-commitment-config", "solana-hash 3.1.0", - "solana-message 3.0.0", + "solana-message", "solana-pubkey 3.0.0", "solana-runtime", "solana-runtime-transaction", @@ -4706,23 +4714,12 @@ dependencies = [ "solana-signature", "solana-svm", "solana-transaction", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "tarpc", "tokio", "tokio-serde", ] -[[package]] -name = "solana-big-mod-exp" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75db7f2bbac3e62cfd139065d15bcda9e2428883ba61fc8d27ccb251081e7567" -dependencies = [ - "num-bigint 0.4.6", - "num-traits", - "solana-define-syscall 2.3.0", -] - [[package]] name = "solana-big-mod-exp" version = "3.0.0" @@ -4736,54 +4733,31 @@ dependencies = [ [[package]] name = "solana-bincode" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19a3787b8cf9c9fe3dd360800e8b70982b9e5a8af9e11c354b6665dd4a003adc" -dependencies = [ - "bincode", - "serde", - "solana-instruction 2.3.0", -] - -[[package]] -name = "solana-bincode" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534a37aecd21986089224d0c01006a75b96ac6fb2f418c24edc15baf0d2a4c99" +checksum = "278a1a5bad62cd9da89ac8d4b7ec444e83caa8ae96aa656dfc27684b28d49a5d" dependencies = [ "bincode", - "serde", + "serde_core", "solana-instruction-error", ] [[package]] name = "solana-blake3-hasher" -version = "2.2.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a0801e25a1b31a14494fc80882a036be0ffd290efc4c2d640bfcca120a4672" +checksum = "7116e1d942a2432ca3f514625104757ab8a56233787e95144c93950029e31176" dependencies = [ "blake3", - "solana-define-syscall 2.3.0", - "solana-hash 2.3.0", - "solana-sanitize 2.2.1", -] - -[[package]] -name = "solana-blake3-hasher" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffa2e3bdac3339c6d0423275e45dafc5ac25f4d43bf344d026a3cc9a85e244a6" -dependencies = [ - "blake3", - "solana-define-syscall 3.0.0", - "solana-hash 3.1.0", + "solana-define-syscall 4.0.1", + "solana-hash 4.0.1", ] [[package]] name = "solana-bn254" -version = "3.0.0" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20a5f01e99addb316d95d4ed31aa6eacfda557fffc00ae316b919e8ba0fc5b91" +checksum = "8d08583be08d2d5f19aa21efbb6fbdb968ba7fd0de74562441437a7d776772bf" dependencies = [ "ark-bn254", "ark-ec", @@ -4794,68 +4768,58 @@ dependencies = [ "thiserror 2.0.17", ] -[[package]] -name = "solana-borsh" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718333bcd0a1a7aed6655aa66bef8d7fb047944922b2d3a18f49cbc13e73d004" -dependencies = [ - "borsh 0.10.4", - "borsh 1.5.7", -] - [[package]] name = "solana-borsh" version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc402b16657abbfa9991cd5cbfac5a11d809f7e7d28d3bb291baeb088b39060e" dependencies = [ - "borsh 1.5.7", + "borsh", ] [[package]] name = "solana-bpf-loader-program" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5a2b7914cebd827003d2a1c21cc48bcad2c1857a9ec34656a2caa578707f53a" +checksum = "6e450aab0c6ce825fbad7baf9e64c706d51def4842b7176fb172abfa1307939f" dependencies = [ "agave-syscalls", "bincode", "qualifier_attr", - "solana-account 3.2.0", - "solana-bincode 3.0.0", - "solana-clock 3.0.0", - "solana-instruction 3.0.0", - "solana-loader-v3-interface 6.1.0", - "solana-loader-v4-interface 3.1.0", + "solana-account", + "solana-bincode", + "solana-clock", + "solana-instruction", + "solana-loader-v3-interface", + "solana-loader-v4-interface", "solana-packet", - "solana-program-entrypoint 3.1.0", + "solana-program-entrypoint", "solana-program-runtime", "solana-pubkey 3.0.0", "solana-sbpf", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "solana-svm-feature-set", "solana-svm-log-collector", "solana-svm-measure", "solana-svm-type-overrides", - "solana-system-interface 2.0.0", + "solana-system-interface", "solana-transaction-context", ] [[package]] name = "solana-bucket-map" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96189a1964ca8a8eba213ad3f81a88012a95b5e237aa0a4620b10259371e48a6" +checksum = "286c8b3d6c7fa13adf2a94015aedba55349f4d762710527b2fb32c4cf4df1803" dependencies = [ "bv", "bytemuck", "bytemuck_derive", - "memmap2 0.9.7", + "memmap2 0.9.9", "modular-bitfield", "num_enum", "rand 0.8.5", - "solana-clock 3.0.0", + "solana-clock", "solana-measure", "solana-pubkey 3.0.0", "tempfile", @@ -4863,9 +4827,9 @@ dependencies = [ [[package]] name = "solana-builtins" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf88128e19b680ac1dee682e3271e39d7176db8e2345c3fd19799f4e58889155" +checksum = "c9759b566a98e17bb376f49d7b01d210b114fd6bff985c2e6c1704e83a36da20" dependencies = [ "agave-feature-set", "solana-bpf-loader-program", @@ -4874,8 +4838,8 @@ dependencies = [ "solana-loader-v4-program", "solana-program-runtime", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-stake-program 3.0.10", + "solana-sdk-ids", + "solana-stake-program 3.0.12", "solana-system-program", "solana-vote-program", "solana-zk-elgamal-proof-program", @@ -4884,49 +4848,49 @@ dependencies = [ [[package]] name = "solana-builtins-default-costs" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ac0ed2127d61fa4be2978cf692a04106b1e868d9f700d63a7e5934330b8e061" +checksum = "88b7f80ebad1d995d419719048be643cc4ff4c5699a72f218736917196f03a67" dependencies = [ "agave-feature-set", - "ahash 0.8.11", + "ahash 0.8.12", "log", "solana-bpf-loader-program", "solana-compute-budget-program", "solana-loader-v4-program", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-stake-program 3.0.10", + "solana-sdk-ids", + "solana-stake-program 3.0.12", "solana-system-program", "solana-vote-program", ] [[package]] name = "solana-client" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29482023b8e799e02b35bff330e1cbe963bd7e0cdd20eb1941bede9a66b944d" +checksum = "905b9527a1b11dc6c30c71366e66c493a9907f6cefcd3352bac031993b1bf512" dependencies = [ "async-trait", "bincode", "dashmap", "futures", "futures-util", - "indexmap 2.10.0", + "indexmap 2.12.1", "indicatif", "log", "quinn", "rayon", - "solana-account 3.2.0", + "solana-account", "solana-client-traits", "solana-commitment-config", "solana-connection-cache", "solana-epoch-info", "solana-hash 3.1.0", - "solana-instruction 3.0.0", + "solana-instruction", "solana-keypair", "solana-measure", - "solana-message 3.0.0", + "solana-message", "solana-pubkey 3.0.0", "solana-pubsub-client", "solana-quic-client", @@ -4940,7 +4904,7 @@ dependencies = [ "solana-time-utils", "solana-tpu-client", "solana-transaction", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "solana-transaction-status-client-types", "solana-udp-client", "thiserror 2.0.17", @@ -4953,32 +4917,19 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08618ed587e128105510c54ae3e456b9a06d674d8640db75afe66dad65cb4e02" dependencies = [ - "solana-account 3.2.0", + "solana-account", "solana-commitment-config", "solana-epoch-info", "solana-hash 3.1.0", - "solana-instruction 3.0.0", + "solana-instruction", "solana-keypair", - "solana-message 3.0.0", + "solana-message", "solana-pubkey 3.0.0", "solana-signature", "solana-signer", - "solana-system-interface 2.0.0", + "solana-system-interface", "solana-transaction", - "solana-transaction-error 3.0.0", -] - -[[package]] -name = "solana-clock" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb482ab70fced82ad3d7d3d87be33d466a3498eb8aa856434ff3c0dfc2e2e31" -dependencies = [ - "serde", - "serde_derive", - "solana-sdk-ids 2.2.1", - "solana-sdk-macro 2.2.1", - "solana-sysvar-id 2.2.1", + "solana-transaction-error", ] [[package]] @@ -4989,9 +4940,9 @@ checksum = "fb62e9381182459a4520b5fe7fb22d423cae736239a6427fc398a88743d0ed59" dependencies = [ "serde", "serde_derive", - "solana-sdk-ids 3.0.0", - "solana-sdk-macro 3.0.0", - "solana-sysvar-id 3.0.0", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-sysvar-id", ] [[package]] @@ -5007,9 +4958,9 @@ dependencies = [ [[package]] name = "solana-commitment-config" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fa5933a62dadb7d3ed35e6329de5cebb0678acc8f9cfdf413269084eeccc63f" +checksum = "2e41a3917076a8b5375809078ae3a6fb76a53e364b596ef8c4265e7f410876f3" dependencies = [ "serde", "serde_derive", @@ -5017,9 +4968,9 @@ dependencies = [ [[package]] name = "solana-compute-budget" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b2d4cca7050320d13653ab369e21a0573b4a4f5dd82c509b0640e87f34d84" +checksum = "0949c3244fdbd06f958fdcc9a83ec5778da418fb030a96621aa3cf0597f7acf6" dependencies = [ "solana-fee-structure", "solana-program-runtime", @@ -5027,22 +4978,22 @@ dependencies = [ [[package]] name = "solana-compute-budget-instruction" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ac29452169f23259fa6c60ff4be6dd389d45458256a1d74efa62e22cc169f05" +checksum = "110a37e3926f56252d5fc79be0d5b2c286aec0c11200c31f817796359e34359b" dependencies = [ "agave-feature-set", "log", - "solana-borsh 3.0.0", + "solana-borsh", "solana-builtins-default-costs", "solana-compute-budget", "solana-compute-budget-interface", - "solana-instruction 3.0.0", + "solana-instruction", "solana-packet", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "solana-svm-transaction", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "thiserror 2.0.17", ] @@ -5052,16 +5003,16 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8292c436b269ad23cecc8b24f7da3ab07ca111661e25e00ce0e1d22771951ab9" dependencies = [ - "borsh 1.5.7", - "solana-instruction 3.0.0", - "solana-sdk-ids 3.0.0", + "borsh", + "solana-instruction", + "solana-sdk-ids", ] [[package]] name = "solana-compute-budget-program" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c1993650e417ef1ee1fc9e81ef5d7704cee080a5cff0de429c2ce187b5a505" +checksum = "dcabf05e88736a8596072967e192da1883ca9ad1515e198068c13c9233ca7ba6" dependencies = [ "solana-program-runtime", ] @@ -5075,25 +5026,25 @@ dependencies = [ "bincode", "serde", "serde_derive", - "solana-account 3.2.0", - "solana-instruction 3.0.0", + "solana-account", + "solana-instruction", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-short-vec 3.0.0", - "solana-system-interface 2.0.0", + "solana-sdk-ids", + "solana-short-vec", + "solana-system-interface", ] [[package]] name = "solana-connection-cache" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0432922673ca595f778e1895497020291fdb59aa9098b5a93b99f132d439299f" +checksum = "a3ec1735aac392497e3e2d9ef127cf55070086b6969f02c210162427fffefa39" dependencies = [ "async-trait", "bincode", "crossbeam-channel", "futures-util", - "indexmap 2.10.0", + "indexmap 2.12.1", "log", "rand 0.8.5", "rayon", @@ -5101,24 +5052,24 @@ dependencies = [ "solana-measure", "solana-metrics", "solana-time-utils", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "thiserror 2.0.17", "tokio", ] [[package]] name = "solana-cost-model" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "377e2608100cf9d7ec21db895f67b9f0822471848a76374fe84065b9ece7f93c" +checksum = "0feb7f49393e353a84da75fdbe437e6fadf1b217ae2524278f1f64034ce7ed4a" dependencies = [ "agave-feature-set", - "ahash 0.8.11", + "ahash 0.8.12", "log", - "solana-bincode 3.0.0", - "solana-borsh 3.0.0", + "solana-bincode", + "solana-borsh", "solana-builtins-default-costs", - "solana-clock 3.0.0", + "solana-clock", "solana-compute-budget", "solana-compute-budget-instruction", "solana-compute-budget-interface", @@ -5127,46 +5078,32 @@ dependencies = [ "solana-packet", "solana-pubkey 3.0.0", "solana-runtime-transaction", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "solana-svm-transaction", - "solana-system-interface 2.0.0", - "solana-transaction-error 3.0.0", + "solana-system-interface", + "solana-transaction-error", "solana-vote-program", ] [[package]] name = "solana-cpi" -version = "2.2.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dc71126edddc2ba014622fc32d0f5e2e78ec6c5a1e0eb511b85618c09e9ea11" +checksum = "4dea26709d867aada85d0d3617db0944215c8bb28d3745b912de7db13a23280c" dependencies = [ - "solana-account-info 2.2.1", - "solana-define-syscall 2.3.0", - "solana-instruction 2.3.0", - "solana-program-error 2.2.1", - "solana-pubkey 2.4.0", - "solana-stable-layout 2.2.1", -] - -[[package]] -name = "solana-cpi" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16238feb63d1cbdf915fb287f29ef7a7ebf81469bd6214f8b72a53866b593f8f" -dependencies = [ - "solana-account-info 3.0.0", - "solana-define-syscall 3.0.0", - "solana-instruction 3.0.0", - "solana-program-error 3.0.0", - "solana-pubkey 3.0.0", - "solana-stable-layout 3.0.0", + "solana-account-info", + "solana-define-syscall 4.0.1", + "solana-instruction", + "solana-program-error", + "solana-pubkey 4.0.0", + "solana-stable-layout", ] [[package]] name = "solana-curve25519" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2ca224d51d8a1cc20f221706968d8f851586e6b05937cb518bedc156596dee" +checksum = "d7e0f6e024ec8f1b141b1fb6388813277bcfaef640e717ebefca26225f687643" dependencies = [ "bytemuck", "bytemuck_derive", @@ -5176,26 +5113,17 @@ dependencies = [ "thiserror 2.0.17", ] -[[package]] -name = "solana-decode-error" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a6a6383af236708048f8bd8d03db8ca4ff7baf4a48e5d580f4cce545925470" -dependencies = [ - "num-traits", -] - [[package]] name = "solana-define-syscall" -version = "2.3.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ae3e2abcf541c8122eafe9a625d4d194b4023c20adde1e251f94e056bb1aee2" +checksum = "f9697086a4e102d28a156b8d6b521730335d6951bd39a5e766512bbe09007cee" [[package]] name = "solana-define-syscall" -version = "3.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9697086a4e102d28a156b8d6b521730335d6951bd39a5e766512bbe09007cee" +checksum = "57e5b1c0bc1d4a4d10c88a4100499d954c09d3fecfae4912c1a074dff68b1738" [[package]] name = "solana-derivation-path" @@ -5216,32 +5144,18 @@ checksum = "e1419197f1c06abf760043f6d64ba9d79a03ad5a43f18c7586471937122094da" dependencies = [ "bytemuck", "bytemuck_derive", - "solana-instruction 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-instruction", + "solana-sdk-ids", ] [[package]] name = "solana-epoch-info" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8a6b69bd71386f61344f2bcf0f527f5fd6dd3b22add5880e2e1bf1dd1fa8059" -dependencies = [ - "serde", - "serde_derive", -] - -[[package]] -name = "solana-epoch-rewards" -version = "2.2.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b575d3dd323b9ea10bb6fe89bf6bf93e249b215ba8ed7f68f1a3633f384db7" +checksum = "e093c84f6ece620a6b10cd036574b0cd51944231ab32d81f80f76d54aba833e6" dependencies = [ "serde", "serde_derive", - "solana-hash 2.3.0", - "solana-sdk-ids 2.2.1", - "solana-sdk-macro 2.2.1", - "solana-sysvar-id 2.2.1", ] [[package]] @@ -5253,33 +5167,20 @@ dependencies = [ "serde", "serde_derive", "solana-hash 3.1.0", - "solana-sdk-ids 3.0.0", - "solana-sdk-macro 3.0.0", - "solana-sysvar-id 3.0.0", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-sysvar-id", ] [[package]] name = "solana-epoch-rewards-hasher" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e507099d0c2c5d7870c9b1848281ea67bbeee80d171ca85003ee5767994c9c38" +checksum = "1ee8beac9bff4db9225e57d532d169b0be5e447f1e6601a2f50f27a01bf5518f" dependencies = [ "siphasher 0.3.11", - "solana-hash 3.1.0", - "solana-pubkey 3.0.0", -] - -[[package]] -name = "solana-epoch-schedule" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fce071fbddecc55d727b1d7ed16a629afe4f6e4c217bc8d00af3b785f6f67ed" -dependencies = [ - "serde", - "serde_derive", - "solana-sdk-ids 2.2.1", - "solana-sdk-macro 2.2.1", - "solana-sysvar-id 2.2.1", + "solana-address 2.0.0", + "solana-hash 4.0.1", ] [[package]] @@ -5290,30 +5191,9 @@ checksum = "6e5481e72cc4d52c169db73e4c0cd16de8bc943078aac587ec4817a75cc6388f" dependencies = [ "serde", "serde_derive", - "solana-sdk-ids 3.0.0", - "solana-sdk-macro 3.0.0", - "solana-sysvar-id 3.0.0", -] - -[[package]] -name = "solana-example-mocks" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84461d56cbb8bb8d539347151e0525b53910102e4bced875d49d5139708e39d3" -dependencies = [ - "serde", - "serde_derive", - "solana-address-lookup-table-interface 2.2.2", - "solana-clock 2.2.2", - "solana-hash 2.3.0", - "solana-instruction 2.3.0", - "solana-keccak-hasher 2.2.1", - "solana-message 2.4.0", - "solana-nonce 2.2.1", - "solana-pubkey 2.4.0", - "solana-sdk-ids 2.2.1", - "solana-system-interface 1.0.0", - "thiserror 2.0.17", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-sysvar-id", ] [[package]] @@ -5324,38 +5204,19 @@ checksum = "978855d164845c1b0235d4b4d101cadc55373fffaf0b5b6cfa2194d25b2ed658" dependencies = [ "serde", "serde_derive", - "solana-address-lookup-table-interface 3.0.0", - "solana-clock 3.0.0", + "solana-address-lookup-table-interface", + "solana-clock", "solana-hash 3.1.0", - "solana-instruction 3.0.0", - "solana-keccak-hasher 3.0.0", - "solana-message 3.0.0", - "solana-nonce 3.0.0", + "solana-instruction", + "solana-keccak-hasher", + "solana-message", + "solana-nonce", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-system-interface 2.0.0", + "solana-sdk-ids", + "solana-system-interface", "thiserror 2.0.17", ] -[[package]] -name = "solana-feature-gate-interface" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f5c5382b449e8e4e3016fb05e418c53d57782d8b5c30aa372fc265654b956d" -dependencies = [ - "bincode", - "serde", - "serde_derive", - "solana-account 2.2.1", - "solana-account-info 2.2.1", - "solana-instruction 2.3.0", - "solana-program-error 2.2.1", - "solana-pubkey 2.4.0", - "solana-rent 2.2.1", - "solana-sdk-ids 2.2.1", - "solana-system-interface 1.0.0", -] - [[package]] name = "solana-feature-gate-interface" version = "3.0.0" @@ -5365,38 +5226,27 @@ dependencies = [ "bincode", "serde", "serde_derive", - "solana-account 3.2.0", - "solana-account-info 3.0.0", - "solana-instruction 3.0.0", - "solana-program-error 3.0.0", + "solana-account", + "solana-account-info", + "solana-instruction", + "solana-program-error", "solana-pubkey 3.0.0", - "solana-rent 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-system-interface 2.0.0", + "solana-rent", + "solana-sdk-ids", + "solana-system-interface", ] [[package]] name = "solana-fee" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b438bf9ad402491785a4195bc1bc26ca6c01903ef19e94e6c12a8ac29f0267e8" +checksum = "18995640d5ea221f7f053c3e66f03386567984f867b12c4aa4a6a119bbae4b31" dependencies = [ "agave-feature-set", "solana-fee-structure", "solana-svm-transaction", ] -[[package]] -name = "solana-fee-calculator" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89bc408da0fb3812bc3008189d148b4d3e08252c79ad810b245482a3f70cd8d" -dependencies = [ - "log", - "serde", - "serde_derive", -] - [[package]] name = "solana-fee-calculator" version = "3.0.0" @@ -5420,9 +5270,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "3.0.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497caf6b5b0ad5fbf3879d4417cd520e11f19c34f183d052e42370d9a585c79a" +checksum = "498e7ac4f4a5d8d9841dbb548bba0fd07e3c0d551cd93bb62784993970ff79f3" dependencies = [ "boxcar", "bs58", @@ -5432,23 +5282,24 @@ dependencies = [ "im", "log", "memmap2 0.5.10", + "rand 0.8.5", "serde", "serde_derive", "serde_with", - "sha2 0.10.8", + "sha2 0.10.9", "solana-frozen-abi-macro", "thiserror 2.0.17", ] [[package]] name = "solana-frozen-abi-macro" -version = "3.0.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e4bb0f5232668866a7f6f5cbc3222bbd9eebbff6afe392e3394498e8c9b1fa" +checksum = "b8bfd7ae6f7e6e4d9a5ce0441111de9ca5bb30f2af144551696c638769b27023" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -5462,19 +5313,19 @@ dependencies = [ "memmap2 0.5.10", "serde", "serde_derive", - "solana-account 3.2.0", - "solana-clock 3.0.0", + "solana-account", + "solana-clock", "solana-cluster-type", - "solana-epoch-schedule 3.0.0", - "solana-fee-calculator 3.0.0", + "solana-epoch-schedule", + "solana-fee-calculator", "solana-hash 3.1.0", "solana-inflation", "solana-keypair", "solana-poh-config", "solana-pubkey 3.0.0", - "solana-rent 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-sha256-hasher 3.0.0", + "solana-rent", + "solana-sdk-ids", + "solana-sha256-hasher", "solana-shred-version", "solana-signer", "solana-time-utils", @@ -5490,24 +5341,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "solana-hash" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b96e9f0300fa287b545613f007dfe20043d7812bee255f418c1eb649c93b63" -dependencies = [ - "borsh 1.5.7", - "bytemuck", - "bytemuck_derive", - "five8 0.2.1", - "js-sys", - "serde", - "serde_derive", - "solana-atomic-u64 2.2.1", - "solana-sanitize 2.2.1", - "wasm-bindgen", -] - [[package]] name = "solana-hash" version = "3.1.0" @@ -5523,14 +5356,14 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a5d48a6ee7b91fc7b998944ab026ed7b3e2fc8ee3bc58452644a86c2648152f" dependencies = [ - "borsh 1.5.7", + "borsh", "bytemuck", "bytemuck_derive", "five8 1.0.0", "serde", "serde_derive", - "solana-atomic-u64 3.0.0", - "solana-sanitize 3.0.0", + "solana-atomic-u64", + "solana-sanitize", ] [[package]] @@ -5545,66 +5378,31 @@ dependencies = [ [[package]] name = "solana-instruction" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47298e2ce82876b64f71e9d13a46bc4b9056194e7f9937ad3084385befa50885" -dependencies = [ - "bincode", - "borsh 1.5.7", - "getrandom 0.2.15", - "js-sys", - "num-traits", - "serde", - "serde_derive", - "solana-define-syscall 2.3.0", - "solana-pubkey 2.4.0", - "wasm-bindgen", -] - -[[package]] -name = "solana-instruction" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df4e8fcba01d7efa647ed20a081c234475df5e11a93acb4393cc2c9a7b99bab" +checksum = "ee1b699a2c1518028a9982e255e0eca10c44d90006542d9d7f9f40dbce3f7c78" dependencies = [ "bincode", - "borsh 1.5.7", + "borsh", "serde", "serde_derive", - "solana-define-syscall 3.0.0", + "solana-define-syscall 4.0.1", "solana-frozen-abi", "solana-frozen-abi-macro", "solana-instruction-error", - "solana-pubkey 3.0.0", + "solana-pubkey 4.0.0", ] [[package]] name = "solana-instruction-error" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f0d483b8ae387178d9210e0575b666b05cdd4bd0f2f188128249f6e454d39d" +checksum = "b04259e03c05faf38a8c24217b5cfe4c90572ae6184ab49cddb1584fdd756d3f" dependencies = [ "num-traits", "serde", "serde_derive", - "solana-program-error 3.0.0", -] - -[[package]] -name = "solana-instructions-sysvar" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0e85a6fad5c2d0c4f5b91d34b8ca47118fc593af706e523cdbedf846a954f57" -dependencies = [ - "bitflags", - "solana-account-info 2.2.1", - "solana-instruction 2.3.0", - "solana-program-error 2.2.1", - "solana-pubkey 2.4.0", - "solana-sanitize 2.2.1", - "solana-sdk-ids 2.2.1", - "solana-serialize-utils 2.2.1", - "solana-sysvar-id 2.2.1", + "solana-program-error", ] [[package]] @@ -5614,71 +5412,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ddf67876c541aa1e21ee1acae35c95c6fbc61119814bfef70579317a5e26955" dependencies = [ "bitflags", - "solana-account-info 3.0.0", - "solana-instruction 3.0.0", + "solana-account-info", + "solana-instruction", "solana-instruction-error", - "solana-program-error 3.0.0", + "solana-program-error", "solana-pubkey 3.0.0", - "solana-sanitize 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-serialize-utils 3.1.0", - "solana-sysvar-id 3.0.0", -] - -[[package]] -name = "solana-keccak-hasher" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7aeb957fbd42a451b99235df4942d96db7ef678e8d5061ef34c9b34cae12f79" -dependencies = [ - "sha3", - "solana-define-syscall 2.3.0", - "solana-hash 2.3.0", - "solana-sanitize 2.2.1", + "solana-sanitize", + "solana-sdk-ids", + "solana-serialize-utils", + "solana-sysvar-id", ] [[package]] name = "solana-keccak-hasher" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57eebd3012946913c8c1b8b43cdf8a6249edb09c0b6be3604ae910332a3acd97" +checksum = "ed1c0d16d6fdeba12291a1f068cdf0d479d9bff1141bf44afd7aa9d485f65ef8" dependencies = [ "sha3", - "solana-define-syscall 3.0.0", - "solana-hash 3.1.0", + "solana-define-syscall 4.0.1", + "solana-hash 4.0.1", ] [[package]] name = "solana-keypair" -version = "3.0.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "952ed9074c12edd2060cb09c2a8c664303f4ab7f7056a407ac37dd1da7bdaa3e" +checksum = "5ac8be597c9e231b0cab2928ce3bc3e4ee77d9c0ad92977b9d901f3879f25a7a" dependencies = [ "ed25519-dalek 2.2.0", "ed25519-dalek-bip32", - "five8 0.2.1", + "five8 1.0.0", "rand 0.8.5", + "solana-address 2.0.0", "solana-derivation-path", - "solana-pubkey 3.0.0", "solana-seed-derivable", "solana-seed-phrase", "solana-signature", "solana-signer", ] -[[package]] -name = "solana-last-restart-slot" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a6360ac2fdc72e7463565cd256eedcf10d7ef0c28a1249d261ec168c1b55cdd" -dependencies = [ - "serde", - "serde_derive", - "solana-sdk-ids 2.2.1", - "solana-sdk-macro 2.2.1", - "solana-sysvar-id 2.2.1", -] - [[package]] name = "solana-last-restart-slot" version = "3.0.0" @@ -5687,16 +5460,16 @@ checksum = "dcda154ec827f5fc1e4da0af3417951b7e9b8157540f81f936c4a8b1156134d0" dependencies = [ "serde", "serde_derive", - "solana-sdk-ids 3.0.0", - "solana-sdk-macro 3.0.0", - "solana-sysvar-id 3.0.0", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-sysvar-id", ] [[package]] name = "solana-lattice-hash" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30443bf8af65ad7ec2a7493d14e70b2d26b925fd0750fa9048a44a441b0a23bf" +checksum = "17e27cbdda66b2379f5122ecfd78695c5815e8109c0f7339d3cf7340ed4d6d64" dependencies = [ "base64 0.22.1", "blake3", @@ -5704,35 +5477,6 @@ dependencies = [ "bytemuck", ] -[[package]] -name = "solana-loader-v2-interface" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8ab08006dad78ae7cd30df8eea0539e207d08d91eaefb3e1d49a446e1c49654" -dependencies = [ - "serde", - "serde_bytes", - "serde_derive", - "solana-instruction 2.3.0", - "solana-pubkey 2.4.0", - "solana-sdk-ids 2.2.1", -] - -[[package]] -name = "solana-loader-v3-interface" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4be76cfa9afd84ca2f35ebc09f0da0f0092935ccdac0595d98447f259538c2" -dependencies = [ - "serde", - "serde_bytes", - "serde_derive", - "solana-instruction 2.3.0", - "solana-pubkey 2.4.0", - "solana-sdk-ids 2.2.1", - "solana-system-interface 1.0.0", -] - [[package]] name = "solana-loader-v3-interface" version = "6.1.0" @@ -5742,25 +5486,10 @@ dependencies = [ "serde", "serde_bytes", "serde_derive", - "solana-instruction 3.0.0", + "solana-instruction", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-system-interface 2.0.0", -] - -[[package]] -name = "solana-loader-v4-interface" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "706a777242f1f39a83e2a96a2a6cb034cb41169c6ecbee2cf09cb873d9659e7e" -dependencies = [ - "serde", - "serde_bytes", - "serde_derive", - "solana-instruction 2.3.0", - "solana-pubkey 2.4.0", - "solana-sdk-ids 2.2.1", - "solana-system-interface 1.0.0", + "solana-sdk-ids", + "solana-system-interface", ] [[package]] @@ -5772,31 +5501,31 @@ dependencies = [ "serde", "serde_bytes", "serde_derive", - "solana-instruction 3.0.0", + "solana-instruction", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-system-interface 2.0.0", + "solana-sdk-ids", + "solana-system-interface", ] [[package]] name = "solana-loader-v4-program" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b4ce5ca27d4b16be527583738bac230fa0e62867e6c8b4bd6345cf09a3c941c" +checksum = "0ddacd3cff6428639606bf5f4b1d3bf7d9eadd5eedcc22947ba79e3fa48fbe44" dependencies = [ "log", "qualifier_attr", - "solana-account 3.2.0", - "solana-bincode 3.0.0", + "solana-account", + "solana-bincode", "solana-bpf-loader-program", - "solana-instruction 3.0.0", - "solana-loader-v3-interface 6.1.0", - "solana-loader-v4-interface 3.1.0", + "solana-instruction", + "solana-loader-v3-interface", + "solana-loader-v4-interface", "solana-packet", "solana-program-runtime", "solana-pubkey 3.0.0", "solana-sbpf", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "solana-svm-log-collector", "solana-svm-measure", "solana-svm-type-overrides", @@ -5818,78 +5547,46 @@ dependencies = [ [[package]] name = "solana-measure" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec1c31d6a2213afe934a46f61a2f7512d32dab05247efca046d0713fdc0c8a9e" - -[[package]] -name = "solana-message" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1796aabce376ff74bf89b78d268fa5e683d7d7a96a0a4e4813ec34de49d5314b" -dependencies = [ - "bincode", - "blake3", - "lazy_static", - "serde", - "serde_derive", - "solana-bincode 2.2.1", - "solana-hash 2.3.0", - "solana-instruction 2.3.0", - "solana-pubkey 2.4.0", - "solana-sanitize 2.2.1", - "solana-sdk-ids 2.2.1", - "solana-short-vec 2.2.1", - "solana-system-interface 1.0.0", - "solana-transaction-error 2.2.1", - "wasm-bindgen", -] +checksum = "d54d09ba4775513d877ff3dc22807ace9eee71b5eea78405f073b61e40c34e56" [[package]] name = "solana-message" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c33e9fa7871147ac3235a7320386afa2dc64bbb21ca3cf9d79a6f6827313176" +checksum = "85666605c9fd727f865ed381665db0a8fc29f984a030ecc1e40f43bfb2541623" dependencies = [ "bincode", "blake3", "lazy_static", "serde", "serde_derive", + "solana-address 1.1.0", "solana-hash 3.1.0", - "solana-instruction 3.0.0", - "solana-pubkey 3.0.0", - "solana-sanitize 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-short-vec 3.0.0", - "solana-transaction-error 3.0.0", + "solana-instruction", + "solana-sanitize", + "solana-sdk-ids", + "solana-short-vec", + "solana-transaction-error", ] [[package]] name = "solana-metrics" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb5c1cc9f378f38108827a50d7e7c988915c855378c99443728e852b5d3e5ee9" +checksum = "bca6ac7323395b9363be946e308ab8c85769ff501b641f123b64709ca07cc7c3" dependencies = [ "crossbeam-channel", "gethostname", "log", "reqwest", "solana-cluster-type", - "solana-sha256-hasher 3.0.0", + "solana-sha256-hasher", "solana-time-utils", "thiserror 2.0.17", ] -[[package]] -name = "solana-msg" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36a1a14399afaabc2781a1db09cb14ee4cc4ee5c7a5a3cfcc601811379a8092" -dependencies = [ - "solana-define-syscall 2.3.0", -] - [[package]] name = "solana-msg" version = "3.0.0" @@ -5899,12 +5596,6 @@ dependencies = [ "solana-define-syscall 3.0.0", ] -[[package]] -name = "solana-native-token" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61515b880c36974053dd499c0510066783f0cc6ac17def0c7ef2a244874cf4a9" - [[package]] name = "solana-native-token" version = "3.0.0" @@ -5913,9 +5604,9 @@ checksum = "ae8dd4c280dca9d046139eb5b7a5ac9ad10403fbd64964c7d7571214950d758f" [[package]] name = "solana-net-utils" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccd09673923a9766a43d540eb10ed62e598582039178a71ec4ba9a7be237c83" +checksum = "c07a6059b386b7a880be65c263115deec3d578edb38510eb83866f1f59972b27" dependencies = [ "anyhow", "bincode", @@ -5926,7 +5617,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_derive", - "socket2 0.6.0", + "socket2", "solana-serde", "tokio", "url", @@ -5938,20 +5629,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b8a731ed60e89177c8a7ab05fe0f1511cedd3e70e773f288f9de33a9cfdc21e" -[[package]] -name = "solana-nonce" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703e22eb185537e06204a5bd9d509b948f0066f2d1d814a6f475dafb3ddf1325" -dependencies = [ - "serde", - "serde_derive", - "solana-fee-calculator 2.2.1", - "solana-hash 2.3.0", - "solana-pubkey 2.4.0", - "solana-sha256-hasher 2.2.1", -] - [[package]] name = "solana-nonce" version = "3.0.0" @@ -5960,10 +5637,10 @@ checksum = "abbdc6c8caf1c08db9f36a50967539d0f72b9f1d4aea04fec5430f532e5afadc" dependencies = [ "serde", "serde_derive", - "solana-fee-calculator 3.0.0", + "solana-fee-calculator", "solana-hash 3.1.0", "solana-pubkey 3.0.0", - "solana-sha256-hasher 3.0.0", + "solana-sha256-hasher", ] [[package]] @@ -5972,10 +5649,10 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "805fd25b29e5a1a0e6c3dd6320c9da80f275fbe4ff6e392617c303a2085c435e" dependencies = [ - "solana-account 3.2.0", + "solana-account", "solana-hash 3.1.0", - "solana-nonce 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-nonce", + "solana-sdk-ids", ] [[package]] @@ -5994,11 +5671,11 @@ dependencies = [ [[package]] name = "solana-perf" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acd85605438c9eaae275815ae34c56e4dc2c1e35a4156d4fd66873a1045c382e" +checksum = "5c1e71dfb4fa49492f1e94b0526d52f51c41eb01d4bb46097b0c0949ac5210dc" dependencies = [ - "ahash 0.8.11", + "ahash 0.8.12", "bincode", "bv", "bytes", @@ -6013,13 +5690,13 @@ dependencies = [ "rayon", "serde", "solana-hash 3.1.0", - "solana-message 3.0.0", + "solana-message", "solana-metrics", "solana-packet", "solana-pubkey 3.0.0", "solana-rayon-threadlimit", - "solana-sdk-ids 3.0.0", - "solana-short-vec 3.0.0", + "solana-sdk-ids", + "solana-short-vec", "solana-signature", "solana-time-utils", ] @@ -6036,9 +5713,9 @@ dependencies = [ [[package]] name = "solana-poseidon" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794ff76c70d6f4c5d9c86c626069225c0066043405c0c9d6b96f00c8525dade5" +checksum = "71f0626f8c9f3237ba8bbfc90761fa28ce8979b8ea3e08b5019bb495a70f0c7a" dependencies = [ "ark-bn254", "light-poseidon", @@ -6055,125 +5732,16 @@ dependencies = [ "num-traits", ] -[[package]] -name = "solana-program" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "586469467e93ceb79048f8d8e3a619bf61d05396ee7de95cb40280301a589d05" -dependencies = [ - "bincode", - "blake3", - "borsh 0.10.4", - "borsh 1.5.7", - "bs58", - "bytemuck", - "console_error_panic_hook", - "console_log", - "getrandom 0.2.15", - "lazy_static", - "log", - "memoffset", - "num-bigint 0.4.6", - "num-derive", - "num-traits", - "rand 0.8.5", - "serde", - "serde_bytes", - "serde_derive", - "solana-account-info 2.2.1", - "solana-address-lookup-table-interface 2.2.2", - "solana-atomic-u64 2.2.1", - "solana-big-mod-exp 2.2.1", - "solana-bincode 2.2.1", - "solana-blake3-hasher 2.2.1", - "solana-borsh 2.2.1", - "solana-clock 2.2.2", - "solana-cpi 2.2.1", - "solana-decode-error", - "solana-define-syscall 2.3.0", - "solana-epoch-rewards 2.2.1", - "solana-epoch-schedule 2.2.1", - "solana-example-mocks 2.2.1", - "solana-feature-gate-interface 2.2.2", - "solana-fee-calculator 2.2.1", - "solana-hash 2.3.0", - "solana-instruction 2.3.0", - "solana-instructions-sysvar 2.2.2", - "solana-keccak-hasher 2.2.1", - "solana-last-restart-slot 2.2.1", - "solana-loader-v2-interface", - "solana-loader-v3-interface 3.0.0", - "solana-loader-v4-interface 2.2.1", - "solana-message 2.4.0", - "solana-msg 2.2.1", - "solana-native-token 2.3.0", - "solana-nonce 2.2.1", - "solana-program-entrypoint 2.2.1", - "solana-program-error 2.2.1", - "solana-program-memory 2.2.1", - "solana-program-option", - "solana-program-pack 2.2.1", - "solana-pubkey 2.4.0", - "solana-rent 2.2.1", - "solana-sanitize 2.2.1", - "solana-sdk-ids 2.2.1", - "solana-sdk-macro 2.2.1", - "solana-secp256k1-recover 2.2.1", - "solana-serde-varint 2.2.2", - "solana-serialize-utils 2.2.1", - "solana-sha256-hasher 2.2.1", - "solana-short-vec 2.2.1", - "solana-slot-hashes 2.2.1", - "solana-slot-history 2.2.1", - "solana-stable-layout 2.2.1", - "solana-stake-interface 1.2.1", - "solana-system-interface 1.0.0", - "solana-sysvar 2.2.2", - "solana-sysvar-id 2.2.1", - "solana-vote-interface 2.2.6", - "thiserror 2.0.17", - "wasm-bindgen", -] - [[package]] name = "solana-program-entrypoint" -version = "2.2.1" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473ffe73c68d93e9f2aa726ad2985fe52760052709aaab188100a42c618060ec" +checksum = "84c9b0a1ff494e05f503a08b3d51150b73aa639544631e510279d6375f290997" dependencies = [ - "solana-account-info 2.2.1", - "solana-msg 2.2.1", - "solana-program-error 2.2.1", - "solana-pubkey 2.4.0", -] - -[[package]] -name = "solana-program-entrypoint" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6557cf5b5e91745d1667447438a1baa7823c6086e4ece67f8e6ebfa7a8f72660" -dependencies = [ - "solana-account-info 3.0.0", - "solana-define-syscall 3.0.0", - "solana-msg 3.0.0", - "solana-program-error 3.0.0", - "solana-pubkey 3.0.0", -] - -[[package]] -name = "solana-program-error" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8ae2c1a8d0d4ae865882d5770a7ebca92bab9c685e43f0461682c6c05a35bfa" -dependencies = [ - "borsh 1.5.7", - "num-traits", - "serde", - "serde_derive", - "solana-decode-error", - "solana-instruction 2.3.0", - "solana-msg 2.2.1", - "solana-pubkey 2.4.0", + "solana-account-info", + "solana-define-syscall 4.0.1", + "solana-program-error", + "solana-pubkey 4.0.0", ] [[package]] @@ -6182,41 +5750,16 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1af32c995a7b692a915bb7414d5f8e838450cf7c70414e763d8abcae7b51f28" dependencies = [ - "borsh 1.5.7", + "borsh", ] [[package]] name = "solana-program-memory" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b0268f6c89825fb634a34bd0c3b8fdaeaecfc3728be1d622a8ee6dd577b60d4" -dependencies = [ - "num-traits", - "solana-define-syscall 2.3.0", -] - -[[package]] -name = "solana-program-memory" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10e5660c60749c7bfb30b447542529758e4dbcecd31b1e8af1fdc92e2bdde90a" -dependencies = [ - "solana-define-syscall 3.0.0", -] - -[[package]] -name = "solana-program-option" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc677a2e9bc616eda6dbdab834d463372b92848b2bfe4a1ed4e4b4adba3397d0" - -[[package]] -name = "solana-program-pack" -version = "2.2.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "319f0ef15e6e12dc37c597faccb7d62525a509fec5f6975ecb9419efddeb277b" +checksum = "4068648649653c2c50546e9a7fb761791b5ab0cda054c771bb5808d3a4b9eb52" dependencies = [ - "solana-program-error 2.2.1", + "solana-define-syscall 4.0.1", ] [[package]] @@ -6225,14 +5768,14 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c169359de21f6034a63ebf96d6b380980307df17a8d371344ff04a883ec4e9d0" dependencies = [ - "solana-program-error 3.0.0", + "solana-program-error", ] [[package]] name = "solana-program-runtime" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d6ec3fec9e5f8c01aa76e0d63911af6acb4ee840b6f7ec5ddee284552c0de60" +checksum = "1b6ad17b62e8c0c4d1129a4f0355e459d722f66d05fa5686aa5c799f1e561cc2" dependencies = [ "base64 0.22.1", "bincode", @@ -6241,21 +5784,21 @@ dependencies = [ "percentage", "rand 0.8.5", "serde", - "solana-account 3.2.0", - "solana-clock 3.0.0", - "solana-epoch-rewards 3.0.0", - "solana-epoch-schedule 3.0.0", + "solana-account", + "solana-clock", + "solana-epoch-rewards", + "solana-epoch-schedule", "solana-fee-structure", "solana-hash 3.1.0", - "solana-instruction 3.0.0", - "solana-last-restart-slot 3.0.0", - "solana-program-entrypoint 3.1.0", + "solana-instruction", + "solana-last-restart-slot", + "solana-program-entrypoint", "solana-pubkey 3.0.0", - "solana-rent 3.0.0", + "solana-rent", "solana-sbpf", - "solana-sdk-ids 3.0.0", - "solana-slot-hashes 3.0.0", - "solana-stake-interface 2.0.1", + "solana-sdk-ids", + "solana-slot-hashes", + "solana-stake-interface 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "solana-svm-callback", "solana-svm-feature-set", "solana-svm-log-collector", @@ -6263,17 +5806,17 @@ dependencies = [ "solana-svm-timings", "solana-svm-transaction", "solana-svm-type-overrides", - "solana-system-interface 2.0.0", - "solana-sysvar 3.0.0", - "solana-sysvar-id 3.0.0", + "solana-system-interface", + "solana-sysvar", + "solana-sysvar-id", "solana-transaction-context", ] [[package]] name = "solana-program-test" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d828f0e8ff75dd2b745206ee4b965613a6f0caf7f502fc70d7c3e627abde46ff" +checksum = "154cf61364d8dd7abdf42f482c77801605671b359e201d41bd40728ff97cb147" dependencies = [ "agave-feature-set", "assert_matches", @@ -6284,49 +5827,49 @@ dependencies = [ "crossbeam-channel", "log", "serde", - "solana-account 3.2.0", - "solana-account-info 3.0.0", + "solana-account", + "solana-account-info", "solana-accounts-db", "solana-banks-client", "solana-banks-interface", "solana-banks-server", - "solana-clock 3.0.0", + "solana-clock", "solana-cluster-type", "solana-commitment-config", "solana-compute-budget", - "solana-epoch-rewards 3.0.0", - "solana-epoch-schedule 3.0.0", - "solana-fee-calculator 3.0.0", + "solana-epoch-rewards", + "solana-epoch-schedule", + "solana-fee-calculator", "solana-genesis-config", "solana-hash 3.1.0", - "solana-instruction 3.0.0", + "solana-instruction", "solana-keypair", - "solana-loader-v3-interface 6.1.0", + "solana-loader-v3-interface", "solana-logger", - "solana-message 3.0.0", - "solana-msg 3.0.0", - "solana-native-token 3.0.0", + "solana-message", + "solana-msg", + "solana-native-token", "solana-poh-config", - "solana-program-entrypoint 3.1.0", - "solana-program-error 3.0.0", + "solana-program-entrypoint", + "solana-program-error", "solana-program-runtime", "solana-pubkey 3.0.0", - "solana-rent 3.0.0", + "solana-rent", "solana-runtime", "solana-sbpf", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "solana-signer", - "solana-stable-layout 3.0.0", - "solana-stake-interface 2.0.1", + "solana-stable-layout", + "solana-stake-interface 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "solana-svm", "solana-svm-log-collector", "solana-svm-timings", - "solana-system-interface 2.0.0", - "solana-sysvar 3.0.0", - "solana-sysvar-id 3.0.0", + "solana-system-interface", + "solana-sysvar", + "solana-sysvar-id", "solana-transaction", "solana-transaction-context", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "solana-vote-program", "spl-generic-token", "thiserror 2.0.17", @@ -6335,45 +5878,28 @@ dependencies = [ [[package]] name = "solana-pubkey" -version = "2.4.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b62adb9c3261a052ca1f999398c388f1daf558a1b492f60a6d9e64857db4ff1" +checksum = "8909d399deb0851aa524420beeb5646b115fd253ef446e35fe4504c904da3941" dependencies = [ - "borsh 0.10.4", - "borsh 1.5.7", - "bytemuck", - "bytemuck_derive", - "curve25519-dalek 4.1.3", - "five8 0.2.1", - "five8_const", - "getrandom 0.2.15", - "js-sys", - "num-traits", - "serde", - "serde_derive", - "solana-atomic-u64 2.2.1", - "solana-decode-error", - "solana-define-syscall 2.3.0", - "solana-sanitize 2.2.1", - "solana-sha256-hasher 2.2.1", - "wasm-bindgen", + "rand 0.8.5", + "solana-address 1.1.0", ] [[package]] name = "solana-pubkey" -version = "3.0.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8909d399deb0851aa524420beeb5646b115fd253ef446e35fe4504c904da3941" +checksum = "a6f7104d456b58e1418c21a8581e89810278d1190f70f27ece7fc0b2c9282a57" dependencies = [ - "rand 0.8.5", - "solana-address", + "solana-address 2.0.0", ] [[package]] name = "solana-pubsub-client" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dc18dc70532b72eaa8df04683560b99b7177d1fea29f2f5bf3a4a79796df425" +checksum = "d576830da33ab32decfe2b4544fce157241c20de8331f27eca7d902062c2323b" dependencies = [ "crossbeam-channel", "futures-util", @@ -6384,7 +5910,7 @@ dependencies = [ "serde_derive", "serde_json", "solana-account-decoder-client-types", - "solana-clock 3.0.0", + "solana-clock", "solana-pubkey 3.0.0", "solana-rpc-client-types", "solana-signature", @@ -6398,9 +5924,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831453427ac891cba2eaa30051a8a1f1c0a7c8eb9d283cc75ee09ce16245d007" +checksum = "7ada1c8fa92747e20621d33ea1fb715e97060787863492c6ce8250d0517f7a00" dependencies = [ "async-lock", "async-trait", @@ -6409,7 +5935,7 @@ dependencies = [ "log", "quinn", "quinn-proto", - "rustls 0.23.32", + "rustls 0.23.35", "solana-connection-cache", "solana-keypair", "solana-measure", @@ -6421,7 +5947,7 @@ dependencies = [ "solana-signer", "solana-streamer", "solana-tls-utils", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "thiserror 2.0.17", "tokio", ] @@ -6437,9 +5963,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d977cc0f8132e2f7c317a03bc8cec328a4eacccba231cf12d7624bb97cb39ae3" +checksum = "325993b3a280fb9712164db45521bd62074536a9b768e3f488b432b31df141df" dependencies = [ "log", "num_cpus", @@ -6447,28 +5973,15 @@ dependencies = [ [[package]] name = "solana-rent" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1aea8fdea9de98ca6e8c2da5827707fb3842833521b528a713810ca685d2480" -dependencies = [ - "serde", - "serde_derive", - "solana-sdk-ids 2.2.1", - "solana-sdk-macro 2.2.1", - "solana-sysvar-id 2.2.1", -] - -[[package]] -name = "solana-rent" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b702d8c43711e3c8a9284a4f1bbc6a3de2553deb25b0c8142f9a44ef0ce5ddc1" +checksum = "e860d5499a705369778647e97d760f7670adfb6fc8419dd3d568deccd46d5487" dependencies = [ "serde", "serde_derive", - "solana-sdk-ids 3.0.0", - "solana-sdk-macro 3.0.0", - "solana-sysvar-id 3.0.0", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-sysvar-id", ] [[package]] @@ -6483,9 +5996,9 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc97cd8bbbe8fb74a76b2812629dae284e6f5446f7e84a98c3f854e4dc2621b" +checksum = "ddc46e47bda34aee5cc04c794f2b3eaf2e2fccd09742c162aaae34dcd4932b6d" dependencies = [ "async-trait", "base64 0.22.1", @@ -6500,21 +6013,21 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account 3.2.0", + "solana-account", "solana-account-decoder-client-types", - "solana-clock 3.0.0", + "solana-clock", "solana-commitment-config", "solana-epoch-info", - "solana-epoch-schedule 3.0.0", - "solana-feature-gate-interface 3.0.0", + "solana-epoch-schedule", + "solana-feature-gate-interface", "solana-hash 3.1.0", - "solana-instruction 3.0.0", - "solana-message 3.0.0", + "solana-instruction", + "solana-message", "solana-pubkey 3.0.0", "solana-rpc-client-api", "solana-signature", "solana-transaction", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "solana-transaction-status-client-types", "solana-version", "solana-vote-interface 3.0.0", @@ -6523,9 +6036,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26e5f5a813f457dff5a66dfe83eaa7e0e766be5251fc99922e9f2e48a2ebca2e" +checksum = "3fe213690cc657c1f0604d4f0955ca78ff912e3c6df2ed8925479ca850332c44" dependencies = [ "anyhow", "jsonrpc-core", @@ -6535,36 +6048,36 @@ dependencies = [ "serde_derive", "serde_json", "solana-account-decoder-client-types", - "solana-clock 3.0.0", + "solana-clock", "solana-rpc-client-types", "solana-signer", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "solana-transaction-status-client-types", "thiserror 2.0.17", ] [[package]] name = "solana-rpc-client-nonce-utils" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9902af67012d1e92b4a737e26329ae17c4678b5322ed841aa0018bfcfd7a033" +checksum = "feef6cb97e3f48a0fde1cee07c900629fdcd9414fa8abf3aa475f693226d62eb" dependencies = [ - "solana-account 3.2.0", + "solana-account", "solana-commitment-config", "solana-hash 3.1.0", - "solana-message 3.0.0", - "solana-nonce 3.0.0", + "solana-message", + "solana-nonce", "solana-pubkey 3.0.0", "solana-rpc-client", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "thiserror 2.0.17", ] [[package]] name = "solana-rpc-client-types" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a6d3a5969b7ccd2863012fa06daa35e152e264181d24b5153b974351faa9c40" +checksum = "bcafd3a8a77baef8b8c1725746ba3cbaf6e8a9ef9df0f13599c4b468aa344fcc" dependencies = [ "base64 0.22.1", "bs58", @@ -6572,14 +6085,14 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-account 3.2.0", + "solana-account", "solana-account-decoder-client-types", - "solana-clock 3.0.0", + "solana-clock", "solana-commitment-config", - "solana-fee-calculator 3.0.0", + "solana-fee-calculator", "solana-inflation", "solana-pubkey 3.0.0", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "solana-transaction-status-client-types", "solana-version", "spl-generic-token", @@ -6588,15 +6101,15 @@ dependencies = [ [[package]] name = "solana-runtime" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e92c3f0652c772afd524d91119b70a4163bbf3449cf867444cb0efbdc3c0ed" +checksum = "86f61ce070c2a80b9ae53c12217a2c386377e1cc26b60358deb025b05ef93f80" dependencies = [ "agave-feature-set", "agave-precompiles", "agave-reserved-account-keys", "agave-syscalls", - "ahash 0.8.11", + "ahash 0.8.12", "aquamarine", "arc-swap", "arrayref", @@ -6615,7 +6128,7 @@ dependencies = [ "libc", "log", "lz4", - "memmap2 0.9.7", + "memmap2 0.9.9", "mockall", "modular-bitfield", "num-derive", @@ -6631,45 +6144,45 @@ dependencies = [ "serde_derive", "serde_json", "serde_with", - "solana-account 3.2.0", - "solana-account-info 3.0.0", + "solana-account", + "solana-account-info", "solana-accounts-db", - "solana-address-lookup-table-interface 3.0.0", + "solana-address-lookup-table-interface", "solana-bpf-loader-program", "solana-bucket-map", "solana-builtins", "solana-client-traits", - "solana-clock 3.0.0", + "solana-clock", "solana-cluster-type", "solana-commitment-config", "solana-compute-budget", "solana-compute-budget-instruction", "solana-compute-budget-interface", "solana-cost-model", - "solana-cpi 3.0.0", + "solana-cpi", "solana-ed25519-program", "solana-epoch-info", "solana-epoch-rewards-hasher", - "solana-epoch-schedule 3.0.0", - "solana-feature-gate-interface 3.0.0", + "solana-epoch-schedule", + "solana-feature-gate-interface", "solana-fee", - "solana-fee-calculator 3.0.0", + "solana-fee-calculator", "solana-fee-structure", "solana-genesis-config", "solana-hard-forks", "solana-hash 3.1.0", "solana-inflation", - "solana-instruction 3.0.0", + "solana-instruction", "solana-keypair", "solana-lattice-hash", - "solana-loader-v3-interface 6.1.0", - "solana-loader-v4-interface 3.1.0", + "solana-loader-v3-interface", + "solana-loader-v4-interface", "solana-measure", - "solana-message 3.0.0", + "solana-message", "solana-metrics", - "solana-native-token 3.0.0", + "solana-native-token", "solana-nohash-hasher", - "solana-nonce 3.0.0", + "solana-nonce", "solana-nonce-account", "solana-packet", "solana-perf", @@ -6678,32 +6191,32 @@ dependencies = [ "solana-program-runtime", "solana-pubkey 3.0.0", "solana-rayon-threadlimit", - "solana-rent 3.0.0", + "solana-rent", "solana-reward-info", "solana-runtime-transaction", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "solana-secp256k1-program", "solana-seed-derivable", "solana-serde", - "solana-sha256-hasher 3.0.0", + "solana-sha256-hasher", "solana-signature", "solana-signer", - "solana-slot-hashes 3.0.0", - "solana-slot-history 3.0.0", - "solana-stake-interface 2.0.1", - "solana-stake-program 3.0.10", + "solana-slot-hashes", + "solana-slot-history", + "solana-stake-interface 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "solana-stake-program 3.0.12", "solana-svm", "solana-svm-callback", "solana-svm-timings", "solana-svm-transaction", - "solana-system-interface 2.0.0", + "solana-system-interface", "solana-system-transaction", - "solana-sysvar 3.0.0", - "solana-sysvar-id 3.0.0", + "solana-sysvar", + "solana-sysvar-id", "solana-time-utils", "solana-transaction", "solana-transaction-context", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "solana-transaction-status-client-types", "solana-unified-scheduler-logic", "solana-version", @@ -6723,36 +6236,30 @@ dependencies = [ [[package]] name = "solana-runtime-transaction" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eefe5fab5fd673124acd1445b25e69a86a35b4cc06c21f41d15e2c6389120ff0" +checksum = "cfe17453378bb43c44793f3b5361e14318d5693237682c77ea7b1f749eb1c675" dependencies = [ "agave-transaction-view", "log", "solana-compute-budget", "solana-compute-budget-instruction", "solana-hash 3.1.0", - "solana-message 3.0.0", + "solana-message", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "solana-signature", "solana-svm-transaction", "solana-transaction", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "thiserror 2.0.17", ] [[package]] name = "solana-sanitize" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f1bc1357b8188d9c4a3af3fc55276e56987265eb7ad073ae6f8180ee54cecf" - -[[package]] -name = "solana-sanitize" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927e833259588ac8f860861db0f6e2668c3cc46d917798ade116858960acfe8a" +checksum = "dcf09694a0fc14e5ffb18f9b7b7c0f15ecb6eac5b5610bf76a1853459d19daf9" [[package]] name = "solana-sbpf" @@ -6773,32 +6280,11 @@ dependencies = [ [[package]] name = "solana-sdk-ids" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5d8b9cc68d5c88b062a33e23a6466722467dde0035152d8fb1afbcdf350a5f" -dependencies = [ - "solana-pubkey 2.4.0", -] - -[[package]] -name = "solana-sdk-ids" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1b6d6aaf60669c592838d382266b173881c65fb1cdec83b37cb8ce7cb89f9ad" -dependencies = [ - "solana-pubkey 3.0.0", -] - -[[package]] -name = "solana-sdk-macro" -version = "2.2.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86280da8b99d03560f6ab5aca9de2e38805681df34e0bb8f238e69b29433b9df" +checksum = "def234c1956ff616d46c9dd953f251fa7096ddbaa6d52b165218de97882b7280" dependencies = [ - "bs58", - "proc-macro2", - "quote", - "syn 2.0.98", + "solana-address 2.0.0", ] [[package]] @@ -6810,7 +6296,7 @@ dependencies = [ "bs58", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -6829,23 +6315,12 @@ dependencies = [ [[package]] name = "solana-secp256k1-recover" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baa3120b6cdaa270f39444f5093a90a7b03d296d362878f7a6991d6de3bbe496" -dependencies = [ - "libsecp256k1", - "solana-define-syscall 2.3.0", - "thiserror 2.0.17", -] - -[[package]] -name = "solana-secp256k1-recover" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "394a4470477d66296af5217970a905b1c5569032a7732c367fb69e5666c8607e" +checksum = "9de18cfdab99eeb940fbedd8c981fa130c0d76252da75d05446f22fae8b51932" dependencies = [ "k256", - "solana-define-syscall 3.0.0", + "solana-define-syscall 4.0.1", "thiserror 2.0.17", ] @@ -6857,8 +6332,8 @@ checksum = "445d8e12592631d76fc4dc57858bae66c9fd7cc838c306c62a472547fc9d0ce6" dependencies = [ "bytemuck", "openssl", - "solana-instruction 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-instruction", + "solana-sdk-ids", ] [[package]] @@ -6878,21 +6353,21 @@ checksum = "dc905b200a95f2ea9146e43f2a7181e3aeb55de6bc12afb36462d00a3c7310de" dependencies = [ "hmac 0.12.1", "pbkdf2", - "sha2 0.10.8", + "sha2 0.10.9", ] [[package]] name = "solana-send-transaction-service" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9ef499f45da422018cb8d9274d7bb10b71115d728f10edc8352a5d79c7359b" +checksum = "5a1818c7704bf16d5cee1d264c75012092ab35ceb1b39da1f79d803afcccde23" dependencies = [ "async-trait", "crossbeam-channel", "itertools 0.12.1", "log", "solana-client", - "solana-clock 3.0.0", + "solana-clock", "solana-connection-cache", "solana-hash 3.1.0", "solana-keypair", @@ -6906,7 +6381,7 @@ dependencies = [ "solana-time-utils", "solana-tpu-client-next", "tokio", - "tokio-util 0.7.16", + "tokio-util 0.7.17", ] [[package]] @@ -6918,15 +6393,6 @@ dependencies = [ "serde", ] -[[package]] -name = "solana-serde-varint" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a7e155eba458ecfb0107b98236088c3764a09ddf0201ec29e52a0be40857113" -dependencies = [ - "serde", -] - [[package]] name = "solana-serde-varint" version = "3.0.0" @@ -6936,17 +6402,6 @@ dependencies = [ "serde", ] -[[package]] -name = "solana-serialize-utils" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "817a284b63197d2b27afdba829c5ab34231da4a9b4e763466a003c40ca4f535e" -dependencies = [ - "solana-instruction 2.3.0", - "solana-pubkey 2.4.0", - "solana-sanitize 2.2.1", -] - [[package]] name = "solana-serialize-utils" version = "3.1.0" @@ -6955,47 +6410,27 @@ checksum = "56e41dd8feea239516c623a02f0a81c2367f4b604d7965237fed0751aeec33ed" dependencies = [ "solana-instruction-error", "solana-pubkey 3.0.0", - "solana-sanitize 3.0.0", + "solana-sanitize", ] [[package]] name = "solana-sha256-hasher" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0037386961c0d633421f53560ad7c80675c0447cba4d1bb66d60974dd486c7ea" -dependencies = [ - "sha2 0.10.8", - "solana-define-syscall 2.3.0", - "solana-hash 2.3.0", -] - -[[package]] -name = "solana-sha256-hasher" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b912ba6f71cb202c0c3773ec77bf898fa9fe0c78691a2d6859b3b5b8954719" -dependencies = [ - "sha2 0.10.8", - "solana-define-syscall 3.0.0", - "solana-hash 3.1.0", -] - -[[package]] -name = "solana-short-vec" -version = "2.2.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c54c66f19b9766a56fa0057d060de8378676cb64987533fa088861858fc5a69" +checksum = "db7dc3011ea4c0334aaaa7e7128cb390ecf546b28d412e9bf2064680f57f588f" dependencies = [ - "serde", + "sha2 0.10.9", + "solana-define-syscall 4.0.1", + "solana-hash 4.0.1", ] [[package]] name = "solana-short-vec" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b69d029da5428fc1c57f7d49101b2077c61f049d4112cd5fb8456567cc7d2638" +checksum = "79fb1809a32cfcf7d9c47b7070a92fa17cdb620ab5829e9a8a9ff9d138a7a175" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -7006,7 +6441,7 @@ checksum = "94953e22ca28fe4541a3447d6baeaf519cc4ddc063253bfa673b721f34c136bb" dependencies = [ "solana-hard-forks", "solana-hash 3.1.0", - "solana-sha256-hasher 3.0.0", + "solana-sha256-hasher", ] [[package]] @@ -7020,7 +6455,7 @@ dependencies = [ "serde", "serde-big-array", "serde_derive", - "solana-sanitize 3.0.0", + "solana-sanitize", ] [[package]] @@ -7031,20 +6466,7 @@ checksum = "5bfea97951fee8bae0d6038f39a5efcb6230ecdfe33425ac75196d1a1e3e3235" dependencies = [ "solana-pubkey 3.0.0", "solana-signature", - "solana-transaction-error 3.0.0", -] - -[[package]] -name = "solana-slot-hashes" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c8691982114513763e88d04094c9caa0376b867a29577939011331134c301ce" -dependencies = [ - "serde", - "serde_derive", - "solana-hash 2.3.0", - "solana-sdk-ids 2.2.1", - "solana-sysvar-id 2.2.1", + "solana-transaction-error", ] [[package]] @@ -7056,21 +6478,8 @@ dependencies = [ "serde", "serde_derive", "solana-hash 3.1.0", - "solana-sdk-ids 3.0.0", - "solana-sysvar-id 3.0.0", -] - -[[package]] -name = "solana-slot-history" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ccc1b2067ca22754d5283afb2b0126d61eae734fc616d23871b0943b0d935e" -dependencies = [ - "bv", - "serde", - "serde_derive", - "solana-sdk-ids 2.2.1", - "solana-sysvar-id 2.2.1", + "solana-sdk-ids", + "solana-sysvar-id", ] [[package]] @@ -7082,18 +6491,8 @@ dependencies = [ "bv", "serde", "serde_derive", - "solana-sdk-ids 3.0.0", - "solana-sysvar-id 3.0.0", -] - -[[package]] -name = "solana-stable-layout" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f14f7d02af8f2bc1b5efeeae71bc1c2b7f0f65cd75bcc7d8180f2c762a57f54" -dependencies = [ - "solana-instruction 2.3.0", - "solana-pubkey 2.4.0", + "solana-sdk-ids", + "solana-sysvar-id", ] [[package]] @@ -7102,7 +6501,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1da74507795b6e8fb60b7c7306c0c36e2c315805d16eaaf479452661234685ac" dependencies = [ - "solana-instruction 3.0.0", + "solana-instruction", "solana-pubkey 3.0.0", ] @@ -7111,54 +6510,17 @@ name = "solana-stake-client" version = "0.0.0" dependencies = [ "assert_matches", - "borsh 1.5.7", + "borsh", "num-derive", "num-traits", "serde", - "serde_with", - "solana-program", - "thiserror 2.0.17", -] - -[[package]] -name = "solana-stake-interface" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5269e89fde216b4d7e1d1739cf5303f8398a1ff372a81232abbee80e554a838c" -dependencies = [ - "borsh 0.10.4", - "borsh 1.5.7", - "num-traits", - "serde", - "serde_derive", - "solana-clock 2.2.2", - "solana-cpi 2.2.1", - "solana-decode-error", - "solana-instruction 2.3.0", - "solana-program-error 2.2.1", - "solana-pubkey 2.4.0", - "solana-system-interface 1.0.0", - "solana-sysvar-id 2.2.1", -] - -[[package]] -name = "solana-stake-interface" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f912ae679b683365348dea482dbd9468d22ff258b554fd36e3d3683c2122e3" -dependencies = [ - "borsh 1.5.7", - "num-traits", - "serde", - "serde_derive", - "solana-clock 3.0.0", - "solana-cpi 3.0.0", - "solana-instruction 3.0.0", - "solana-program-error 3.0.0", + "serde_with", + "solana-account-info", + "solana-cpi", + "solana-instruction", + "solana-program-error", "solana-pubkey 3.0.0", - "solana-system-interface 2.0.0", - "solana-sysvar 3.0.0", - "solana-sysvar-id 3.0.0", + "thiserror 2.0.17", ] [[package]] @@ -7168,57 +6530,80 @@ dependencies = [ "anyhow", "assert_matches", "bincode", - "borsh 1.5.7", + "borsh", + "codama", + "codama-macros", "num-traits", "serde", "serde_derive", + "serde_json", "serial_test", - "solana-account 3.2.0", - "solana-borsh 3.0.0", - "solana-clock 3.0.0", - "solana-cpi 3.0.0", - "solana-example-mocks 3.0.0", + "solana-account", + "solana-borsh", + "solana-clock", + "solana-cpi", + "solana-example-mocks", "solana-frozen-abi", "solana-frozen-abi-macro", - "solana-instruction 3.0.0", - "solana-program-error 3.0.0", + "solana-instruction", + "solana-program-error", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "solana-stake-interface 2.0.2", - "solana-system-interface 2.0.0", - "solana-sysvar 3.0.0", - "solana-sysvar-id 3.0.0", + "solana-system-interface", + "solana-sysvar", + "solana-sysvar-id", "static_assertions", "strum 0.27.2", "strum_macros 0.27.2", "test-case", ] +[[package]] +name = "solana-stake-interface" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9bc26191b533f9a6e5a14cca05174119819ced680a80febff2f5051a713f0db" +dependencies = [ + "borsh", + "num-traits", + "serde", + "serde_derive", + "solana-clock", + "solana-cpi", + "solana-instruction", + "solana-program-error", + "solana-pubkey 3.0.0", + "solana-system-interface", + "solana-sysvar", + "solana-sysvar-id", +] + [[package]] name = "solana-stake-program" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06f174d24c78d8874c4c28cb855bfe87f720c7e40362ea1b856c4a65abdc6209" +checksum = "813b38448d59514b29553a450aaf9d8b37d86105a7c77f64f61feef37540fe91" dependencies = [ "agave-feature-set", "bincode", "log", - "solana-account 3.2.0", - "solana-bincode 3.0.0", - "solana-clock 3.0.0", + "solana-account", + "solana-bincode", + "solana-clock", "solana-config-interface", "solana-genesis-config", - "solana-instruction 3.0.0", - "solana-native-token 3.0.0", + "solana-instruction", + "solana-native-token", "solana-packet", "solana-program-runtime", "solana-pubkey 3.0.0", - "solana-rent 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-stake-interface 2.0.1", + "solana-rent", + "solana-sdk-ids", + "solana-stake-interface 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "solana-svm-log-collector", "solana-svm-type-overrides", - "solana-sysvar 3.0.0", + "solana-sysvar", "solana-transaction-context", "solana-vote-interface 3.0.0", ] @@ -7234,32 +6619,32 @@ dependencies = [ "mollusk-svm", "proptest", "rand 0.9.2", - "solana-account 3.2.0", - "solana-account-info 3.0.0", - "solana-clock 3.0.0", + "solana-account", + "solana-account-info", + "solana-clock", "solana-config-interface", - "solana-cpi 3.0.0", - "solana-epoch-rewards 3.0.0", - "solana-epoch-schedule 3.0.0", - "solana-instruction 3.0.0", + "solana-cpi", + "solana-epoch-rewards", + "solana-epoch-schedule", + "solana-instruction", "solana-instruction-error", "solana-keypair", "solana-logger", - "solana-msg 3.0.0", - "solana-native-token 3.0.0", - "solana-program-entrypoint 3.1.0", - "solana-program-error 3.0.0", + "solana-msg", + "solana-native-token", + "solana-program-entrypoint", + "solana-program-error", "solana-program-test", "solana-pubkey 3.0.0", - "solana-rent 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-rent", + "solana-sdk-ids", "solana-signature", "solana-signer", - "solana-stake-interface 2.0.1", + "solana-stake-interface 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "solana-svm-log-collector", - "solana-system-interface 2.0.0", - "solana-sysvar 3.0.0", - "solana-sysvar-id 3.0.0", + "solana-system-interface", + "solana-sysvar", + "solana-sysvar-id", "solana-transaction", "solana-vote-interface 4.0.4", "test-case", @@ -7267,9 +6652,9 @@ dependencies = [ [[package]] name = "solana-streamer" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93b8636508e20281a495a33b213f2e19c6b6828419d5c2daa3766411355144e3" +checksum = "81f9b5710a67b472c99ab3c11b4b9a0c6325a6b01b22ed200ed144ec548eeaa4" dependencies = [ "arc-swap", "async-channel", @@ -7280,7 +6665,7 @@ dependencies = [ "futures-util", "governor", "histogram", - "indexmap 2.10.0", + "indexmap 2.12.1", "itertools 0.12.1", "libc", "log", @@ -7291,9 +6676,9 @@ dependencies = [ "quinn", "quinn-proto", "rand 0.8.5", - "rustls 0.23.32", + "rustls 0.23.35", "smallvec", - "socket2 0.6.0", + "socket2", "solana-keypair", "solana-measure", "solana-metrics", @@ -7306,43 +6691,43 @@ dependencies = [ "solana-signer", "solana-time-utils", "solana-tls-utils", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "solana-transaction-metrics-tracker", "thiserror 2.0.17", "tokio", - "tokio-util 0.7.16", + "tokio-util 0.7.17", "x509-parser", ] [[package]] name = "solana-svm" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef1ffa2586ff7023f6dde1b8fd0523557938ef08ac0b7c19b092da2eea6e834" +checksum = "7fb1bccdf5c6a0d17fa9a3b1a6b3414f993aeaeeee8ee49702a36b34203d572d" dependencies = [ - "ahash 0.8.11", + "ahash 0.8.12", "log", "percentage", "serde", "serde_derive", - "solana-account 3.2.0", - "solana-clock 3.0.0", + "solana-account", + "solana-clock", "solana-fee-structure", "solana-hash 3.1.0", - "solana-instruction 3.0.0", - "solana-instructions-sysvar 3.0.0", - "solana-loader-v3-interface 6.1.0", - "solana-loader-v4-interface 3.1.0", + "solana-instruction", + "solana-instructions-sysvar", + "solana-loader-v3-interface", + "solana-loader-v4-interface", "solana-loader-v4-program", - "solana-message 3.0.0", - "solana-nonce 3.0.0", + "solana-message", + "solana-nonce", "solana-nonce-account", - "solana-program-entrypoint 3.1.0", - "solana-program-pack 3.0.0", + "solana-program-entrypoint", + "solana-program-pack", "solana-program-runtime", "solana-pubkey 3.0.0", - "solana-rent 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-rent", + "solana-sdk-ids", "solana-svm-callback", "solana-svm-feature-set", "solana-svm-log-collector", @@ -7350,52 +6735,52 @@ dependencies = [ "solana-svm-timings", "solana-svm-transaction", "solana-svm-type-overrides", - "solana-system-interface 2.0.0", - "solana-sysvar-id 3.0.0", + "solana-system-interface", + "solana-sysvar-id", "solana-transaction-context", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "spl-generic-token", "thiserror 2.0.17", ] [[package]] name = "solana-svm-callback" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2211ecefc92a3d6db1206eca32aa579bb112eb1a2823ac227d8cbd5cdb0465" +checksum = "9be2f26d7b6940c76e6b01f437b13972e7bcbedffdaa2923f181b63bd692df92" dependencies = [ - "solana-account 3.2.0", - "solana-clock 3.0.0", + "solana-account", + "solana-clock", "solana-precompile-error", "solana-pubkey 3.0.0", ] [[package]] name = "solana-svm-feature-set" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a35cded5bc9e32d84c98d81bb9811239d3aea03d0f5ef09aa2f1e8cdaf2d0ff" +checksum = "9b7ecbcb61e0686ab5a31a19b58532f322c70e5869d354d18e4f680df1bd7100" [[package]] name = "solana-svm-log-collector" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455455f9ef91bb738c2363284cd8b6f5956726b0a366ab85976dca23ee1611a4" +checksum = "824cab5bf43604210a59d99ad39f11fedecca2c77806ba43e61799e04383ce67" dependencies = [ "log", ] [[package]] name = "solana-svm-measure" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e3c0ecb1caf08e9d70e41ca99bb18550e05e9a40dce8866fd1c360e67fa78c5" +checksum = "2185a9dd28d4f6f63bd15e727018c6e2ee1e8412416fb7ae7ffcd8f6fa3d4808" [[package]] name = "solana-svm-timings" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62606f820fe99b72ee8e26b8e20eed3c2ccc2f6e3146f537c4cb22a442c69170" +checksum = "3c05c5a004c4a2698396ed3be4dd486075a0f99432595eb9b02f2ec0143fd942" dependencies = [ "eager", "enum-iterator", @@ -7404,43 +6789,27 @@ dependencies = [ [[package]] name = "solana-svm-transaction" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "336583f8418964f7050b98996e13151857995604fe057c0d8f2f3512a16d3a8b" +checksum = "2df7a0213bc369f1b7e9481495362a92e966bca547d77188b235370910c98866" dependencies = [ "solana-hash 3.1.0", - "solana-message 3.0.0", + "solana-message", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "solana-signature", "solana-transaction", ] [[package]] name = "solana-svm-type-overrides" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f802b43ced1f9c6a2bf3b8c740dd43e194f33b3c98a6b3e3d0f989f632ec3ccc" +checksum = "6c878c6880ebec401133983857f296b71f177afccbc551b3fb0fd1fe39fec9d5" dependencies = [ "rand 0.8.5", ] -[[package]] -name = "solana-system-interface" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94d7c18cb1a91c6be5f5a8ac9276a1d7c737e39a21beba9ea710ab4b9c63bc90" -dependencies = [ - "js-sys", - "num-traits", - "serde", - "serde_derive", - "solana-decode-error", - "solana-instruction 2.3.0", - "solana-pubkey 2.4.0", - "wasm-bindgen", -] - [[package]] name = "solana-system-interface" version = "2.0.0" @@ -7450,36 +6819,36 @@ dependencies = [ "num-traits", "serde", "serde_derive", - "solana-instruction 3.0.0", - "solana-msg 3.0.0", - "solana-program-error 3.0.0", + "solana-instruction", + "solana-msg", + "solana-program-error", "solana-pubkey 3.0.0", ] [[package]] name = "solana-system-program" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c68c4e74ea2d55e59cab3346781156c456850a781f07cb6bc0fdbd52fba55b" +checksum = "4e399cba7565e4549776426cef7ecd780a7e577febd64546b4083428641e3962" dependencies = [ "bincode", "log", "serde", "serde_derive", - "solana-account 3.2.0", - "solana-bincode 3.0.0", - "solana-fee-calculator 3.0.0", - "solana-instruction 3.0.0", - "solana-nonce 3.0.0", + "solana-account", + "solana-bincode", + "solana-fee-calculator", + "solana-instruction", + "solana-nonce", "solana-nonce-account", "solana-packet", "solana-program-runtime", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "solana-svm-log-collector", "solana-svm-type-overrides", - "solana-system-interface 2.0.0", - "solana-sysvar 3.0.0", + "solana-system-interface", + "solana-sysvar", "solana-transaction-context", ] @@ -7491,102 +6860,55 @@ checksum = "a31b5699ec533621515e714f1533ee6b3b0e71c463301d919eb59b8c1e249d30" dependencies = [ "solana-hash 3.1.0", "solana-keypair", - "solana-message 3.0.0", + "solana-message", "solana-pubkey 3.0.0", "solana-signer", - "solana-system-interface 2.0.0", + "solana-system-interface", "solana-transaction", ] [[package]] name = "solana-sysvar" -version = "2.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50c92bc019c590f5e42c61939676e18d14809ed00b2a59695dd5c67ae72c097" -dependencies = [ - "base64 0.22.1", - "bincode", - "bytemuck", - "bytemuck_derive", - "lazy_static", - "serde", - "serde_derive", - "solana-account-info 2.2.1", - "solana-clock 2.2.2", - "solana-define-syscall 2.3.0", - "solana-epoch-rewards 2.2.1", - "solana-epoch-schedule 2.2.1", - "solana-fee-calculator 2.2.1", - "solana-hash 2.3.0", - "solana-instruction 2.3.0", - "solana-instructions-sysvar 2.2.2", - "solana-last-restart-slot 2.2.1", - "solana-program-entrypoint 2.2.1", - "solana-program-error 2.2.1", - "solana-program-memory 2.2.1", - "solana-pubkey 2.4.0", - "solana-rent 2.2.1", - "solana-sanitize 2.2.1", - "solana-sdk-ids 2.2.1", - "solana-sdk-macro 2.2.1", - "solana-slot-hashes 2.2.1", - "solana-slot-history 2.2.1", - "solana-stake-interface 1.2.1", - "solana-sysvar-id 2.2.1", -] - -[[package]] -name = "solana-sysvar" -version = "3.0.0" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63205e68d680bcc315337dec311b616ab32fea0a612db3b883ce4de02e0953f9" +checksum = "6690d3dd88f15c21edff68eb391ef8800df7a1f5cec84ee3e8d1abf05affdf74" dependencies = [ "base64 0.22.1", "bincode", "lazy_static", "serde", "serde_derive", - "solana-account-info 3.0.0", - "solana-clock 3.0.0", - "solana-define-syscall 3.0.0", - "solana-epoch-rewards 3.0.0", - "solana-epoch-schedule 3.0.0", - "solana-fee-calculator 3.0.0", + "solana-account-info", + "solana-clock", + "solana-define-syscall 4.0.1", + "solana-epoch-rewards", + "solana-epoch-schedule", + "solana-fee-calculator", "solana-frozen-abi", "solana-frozen-abi-macro", - "solana-hash 3.1.0", - "solana-instruction 3.0.0", - "solana-last-restart-slot 3.0.0", - "solana-program-entrypoint 3.1.0", - "solana-program-error 3.0.0", - "solana-program-memory 3.0.0", - "solana-pubkey 3.0.0", - "solana-rent 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-sdk-macro 3.0.0", - "solana-slot-hashes 3.0.0", - "solana-slot-history 3.0.0", - "solana-sysvar-id 3.0.0", -] - -[[package]] -name = "solana-sysvar-id" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5762b273d3325b047cfda250787f8d796d781746860d5d0a746ee29f3e8812c1" -dependencies = [ - "solana-pubkey 2.4.0", - "solana-sdk-ids 2.2.1", + "solana-hash 4.0.1", + "solana-instruction", + "solana-last-restart-slot", + "solana-program-entrypoint", + "solana-program-error", + "solana-program-memory", + "solana-pubkey 4.0.0", + "solana-rent", + "solana-sdk-ids", + "solana-sdk-macro", + "solana-slot-hashes", + "solana-slot-history", + "solana-sysvar-id", ] [[package]] name = "solana-sysvar-id" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5051bc1a16d5d96a96bc33b5b2ec707495c48fe978097bdaba68d3c47987eb32" +checksum = "17358d1e9a13e5b9c2264d301102126cf11a47fd394cdf3dec174fe7bc96e1de" dependencies = [ - "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-address 2.0.0", + "solana-sdk-ids", ] [[package]] @@ -7597,11 +6919,11 @@ checksum = "0ced92c60aa76ec4780a9d93f3bd64dfa916e1b998eacc6f1c110f3f444f02c9" [[package]] name = "solana-tls-utils" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213b0b783dc59c113821478ab18da70b7b143ef69b194b7975fcdda20372130c" +checksum = "53980fcde4ee812d26a7bd4cb07ca9b3a111951145c9f0f3533e6d6139dafea0" dependencies = [ - "rustls 0.23.32", + "rustls 0.23.35", "solana-keypair", "solana-pubkey 3.0.0", "solana-signer", @@ -7610,24 +6932,24 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eebf10061d061815585f32ea318e6dc71aa253dde5c4ad527bd973b71656c0b4" +checksum = "00122487e49ad299e5568082cd8753e5be159b09c8a8bebf430ed50d8837efdc" dependencies = [ "async-trait", "bincode", "futures-util", - "indexmap 2.10.0", + "indexmap 2.12.1", "indicatif", "log", "rayon", "solana-client-traits", - "solana-clock 3.0.0", + "solana-clock", "solana-commitment-config", "solana-connection-cache", - "solana-epoch-schedule 3.0.0", + "solana-epoch-schedule", "solana-measure", - "solana-message 3.0.0", + "solana-message", "solana-net-utils", "solana-pubkey 3.0.0", "solana-pubsub-client", @@ -7637,23 +6959,23 @@ dependencies = [ "solana-signature", "solana-signer", "solana-transaction", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "thiserror 2.0.17", "tokio", ] [[package]] name = "solana-tpu-client-next" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8091cd93c843a7a7d3496002590aea8796b7c5f55ffc03d34746fc0674804286" +checksum = "4d9a42530995727ee60cf72fd84d0e8b29eaca38a13c53bf11bb82a523c9bcdb" dependencies = [ "async-trait", "log", "lru", "quinn", - "rustls 0.23.32", - "solana-clock 3.0.0", + "rustls 0.23.35", + "solana-clock", "solana-connection-cache", "solana-keypair", "solana-measure", @@ -7666,58 +6988,48 @@ dependencies = [ "solana-tpu-client", "thiserror 2.0.17", "tokio", - "tokio-util 0.7.16", + "tokio-util 0.7.17", ] [[package]] name = "solana-transaction" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64928e6af3058dcddd6da6680cbe08324b4e071ad73115738235bbaa9e9f72a5" +checksum = "2ceb2efbf427a91b884709ffac4dac29117752ce1e37e9ae04977e450aa0bb76" dependencies = [ "bincode", "serde", "serde_derive", - "solana-address", - "solana-hash 3.1.0", - "solana-instruction 3.0.0", + "solana-address 2.0.0", + "solana-hash 4.0.1", + "solana-instruction", "solana-instruction-error", - "solana-message 3.0.0", - "solana-sanitize 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-short-vec 3.0.0", + "solana-message", + "solana-sanitize", + "solana-sdk-ids", + "solana-short-vec", "solana-signature", "solana-signer", - "solana-transaction-error 3.0.0", + "solana-transaction-error", ] [[package]] name = "solana-transaction-context" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9c6820c3a14bd07b2256640bd64af4a44ac49f505dca93cc11f77bc79cfd44a" +checksum = "acc12cfe0ac1e3d23ddca08cb01123d08c5b98b8b4814eb367ec245122c0d7d1" dependencies = [ "bincode", "qualifier_attr", "serde", "serde_derive", - "solana-account 3.2.0", - "solana-instruction 3.0.0", - "solana-instructions-sysvar 3.0.0", + "solana-account", + "solana-instruction", + "solana-instructions-sysvar", "solana-pubkey 3.0.0", - "solana-rent 3.0.0", + "solana-rent", "solana-sbpf", - "solana-sdk-ids 3.0.0", -] - -[[package]] -name = "solana-transaction-error" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a9dc8fdb61c6088baab34fc3a8b8473a03a7a5fd404ed8dd502fa79b67cb1" -dependencies = [ - "solana-instruction 2.3.0", - "solana-sanitize 2.2.1", + "solana-sdk-ids", ] [[package]] @@ -7729,14 +7041,14 @@ dependencies = [ "serde", "serde_derive", "solana-instruction-error", - "solana-sanitize 3.0.0", + "solana-sanitize", ] [[package]] name = "solana-transaction-metrics-tracker" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f80e292c487f87712db7962dbe648054e362c37bd5dbdc7d28efcfc4d9ef1217" +checksum = "e4abd1130318189f464bfb814fc9ee7544f76f9f86de219cc5eb4a02a3564743" dependencies = [ "base64 0.22.1", "bincode", @@ -7744,15 +7056,15 @@ dependencies = [ "rand 0.8.5", "solana-packet", "solana-perf", - "solana-short-vec 3.0.0", + "solana-short-vec", "solana-signature", ] [[package]] name = "solana-transaction-status-client-types" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42333c56ebbbaab0a354c0a5ad621c0640b136e4ba0db3ba56d12b0500b27071" +checksum = "8983dcea68b4626b8829098b4046869124fb107e6a67897b1e5964c92b8d31bc" dependencies = [ "base64 0.22.1", "bincode", @@ -7762,38 +7074,38 @@ dependencies = [ "serde_json", "solana-account-decoder-client-types", "solana-commitment-config", - "solana-instruction 3.0.0", - "solana-message 3.0.0", + "solana-instruction", + "solana-message", "solana-pubkey 3.0.0", "solana-reward-info", "solana-signature", "solana-transaction", "solana-transaction-context", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "thiserror 2.0.17", ] [[package]] name = "solana-udp-client" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f25cf8797c360193e9500aa8c96fa969cd27ac5f4a03928616bb45acedda391a" +checksum = "f642b80d0c71fead2d794e9cc67dabbc3fc94c6ea9d43be8562c8cb249d83f9a" dependencies = [ "async-trait", "solana-connection-cache", "solana-keypair", "solana-net-utils", "solana-streamer", - "solana-transaction-error 3.0.0", + "solana-transaction-error", "thiserror 2.0.17", "tokio", ] [[package]] name = "solana-unified-scheduler-logic" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9151a3f80cb570d848fe8ff2985d2e8f84df49b832a9434ed255065c5e670e9c" +checksum = "d17226a237a7f3269063827d9752c3f8d7c62487ba49ac848794893527d80c03" dependencies = [ "assert_matches", "solana-pubkey 3.0.0", @@ -7805,39 +7117,39 @@ dependencies = [ [[package]] name = "solana-version" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44177fea32b10c8b9f3c19ba13ea21c5abc163d1cfb7a134fe16449f13f7c5b2" +checksum = "ff03ccee2881ce60058fda9d256b68fcc3b6ecd467e613a1d7c3d64b78d91083" dependencies = [ "agave-feature-set", "rand 0.8.5", "semver", "serde", "serde_derive", - "solana-sanitize 3.0.0", - "solana-serde-varint 3.0.0", + "solana-sanitize", + "solana-serde-varint", ] [[package]] name = "solana-vote" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "073d95f8c00bc11ec692d3b3ce896f84e16e9ac107f32a73c9b2224d84b5fced" +checksum = "e1dfa471b3cf5ee27ba535d9256da6628b1fb89c8f1cbba2f3dbf081576fee32" dependencies = [ "itertools 0.12.1", "log", "serde", "serde_derive", - "solana-account 3.2.0", - "solana-bincode 3.0.0", - "solana-clock 3.0.0", + "solana-account", + "solana-bincode", + "solana-clock", "solana-hash 3.1.0", - "solana-instruction 3.0.0", + "solana-instruction", "solana-keypair", "solana-packet", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-serialize-utils 3.1.0", + "solana-sdk-ids", + "solana-serialize-utils", "solana-signature", "solana-signer", "solana-svm-transaction", @@ -7846,30 +7158,6 @@ dependencies = [ "thiserror 2.0.17", ] -[[package]] -name = "solana-vote-interface" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b80d57478d6599d30acc31cc5ae7f93ec2361a06aefe8ea79bc81739a08af4c3" -dependencies = [ - "bincode", - "num-derive", - "num-traits", - "serde", - "serde_derive", - "solana-clock 2.2.2", - "solana-decode-error", - "solana-hash 2.3.0", - "solana-instruction 2.3.0", - "solana-pubkey 2.4.0", - "solana-rent 2.2.1", - "solana-sdk-ids 2.2.1", - "solana-serde-varint 2.2.2", - "solana-serialize-utils 2.2.1", - "solana-short-vec 2.2.1", - "solana-system-interface 1.0.0", -] - [[package]] name = "solana-vote-interface" version = "3.0.0" @@ -7883,17 +7171,17 @@ dependencies = [ "serde", "serde_derive", "serde_with", - "solana-clock 3.0.0", + "solana-clock", "solana-hash 3.1.0", - "solana-instruction 3.0.0", + "solana-instruction", "solana-instruction-error", "solana-pubkey 3.0.0", - "solana-rent 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-serde-varint 3.0.0", - "solana-serialize-utils 3.1.0", - "solana-short-vec 3.0.0", - "solana-system-interface 2.0.0", + "solana-rent", + "solana-sdk-ids", + "solana-serde-varint", + "solana-serialize-utils", + "solana-short-vec", + "solana-system-interface", ] [[package]] @@ -7909,24 +7197,24 @@ dependencies = [ "serde", "serde_derive", "serde_with", - "solana-clock 3.0.0", + "solana-clock", "solana-hash 3.1.0", - "solana-instruction 3.0.0", + "solana-instruction", "solana-instruction-error", "solana-pubkey 3.0.0", - "solana-rent 3.0.0", - "solana-sdk-ids 3.0.0", - "solana-serde-varint 3.0.0", - "solana-serialize-utils 3.1.0", - "solana-short-vec 3.0.0", - "solana-system-interface 2.0.0", + "solana-rent", + "solana-sdk-ids", + "solana-serde-varint", + "solana-serialize-utils", + "solana-short-vec", + "solana-system-interface", ] [[package]] name = "solana-vote-program" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76271ecc50cdb46fd4c792f9d6078e60d1e2fb6ac2e21e3134085f9bf4159554" +checksum = "c9f470d8bb37eeed628532ab2c9a2c1f1dc91acf11c2d17c9260157009992dd1" dependencies = [ "agave-feature-set", "bincode", @@ -7935,20 +7223,20 @@ dependencies = [ "num-traits", "serde", "serde_derive", - "solana-account 3.2.0", - "solana-bincode 3.0.0", - "solana-clock 3.0.0", - "solana-epoch-schedule 3.0.0", + "solana-account", + "solana-bincode", + "solana-clock", + "solana-epoch-schedule", "solana-hash 3.1.0", - "solana-instruction 3.0.0", + "solana-instruction", "solana-keypair", "solana-packet", "solana-program-runtime", "solana-pubkey 3.0.0", - "solana-rent 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-rent", + "solana-sdk-ids", "solana-signer", - "solana-slot-hashes 3.0.0", + "solana-slot-hashes", "solana-transaction", "solana-transaction-context", "solana-vote-interface 3.0.0", @@ -7957,17 +7245,17 @@ dependencies = [ [[package]] name = "solana-zk-elgamal-proof-program" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27a10e5f73160da55ab35471443edfaa551503514571cc63c34a4d0a10b0ff45" +checksum = "da3608816af7d734e557997da585ebea22a138d53a06b723d8d9d20e87d4a4cb" dependencies = [ "agave-feature-set", "bytemuck", "num-derive", "num-traits", - "solana-instruction 3.0.0", + "solana-instruction", "solana-program-runtime", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "solana-svm-log-collector", "solana-zk-sdk", ] @@ -7984,7 +7272,7 @@ dependencies = [ "bytemuck", "bytemuck_derive", "curve25519-dalek 4.1.3", - "getrandom 0.2.15", + "getrandom 0.2.16", "itertools 0.12.1", "js-sys", "merlin", @@ -7996,9 +7284,9 @@ dependencies = [ "serde_json", "sha3", "solana-derivation-path", - "solana-instruction 3.0.0", + "solana-instruction", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "solana-seed-derivable", "solana-seed-phrase", "solana-signature", @@ -8011,26 +7299,26 @@ dependencies = [ [[package]] name = "solana-zk-token-proof-program" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f48e57c79397d1c2bc34a5de7600ed09aad047958f1d36ba4aee4cb6993a5b01" +checksum = "4fa8432001b2fc671040f944db567f25b33b3a36a3d8889a93ba86082ca2fc2d" dependencies = [ "agave-feature-set", "bytemuck", "num-derive", "num-traits", - "solana-instruction 3.0.0", + "solana-instruction", "solana-program-runtime", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "solana-svm-log-collector", "solana-zk-token-sdk", ] [[package]] name = "solana-zk-token-sdk" -version = "3.0.10" +version = "3.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef89a6d71457129ed9686cd24018b86c10de0c07697b6b6a572fd0bbcb9bed94" +checksum = "fc229188fab61e2ba16c2a6eb4ed04589c41ade03cf708ae4a5c3db5ae4b01f0" dependencies = [ "aes-gcm-siv", "base64 0.22.1", @@ -8049,9 +7337,9 @@ dependencies = [ "sha3", "solana-curve25519", "solana-derivation-path", - "solana-instruction 3.0.0", + "solana-instruction", "solana-pubkey 3.0.0", - "solana-sdk-ids 3.0.0", + "solana-sdk-ids", "solana-seed-derivable", "solana-seed-phrase", "solana-signature", @@ -8092,9 +7380,9 @@ dependencies = [ [[package]] name = "stable_deref_trait" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "static_assertions" @@ -8145,7 +7433,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -8173,9 +7461,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.98" +version = "2.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" dependencies = [ "proc-macro2", "quote", @@ -8205,13 +7493,13 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -8262,15 +7550,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.20.0" +version = "3.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" +checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" dependencies = [ "fastrand", - "getrandom 0.3.1", + "getrandom 0.3.4", "once_cell", - "rustix 1.0.8", - "windows-sys 0.59.0", + "rustix", + "windows-sys 0.61.2", ] [[package]] @@ -8297,7 +7585,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -8308,7 +7596,7 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", "test-case-core", ] @@ -8338,7 +7626,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -8349,24 +7637,23 @@ checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" dependencies = [ "cfg-if", - "once_cell", ] [[package]] name = "time" -version = "0.3.37" +version = "0.3.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" dependencies = [ "deranged", "itoa", @@ -8379,15 +7666,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" [[package]] name = "time-macros" -version = "0.2.19" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" dependencies = [ "num-conv", "time-core", @@ -8395,9 +7682,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.6" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" dependencies = [ "displaydoc", "zerovec", @@ -8405,9 +7692,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" dependencies = [ "tinyvec_macros", ] @@ -8420,33 +7707,30 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.47.1" +version = "1.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" +checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" dependencies = [ - "backtrace", "bytes", - "io-uring", "libc", "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", - "slab", - "socket2 0.6.0", + "socket2", "tokio-macros", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -8461,11 +7745,11 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ - "rustls 0.23.32", + "rustls 0.23.35", "tokio", ] @@ -8528,9 +7812,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.16" +version = "0.7.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" +checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594" dependencies = [ "bytes", "futures-core", @@ -8541,30 +7825,75 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.11" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_edit 0.22.27", ] [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap 2.12.1", + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_write", + "winnow", +] [[package]] name = "toml_edit" -version = "0.22.24" +version = "0.23.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d7cbc3b4b49633d57a0509303158ca50de80ae32c265093b24c414705807832" +dependencies = [ + "indexmap 2.12.1", + "toml_datetime 0.7.3", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" dependencies = [ - "indexmap 2.10.0", - "toml_datetime", "winnow", ] +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + [[package]] name = "tower" version = "0.5.2" @@ -8582,17 +7911,22 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ + "async-compression", "bitflags", "bytes", + "futures-core", "futures-util", - "http 1.3.1", + "http 1.4.0", "http-body", + "http-body-util", "iri-string", "pin-project-lite", + "tokio", + "tokio-util 0.7.17", "tower", "tower-layer", "tower-service", @@ -8612,9 +7946,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647" dependencies = [ "log", "pin-project-lite", @@ -8624,20 +7958,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.28" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c" dependencies = [ "once_cell", "valuable", @@ -8658,9 +7992,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.20" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" +checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" dependencies = [ "sharded-slab", "thread_local", @@ -8696,9 +8030,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.17.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] name = "unarray" @@ -8708,15 +8042,15 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "unicode-width" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" [[package]] name = "unicode-xid" @@ -8726,9 +8060,9 @@ checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "unit-prefix" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "323402cff2dd658f39ca17c789b502021b3f18707c91cdf22e3838e1b4023817" +checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3" [[package]] name = "universal-hash" @@ -8773,13 +8107,14 @@ dependencies = [ [[package]] name = "url" -version = "2.5.4" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] @@ -8788,12 +8123,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -8866,50 +8195,37 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] -name = "wasi" -version = "0.13.3+wasi-0.2.2" +name = "wasip2" +version = "1.0.1+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" dependencies = [ - "wit-bindgen-rt", + "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.98", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.50" +version = "0.4.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" dependencies = [ "cfg-if", "js-sys", @@ -8920,9 +8236,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8930,31 +8246,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" dependencies = [ + "bumpalo", "proc-macro2", "quote", - "syn 2.0.98", - "wasm-bindgen-backend", + "syn 2.0.111", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.77" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" dependencies = [ "js-sys", "wasm-bindgen", @@ -8972,9 +8288,9 @@ dependencies = [ [[package]] name = "webpki-root-certs" -version = "0.26.8" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09aed61f5e8d2c18344b3faa33a4c837855fe56642757754775548fee21386c4" +checksum = "ee3e3b5f5e80bc89f30ce8d0343bf4e5f12341c51f3e26cbeecbc7c85443e85b" dependencies = [ "rustls-pki-types", ] @@ -8996,23 +8312,13 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8983c3ab33d6fb807cfcdad2491c4ea8cbc8ed839181c7dfd9c67c83e261b2" +checksum = "b2878ef029c47c6e8cf779119f20fcf52bde7ad42a731b2a304bc221df17571e" dependencies = [ "rustls-pki-types", ] -[[package]] -name = "wide" -version = "0.7.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" -dependencies = [ - "bytemuck", - "safe_arch", -] - [[package]] name = "winapi" version = "0.3.9" @@ -9031,11 +8337,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -9046,42 +8352,77 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.52.0" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ - "windows-targets 0.52.6", + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", ] [[package]] name = "windows-link" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] -name = "windows-sys" -version = "0.45.0" +name = "windows-result" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "windows-targets 0.42.2", + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", ] [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.42.2", ] [[package]] name = "windows-sys" -version = "0.59.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ "windows-targets 0.52.6", ] @@ -9092,14 +8433,14 @@ version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.53.4", + "windows-targets 0.53.5", ] [[package]] name = "windows-sys" -version = "0.61.1" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f109e41dd4a3c848907eb83d5a42ea98b3769495597450cf6d153507b166f0f" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ "windows-link", ] @@ -9137,19 +8478,19 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.4" +version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d42b7b7f66d2a06854650af09cfdf8713e427a439c97ad65a6375318033ac4b" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ "windows-link", - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", ] [[package]] @@ -9166,9 +8507,9 @@ checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" [[package]] name = "windows_aarch64_msvc" @@ -9184,9 +8525,9 @@ checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_aarch64_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" [[package]] name = "windows_i686_gnu" @@ -9202,9 +8543,9 @@ checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnu" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" [[package]] name = "windows_i686_gnullvm" @@ -9214,9 +8555,9 @@ checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" [[package]] name = "windows_i686_msvc" @@ -9232,9 +8573,9 @@ checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_i686_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" [[package]] name = "windows_x86_64_gnu" @@ -9250,9 +8591,9 @@ checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnu" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" [[package]] name = "windows_x86_64_gnullvm" @@ -9268,9 +8609,9 @@ checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_gnullvm" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" [[package]] name = "windows_x86_64_msvc" @@ -9286,39 +8627,30 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "windows_x86_64_msvc" -version = "0.53.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" -version = "0.7.2" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59690dea168f2198d1a3b0cac23b8063efcd11012f10ae4698f284808c8ef603" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" dependencies = [ "memchr", ] [[package]] -name = "wit-bindgen-rt" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" -dependencies = [ - "bitflags", -] - -[[package]] -name = "write16" -version = "1.0.0" +name = "wit-bindgen" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "writeable" -version = "0.5.5" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" [[package]] name = "x509-parser" @@ -9340,22 +8672,20 @@ dependencies = [ [[package]] name = "xattr" -version = "1.4.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" +checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" dependencies = [ "libc", - "linux-raw-sys 0.4.15", - "rustix 0.38.44", + "rustix", ] [[package]] name = "yoke" -version = "0.7.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" dependencies = [ - "serde", "stable_deref_trait", "yoke-derive", "zerofrom", @@ -9363,63 +8693,62 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.5" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", - "synstructure 0.13.1", + "syn 2.0.111", + "synstructure 0.13.2", ] [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" dependencies = [ - "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", - "synstructure 0.13.1", + "syn 2.0.111", + "synstructure 0.13.2", ] [[package]] name = "zeroize" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" dependencies = [ "zeroize_derive", ] @@ -9432,14 +8761,25 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", +] + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", ] [[package]] name = "zerovec" -version = "0.10.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" dependencies = [ "yoke", "zerofrom", @@ -9448,13 +8788,13 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.3" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.98", + "syn 2.0.111", ] [[package]] @@ -9468,18 +8808,18 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "7.2.1" +version = "7.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" +version = "2.0.16+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index 6b8cd32a..ac4fc77c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,11 +20,11 @@ solana = "3.0.0" level = "warn" check-cfg = [ 'cfg(target_os, values("solana"))', - 'cfg(feature, values("custom-heap", "custom-panic", "frozen-abi", "no-entrypoint"))', + 'cfg(feature, values("codama", "custom-heap", "custom-panic", "frozen-abi", "no-entrypoint"))', ] [workspace.metadata.toolchains] -build = "1.86.0" +build = "1.90.0" format = "nightly-2025-02-16" lint = "nightly-2025-02-16" test = "nightly-2025-02-16" diff --git a/Makefile b/Makefile index 0fd1d3c9..047d2ffa 100644 --- a/Makefile +++ b/Makefile @@ -84,6 +84,9 @@ stop-test-validator: generate-clients: pnpm generate:clients $(ARGS) +generate-idl-%: + cargo run --manifest-path $(call make-path,$*)/Cargo.toml --features codama --bin generate-idl $(ARGS) + # Helpers for publishing tag-name = $(lastword $(subst /, ,$(call make-path,$1))) preid-arg = $(subst pre,--preid $2,$(findstring pre,$1)) diff --git a/clients/js/src/generated/instructions/authorize.ts b/clients/js/src/generated/instructions/authorize.ts index fd9c0d12..4411210b 100644 --- a/clients/js/src/generated/instructions/authorize.ts +++ b/clients/js/src/generated/instructions/authorize.ts @@ -133,9 +133,9 @@ export type AuthorizeInput< stake: Address; /** Clock sysvar */ clockSysvar?: Address; - /** Stake or withdraw authority */ + /** The stake or withdraw authority */ authority: TransactionSigner; - /** Lockup authority */ + /** Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration */ lockupAuthority?: TransactionSigner; arg0: AuthorizeInstructionDataArgs['arg0']; arg1: AuthorizeInstructionDataArgs['arg1']; @@ -220,9 +220,9 @@ export type ParsedAuthorizeInstruction< stake: TAccountMetas[0]; /** Clock sysvar */ clockSysvar: TAccountMetas[1]; - /** Stake or withdraw authority */ + /** The stake or withdraw authority */ authority: TAccountMetas[2]; - /** Lockup authority */ + /** Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration */ lockupAuthority?: TAccountMetas[3] | undefined; }; data: AuthorizeInstructionData; diff --git a/clients/js/src/generated/instructions/authorizeChecked.ts b/clients/js/src/generated/instructions/authorizeChecked.ts index eafcaf60..b230f69f 100644 --- a/clients/js/src/generated/instructions/authorizeChecked.ts +++ b/clients/js/src/generated/instructions/authorizeChecked.ts @@ -137,7 +137,7 @@ export type AuthorizeCheckedInput< authority: TransactionSigner; /** The new stake or withdraw authority */ newAuthority: TransactionSigner; - /** Lockup authority */ + /** Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration */ lockupAuthority?: TransactionSigner; stakeAuthorize: AuthorizeCheckedInstructionDataArgs['stakeAuthorize']; }; @@ -231,7 +231,7 @@ export type ParsedAuthorizeCheckedInstruction< authority: TAccountMetas[2]; /** The new stake or withdraw authority */ newAuthority: TAccountMetas[3]; - /** Lockup authority */ + /** Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration */ lockupAuthority?: TAccountMetas[4] | undefined; }; data: AuthorizeCheckedInstructionData; diff --git a/clients/js/src/generated/instructions/authorizeCheckedWithSeed.ts b/clients/js/src/generated/instructions/authorizeCheckedWithSeed.ts index 66a5519c..317277e1 100644 --- a/clients/js/src/generated/instructions/authorizeCheckedWithSeed.ts +++ b/clients/js/src/generated/instructions/authorizeCheckedWithSeed.ts @@ -156,7 +156,7 @@ export type AuthorizeCheckedWithSeedInput< clockSysvar?: Address; /** The new stake or withdraw authority */ newAuthority: TransactionSigner; - /** Lockup authority */ + /** Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration */ lockupAuthority?: TransactionSigner; stakeAuthorize: AuthorizeCheckedWithSeedInstructionDataArgs['stakeAuthorize']; authoritySeed: AuthorizeCheckedWithSeedInstructionDataArgs['authoritySeed']; @@ -252,7 +252,7 @@ export type ParsedAuthorizeCheckedWithSeedInstruction< clockSysvar: TAccountMetas[2]; /** The new stake or withdraw authority */ newAuthority: TAccountMetas[3]; - /** Lockup authority */ + /** Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration */ lockupAuthority?: TAccountMetas[4] | undefined; }; data: AuthorizeCheckedWithSeedInstructionData; diff --git a/clients/js/src/generated/instructions/authorizeWithSeed.ts b/clients/js/src/generated/instructions/authorizeWithSeed.ts index 0f103252..0007b5b7 100644 --- a/clients/js/src/generated/instructions/authorizeWithSeed.ts +++ b/clients/js/src/generated/instructions/authorizeWithSeed.ts @@ -149,7 +149,7 @@ export type AuthorizeWithSeedInput< base: TransactionSigner; /** Clock sysvar */ clockSysvar?: Address; - /** Lockup authority */ + /** Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration */ lockupAuthority?: TransactionSigner; newAuthorizedPubkey: AuthorizeWithSeedInstructionDataArgs['newAuthorizedPubkey']; stakeAuthorize: AuthorizeWithSeedInstructionDataArgs['stakeAuthorize']; @@ -238,7 +238,7 @@ export type ParsedAuthorizeWithSeedInstruction< base: TAccountMetas[1]; /** Clock sysvar */ clockSysvar: TAccountMetas[2]; - /** Lockup authority */ + /** Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration */ lockupAuthority?: TAccountMetas[3] | undefined; }; data: AuthorizeWithSeedInstructionData; diff --git a/clients/js/src/generated/instructions/deactivate.ts b/clients/js/src/generated/instructions/deactivate.ts index c6d73b86..7bbce5a8 100644 --- a/clients/js/src/generated/instructions/deactivate.ts +++ b/clients/js/src/generated/instructions/deactivate.ts @@ -93,7 +93,7 @@ export type DeactivateInput< TAccountClockSysvar extends string = string, TAccountStakeAuthority extends string = string, > = { - /** Delegated stake account */ + /** Delegated stake account to be deactivated */ stake: Address; /** Clock sysvar */ clockSysvar?: Address; @@ -162,7 +162,7 @@ export type ParsedDeactivateInstruction< > = { programAddress: Address; accounts: { - /** Delegated stake account */ + /** Delegated stake account to be deactivated */ stake: TAccountMetas[0]; /** Clock sysvar */ clockSysvar: TAccountMetas[1]; diff --git a/clients/js/src/generated/instructions/deactivateDelinquent.ts b/clients/js/src/generated/instructions/deactivateDelinquent.ts index b1df56cb..88ecf8ad 100644 --- a/clients/js/src/generated/instructions/deactivateDelinquent.ts +++ b/clients/js/src/generated/instructions/deactivateDelinquent.ts @@ -92,9 +92,9 @@ export type DeactivateDelinquentInput< > = { /** Delegated stake account */ stake: Address; - /** Delinquent vote account */ + /** Delinquent vote account for the delegated stake account */ delinquentVote: Address; - /** Reference vote account */ + /** Reference vote account that has voted at least once in the last `MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION` epochs */ referenceVote: Address; }; @@ -155,9 +155,9 @@ export type ParsedDeactivateDelinquentInstruction< accounts: { /** Delegated stake account */ stake: TAccountMetas[0]; - /** Delinquent vote account */ + /** Delinquent vote account for the delegated stake account */ delinquentVote: TAccountMetas[1]; - /** Reference vote account */ + /** Reference vote account that has voted at least once in the last `MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION` epochs */ referenceVote: TAccountMetas[2]; }; data: DeactivateDelinquentInstructionData; diff --git a/clients/js/src/generated/instructions/delegateStake.ts b/clients/js/src/generated/instructions/delegateStake.ts index 0b712b93..1797f2fe 100644 --- a/clients/js/src/generated/instructions/delegateStake.ts +++ b/clients/js/src/generated/instructions/delegateStake.ts @@ -44,7 +44,9 @@ export type DelegateStakeInstruction< TAccountClockSysvar extends | string | AccountMeta = 'SysvarC1ock11111111111111111111111111111111', - TAccountStakeHistory extends string | AccountMeta = string, + TAccountStakeHistory extends + | string + | AccountMeta = 'SysvarStakeHistory1111111111111111111111111', TAccountUnused extends string | AccountMeta = string, TAccountStakeAuthority extends string | AccountMeta = string, TRemainingAccounts extends readonly AccountMeta[] = [], @@ -114,8 +116,8 @@ export type DelegateStakeInput< vote: Address; /** Clock sysvar */ clockSysvar?: Address; - /** Stake history sysvar */ - stakeHistory: Address; + /** Stake history sysvar that carries stake warmup/cooldown history */ + stakeHistory?: Address; /** Unused account, formerly the stake config */ unused: Address; /** Stake authority */ @@ -171,6 +173,10 @@ export function getDelegateStakeInstruction< accounts.clockSysvar.value = 'SysvarC1ock11111111111111111111111111111111' as Address<'SysvarC1ock11111111111111111111111111111111'>; } + if (!accounts.stakeHistory.value) { + accounts.stakeHistory.value = + 'SysvarStakeHistory1111111111111111111111111' as Address<'SysvarStakeHistory1111111111111111111111111'>; + } const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted'); return Object.freeze({ @@ -207,7 +213,7 @@ export type ParsedDelegateStakeInstruction< vote: TAccountMetas[1]; /** Clock sysvar */ clockSysvar: TAccountMetas[2]; - /** Stake history sysvar */ + /** Stake history sysvar that carries stake warmup/cooldown history */ stakeHistory: TAccountMetas[3]; /** Unused account, formerly the stake config */ unused: TAccountMetas[4]; diff --git a/clients/js/src/generated/instructions/merge.ts b/clients/js/src/generated/instructions/merge.ts index 502cfd33..f792d606 100644 --- a/clients/js/src/generated/instructions/merge.ts +++ b/clients/js/src/generated/instructions/merge.ts @@ -44,7 +44,9 @@ export type MergeInstruction< TAccountClockSysvar extends | string | AccountMeta = 'SysvarC1ock11111111111111111111111111111111', - TAccountStakeHistory extends string | AccountMeta = string, + TAccountStakeHistory extends + | string + | AccountMeta = 'SysvarStakeHistory1111111111111111111111111', TAccountStakeAuthority extends string | AccountMeta = string, TRemainingAccounts extends readonly AccountMeta[] = [], > = Instruction & @@ -103,14 +105,14 @@ export type MergeInput< TAccountStakeHistory extends string = string, TAccountStakeAuthority extends string = string, > = { - /** Destination stake account */ + /** Destination stake account for the merge */ destinationStake: Address; - /** Source stake account */ + /** Source stake account for to merge. This account will be drained */ sourceStake: Address; /** Clock sysvar */ clockSysvar?: Address; - /** Stake history sysvar */ - stakeHistory: Address; + /** Stake history sysvar that carries stake warmup/cooldown history */ + stakeHistory?: Address; /** Stake authority */ stakeAuthority: TransactionSigner; }; @@ -163,6 +165,10 @@ export function getMergeInstruction< accounts.clockSysvar.value = 'SysvarC1ock11111111111111111111111111111111' as Address<'SysvarC1ock11111111111111111111111111111111'>; } + if (!accounts.stakeHistory.value) { + accounts.stakeHistory.value = + 'SysvarStakeHistory1111111111111111111111111' as Address<'SysvarStakeHistory1111111111111111111111111'>; + } const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted'); return Object.freeze({ @@ -191,13 +197,13 @@ export type ParsedMergeInstruction< > = { programAddress: Address; accounts: { - /** Destination stake account */ + /** Destination stake account for the merge */ destinationStake: TAccountMetas[0]; - /** Source stake account */ + /** Source stake account for to merge. This account will be drained */ sourceStake: TAccountMetas[1]; /** Clock sysvar */ clockSysvar: TAccountMetas[2]; - /** Stake history sysvar */ + /** Stake history sysvar that carries stake warmup/cooldown history */ stakeHistory: TAccountMetas[3]; /** Stake authority */ stakeAuthority: TAccountMetas[4]; diff --git a/clients/js/src/generated/instructions/setLockup.ts b/clients/js/src/generated/instructions/setLockup.ts index 1e082f68..18dc14b1 100644 --- a/clients/js/src/generated/instructions/setLockup.ts +++ b/clients/js/src/generated/instructions/setLockup.ts @@ -10,16 +10,12 @@ import { combineCodec, getAddressDecoder, getAddressEncoder, - getI64Decoder, - getI64Encoder, getOptionDecoder, getOptionEncoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, - getU64Decoder, - getU64Encoder, transformEncoder, type AccountMeta, type AccountSignerMeta, @@ -39,6 +35,16 @@ import { } from '@solana/kit'; import { STAKE_PROGRAM_ADDRESS } from '../programs'; import { getAccountMetaFactory, type ResolvedAccount } from '../shared'; +import { + getEpochDecoder, + getEpochEncoder, + getUnixTimestampDecoder, + getUnixTimestampEncoder, + type Epoch, + type EpochArgs, + type UnixTimestamp, + type UnixTimestampArgs, +} from '../types'; export const SET_LOCKUP_DISCRIMINATOR = 6; @@ -68,14 +74,14 @@ export type SetLockupInstruction< export type SetLockupInstructionData = { discriminator: number; - unixTimestamp: Option; - epoch: Option; + unixTimestamp: Option; + epoch: Option; custodian: Option
; }; export type SetLockupInstructionDataArgs = { - unixTimestamp: OptionOrNullable; - epoch: OptionOrNullable; + unixTimestamp: OptionOrNullable; + epoch: OptionOrNullable; custodian: OptionOrNullable
; }; @@ -83,8 +89,8 @@ export function getSetLockupInstructionDataEncoder(): Encoder ({ ...value, discriminator: SET_LOCKUP_DISCRIMINATOR }) @@ -94,8 +100,8 @@ export function getSetLockupInstructionDataEncoder(): Encoder { return getStructDecoder([ ['discriminator', getU32Decoder()], - ['unixTimestamp', getOptionDecoder(getI64Decoder())], - ['epoch', getOptionDecoder(getU64Decoder())], + ['unixTimestamp', getOptionDecoder(getUnixTimestampDecoder())], + ['epoch', getOptionDecoder(getEpochDecoder())], ['custodian', getOptionDecoder(getAddressDecoder())], ]); } diff --git a/clients/js/src/generated/instructions/setLockupChecked.ts b/clients/js/src/generated/instructions/setLockupChecked.ts index 12aea9b8..7256b7ad 100644 --- a/clients/js/src/generated/instructions/setLockupChecked.ts +++ b/clients/js/src/generated/instructions/setLockupChecked.ts @@ -8,16 +8,12 @@ import { combineCodec, - getI64Decoder, - getI64Encoder, getOptionDecoder, getOptionEncoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, - getU64Decoder, - getU64Encoder, transformEncoder, type AccountMeta, type AccountSignerMeta, @@ -37,6 +33,16 @@ import { } from '@solana/kit'; import { STAKE_PROGRAM_ADDRESS } from '../programs'; import { getAccountMetaFactory, type ResolvedAccount } from '../shared'; +import { + getEpochDecoder, + getEpochEncoder, + getUnixTimestampDecoder, + getUnixTimestampEncoder, + type Epoch, + type EpochArgs, + type UnixTimestamp, + type UnixTimestampArgs, +} from '../types'; export const SET_LOCKUP_CHECKED_DISCRIMINATOR = 12; @@ -78,21 +84,21 @@ export type SetLockupCheckedInstruction< export type SetLockupCheckedInstructionData = { discriminator: number; - unixTimestamp: Option; - epoch: Option; + unixTimestamp: Option; + epoch: Option; }; export type SetLockupCheckedInstructionDataArgs = { - unixTimestamp: OptionOrNullable; - epoch: OptionOrNullable; + unixTimestamp: OptionOrNullable; + epoch: OptionOrNullable; }; export function getSetLockupCheckedInstructionDataEncoder(): Encoder { return transformEncoder( getStructEncoder([ ['discriminator', getU32Encoder()], - ['unixTimestamp', getOptionEncoder(getI64Encoder())], - ['epoch', getOptionEncoder(getU64Encoder())], + ['unixTimestamp', getOptionEncoder(getUnixTimestampEncoder())], + ['epoch', getOptionEncoder(getEpochEncoder())], ]), (value) => ({ ...value, discriminator: SET_LOCKUP_CHECKED_DISCRIMINATOR }) ); @@ -101,8 +107,8 @@ export function getSetLockupCheckedInstructionDataEncoder(): Encoder { return getStructDecoder([ ['discriminator', getU32Decoder()], - ['unixTimestamp', getOptionDecoder(getI64Decoder())], - ['epoch', getOptionDecoder(getU64Decoder())], + ['unixTimestamp', getOptionDecoder(getUnixTimestampDecoder())], + ['epoch', getOptionDecoder(getEpochDecoder())], ]); } diff --git a/clients/js/src/generated/instructions/split.ts b/clients/js/src/generated/instructions/split.ts index a01549bf..7095c7a3 100644 --- a/clients/js/src/generated/instructions/split.ts +++ b/clients/js/src/generated/instructions/split.ts @@ -98,9 +98,9 @@ export type SplitInput< TAccountSplitStake extends string = string, TAccountStakeAuthority extends string = string, > = { - /** Stake account to be split */ + /** Stake account to be split; must be in the Initialized or Stake state */ stake: Address; - /** Uninitialized stake account */ + /** Uninitialized stake account that will take the split-off amount */ splitStake: Address; /** Stake authority */ stakeAuthority: TransactionSigner; @@ -163,9 +163,9 @@ export type ParsedSplitInstruction< > = { programAddress: Address; accounts: { - /** Stake account to be split */ + /** Stake account to be split; must be in the Initialized or Stake state */ stake: TAccountMetas[0]; - /** Uninitialized stake account */ + /** Uninitialized stake account that will take the split-off amount */ splitStake: TAccountMetas[1]; /** Stake authority */ stakeAuthority: TAccountMetas[2]; diff --git a/clients/js/src/generated/instructions/withdraw.ts b/clients/js/src/generated/instructions/withdraw.ts index f48b433a..e19c0b77 100644 --- a/clients/js/src/generated/instructions/withdraw.ts +++ b/clients/js/src/generated/instructions/withdraw.ts @@ -46,7 +46,9 @@ export type WithdrawInstruction< TAccountClockSysvar extends | string | AccountMeta = 'SysvarC1ock11111111111111111111111111111111', - TAccountStakeHistory extends string | AccountMeta = string, + TAccountStakeHistory extends + | string + | AccountMeta = 'SysvarStakeHistory1111111111111111111111111', TAccountWithdrawAuthority extends string | AccountMeta = string, TAccountLockupAuthority extends | string @@ -130,11 +132,11 @@ export type WithdrawInput< recipient: Address; /** Clock sysvar */ clockSysvar?: Address; - /** Stake history sysvar */ - stakeHistory: Address; + /** Stake history sysvar that carries stake warmup/cooldown history */ + stakeHistory?: Address; /** Withdraw authority */ withdrawAuthority: TransactionSigner; - /** Lockup authority */ + /** Lockup authority, if before lockup expiration */ lockupAuthority?: TransactionSigner; args: WithdrawInstructionDataArgs['args']; }; @@ -197,6 +199,10 @@ export function getWithdrawInstruction< accounts.clockSysvar.value = 'SysvarC1ock11111111111111111111111111111111' as Address<'SysvarC1ock11111111111111111111111111111111'>; } + if (!accounts.stakeHistory.value) { + accounts.stakeHistory.value = + 'SysvarStakeHistory1111111111111111111111111' as Address<'SysvarStakeHistory1111111111111111111111111'>; + } const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted'); return Object.freeze({ @@ -235,11 +241,11 @@ export type ParsedWithdrawInstruction< recipient: TAccountMetas[1]; /** Clock sysvar */ clockSysvar: TAccountMetas[2]; - /** Stake history sysvar */ + /** Stake history sysvar that carries stake warmup/cooldown history */ stakeHistory: TAccountMetas[3]; /** Withdraw authority */ withdrawAuthority: TAccountMetas[4]; - /** Lockup authority */ + /** Lockup authority, if before lockup expiration */ lockupAuthority?: TAccountMetas[5] | undefined; }; data: WithdrawInstructionData; diff --git a/clients/js/src/generated/types/delegation.ts b/clients/js/src/generated/types/delegation.ts index 0e50a564..f9c7acbf 100644 --- a/clients/js/src/generated/types/delegation.ts +++ b/clients/js/src/generated/types/delegation.ts @@ -21,20 +21,26 @@ import { type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; +import { + getEpochDecoder, + getEpochEncoder, + type Epoch, + type EpochArgs, +} from '.'; export type Delegation = { voterPubkey: Address; stake: bigint; - activationEpoch: bigint; - deactivationEpoch: bigint; + activationEpoch: Epoch; + deactivationEpoch: Epoch; warmupCooldownRate: number; }; export type DelegationArgs = { voterPubkey: Address; stake: number | bigint; - activationEpoch: number | bigint; - deactivationEpoch: number | bigint; + activationEpoch: EpochArgs; + deactivationEpoch: EpochArgs; warmupCooldownRate: number; }; @@ -42,8 +48,8 @@ export function getDelegationEncoder(): FixedSizeEncoder { return getStructEncoder([ ['voterPubkey', getAddressEncoder()], ['stake', getU64Encoder()], - ['activationEpoch', getU64Encoder()], - ['deactivationEpoch', getU64Encoder()], + ['activationEpoch', getEpochEncoder()], + ['deactivationEpoch', getEpochEncoder()], ['warmupCooldownRate', getF64Encoder()], ]); } @@ -52,8 +58,8 @@ export function getDelegationDecoder(): FixedSizeDecoder { return getStructDecoder([ ['voterPubkey', getAddressDecoder()], ['stake', getU64Decoder()], - ['activationEpoch', getU64Decoder()], - ['deactivationEpoch', getU64Decoder()], + ['activationEpoch', getEpochDecoder()], + ['deactivationEpoch', getEpochDecoder()], ['warmupCooldownRate', getF64Decoder()], ]); } diff --git a/clients/js/src/generated/types/epoch.ts b/clients/js/src/generated/types/epoch.ts new file mode 100644 index 00000000..5ab8fd61 --- /dev/null +++ b/clients/js/src/generated/types/epoch.ts @@ -0,0 +1,32 @@ +/** + * This code was AUTOGENERATED using the Codama library. + * Please DO NOT EDIT THIS FILE, instead use visitors + * to add features, then rerun Codama to update it. + * + * @see https://github.com/codama-idl/codama + */ + +import { + combineCodec, + getU64Decoder, + getU64Encoder, + type FixedSizeCodec, + type FixedSizeDecoder, + type FixedSizeEncoder, +} from '@solana/kit'; + +export type Epoch = bigint; + +export type EpochArgs = number | bigint; + +export function getEpochEncoder(): FixedSizeEncoder { + return getU64Encoder(); +} + +export function getEpochDecoder(): FixedSizeDecoder { + return getU64Decoder(); +} + +export function getEpochCodec(): FixedSizeCodec { + return combineCodec(getEpochEncoder(), getEpochDecoder()); +} diff --git a/clients/js/src/generated/types/index.ts b/clients/js/src/generated/types/index.ts index edb794d1..7fd6869d 100644 --- a/clients/js/src/generated/types/index.ts +++ b/clients/js/src/generated/types/index.ts @@ -8,6 +8,7 @@ export * from './authorized'; export * from './delegation'; +export * from './epoch'; export * from './lockup'; export * from './meta'; export * from './stake'; @@ -15,3 +16,4 @@ export * from './stakeAuthorize'; export * from './stakeFlags'; export * from './stakeState'; export * from './stakeStateV2'; +export * from './unixTimestamp'; diff --git a/clients/js/src/generated/types/lockup.ts b/clients/js/src/generated/types/lockup.ts index 3d3a5343..debab244 100644 --- a/clients/js/src/generated/types/lockup.ts +++ b/clients/js/src/generated/types/lockup.ts @@ -10,42 +10,48 @@ import { combineCodec, getAddressDecoder, getAddressEncoder, - getI64Decoder, - getI64Encoder, getStructDecoder, getStructEncoder, - getU64Decoder, - getU64Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; +import { + getEpochDecoder, + getEpochEncoder, + getUnixTimestampDecoder, + getUnixTimestampEncoder, + type Epoch, + type EpochArgs, + type UnixTimestamp, + type UnixTimestampArgs, +} from '.'; export type Lockup = { - unixTimestamp: bigint; - epoch: bigint; + unixTimestamp: UnixTimestamp; + epoch: Epoch; custodian: Address; }; export type LockupArgs = { - unixTimestamp: number | bigint; - epoch: number | bigint; + unixTimestamp: UnixTimestampArgs; + epoch: EpochArgs; custodian: Address; }; export function getLockupEncoder(): FixedSizeEncoder { return getStructEncoder([ - ['unixTimestamp', getI64Encoder()], - ['epoch', getU64Encoder()], + ['unixTimestamp', getUnixTimestampEncoder()], + ['epoch', getEpochEncoder()], ['custodian', getAddressEncoder()], ]); } export function getLockupDecoder(): FixedSizeDecoder { return getStructDecoder([ - ['unixTimestamp', getI64Decoder()], - ['epoch', getU64Decoder()], + ['unixTimestamp', getUnixTimestampDecoder()], + ['epoch', getEpochDecoder()], ['custodian', getAddressDecoder()], ]); } diff --git a/clients/js/src/generated/types/unixTimestamp.ts b/clients/js/src/generated/types/unixTimestamp.ts new file mode 100644 index 00000000..7b9daeb5 --- /dev/null +++ b/clients/js/src/generated/types/unixTimestamp.ts @@ -0,0 +1,35 @@ +/** + * This code was AUTOGENERATED using the Codama library. + * Please DO NOT EDIT THIS FILE, instead use visitors + * to add features, then rerun Codama to update it. + * + * @see https://github.com/codama-idl/codama + */ + +import { + combineCodec, + getI64Decoder, + getI64Encoder, + type FixedSizeCodec, + type FixedSizeDecoder, + type FixedSizeEncoder, +} from '@solana/kit'; + +export type UnixTimestamp = bigint; + +export type UnixTimestampArgs = number | bigint; + +export function getUnixTimestampEncoder(): FixedSizeEncoder { + return getI64Encoder(); +} + +export function getUnixTimestampDecoder(): FixedSizeDecoder { + return getI64Decoder(); +} + +export function getUnixTimestampCodec(): FixedSizeCodec< + UnixTimestampArgs, + UnixTimestamp +> { + return combineCodec(getUnixTimestampEncoder(), getUnixTimestampDecoder()); +} diff --git a/clients/rust/Cargo.toml b/clients/rust/Cargo.toml index debc9be8..2419fefa 100644 --- a/clients/rust/Cargo.toml +++ b/clients/rust/Cargo.toml @@ -11,12 +11,16 @@ license-file = "../../LICENSE" serde = ["dep:serde", "dep:serde_with"] [dependencies] -borsh = "1.5" +borsh = { version = "1.5", features = ["derive"] } num-derive = "0.4" num-traits = "0.2" serde = { version = "1.0", features = ["derive"], optional = true } serde_with = { version = "3.15", optional = true } -solana-program = "2.2.1" +solana-account-info = "^3.0" +solana-cpi = "^3.0" +solana-instruction = "^3.0" +solana-program-error = "^3.0" +solana-pubkey = { version = "^3.0", features = ["borsh", "serde"] } thiserror = "2.0" [dev-dependencies] diff --git a/clients/rust/src/generated/errors/stake.rs b/clients/rust/src/generated/errors/stake.rs index cae66e42..068f5267 100644 --- a/clients/rust/src/generated/errors/stake.rs +++ b/clients/rust/src/generated/errors/stake.rs @@ -64,14 +64,8 @@ pub enum StakeError { EpochRewardsActive = 0x10, } -impl solana_program::program_error::PrintProgramError for StakeError { - fn print(&self) { - solana_program::msg!(&self.to_string()); - } -} - -impl solana_program::decode_error::DecodeError for StakeError { - fn type_of() -> &'static str { - "StakeError" +impl From for solana_program_error::ProgramError { + fn from(e: StakeError) -> Self { + solana_program_error::ProgramError::Custom(e as u32) } } diff --git a/clients/rust/src/generated/instructions/authorize.rs b/clients/rust/src/generated/instructions/authorize.rs index 2231c750..2ad2add7 100644 --- a/clients/rust/src/generated/instructions/authorize.rs +++ b/clients/rust/src/generated/instructions/authorize.rs @@ -8,59 +8,57 @@ use { crate::generated::types::StakeAuthorize, borsh::{BorshDeserialize, BorshSerialize}, - solana_program::pubkey::Pubkey, + solana_pubkey::Pubkey, }; +pub const AUTHORIZE_DISCRIMINATOR: u32 = 1; + /// Accounts. #[derive(Debug)] pub struct Authorize { /// Stake account to be updated - pub stake: solana_program::pubkey::Pubkey, + pub stake: solana_pubkey::Pubkey, /// Clock sysvar - pub clock_sysvar: solana_program::pubkey::Pubkey, - /// Stake or withdraw authority - pub authority: solana_program::pubkey::Pubkey, - /// Lockup authority - pub lockup_authority: Option, + pub clock_sysvar: solana_pubkey::Pubkey, + /// The stake or withdraw authority + pub authority: solana_pubkey::Pubkey, + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration + pub lockup_authority: Option, } impl Authorize { - pub fn instruction( - &self, - args: AuthorizeInstructionArgs, - ) -> solana_program::instruction::Instruction { + pub fn instruction(&self, args: AuthorizeInstructionArgs) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(args, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, args: AuthorizeInstructionArgs, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(4 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - self.stake, false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(self.stake, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( self.clock_sysvar, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.authority, true, )); if let Some(lockup_authority) = self.lockup_authority { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( lockup_authority, true, )); } accounts.extend_from_slice(remaining_accounts); - let mut data = borsh::to_vec(&AuthorizeInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&args).unwrap(); + let mut data = AuthorizeInstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); data.append(&mut args); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -78,6 +76,10 @@ impl AuthorizeInstructionData { pub fn new() -> Self { Self { discriminator: 1 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for AuthorizeInstructionData { @@ -93,6 +95,12 @@ pub struct AuthorizeInstructionArgs { pub arg1: StakeAuthorize, } +impl AuthorizeInstructionArgs { + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } +} + /// Instruction builder for `Authorize`. /// /// ### Accounts: @@ -103,13 +111,13 @@ pub struct AuthorizeInstructionArgs { /// 3. `[signer, optional]` lockup_authority #[derive(Clone, Debug, Default)] pub struct AuthorizeBuilder { - stake: Option, - clock_sysvar: Option, - authority: Option, - lockup_authority: Option, + stake: Option, + clock_sysvar: Option, + authority: Option, + lockup_authority: Option, arg0: Option, arg1: Option, - __remaining_accounts: Vec, + __remaining_accounts: Vec, } impl AuthorizeBuilder { @@ -118,29 +126,29 @@ impl AuthorizeBuilder { } /// Stake account to be updated #[inline(always)] - pub fn stake(&mut self, stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake(&mut self, stake: solana_pubkey::Pubkey) -> &mut Self { self.stake = Some(stake); self } /// `[optional account, default to 'SysvarC1ock11111111111111111111111111111111']` /// Clock sysvar #[inline(always)] - pub fn clock_sysvar(&mut self, clock_sysvar: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn clock_sysvar(&mut self, clock_sysvar: solana_pubkey::Pubkey) -> &mut Self { self.clock_sysvar = Some(clock_sysvar); self } - /// Stake or withdraw authority + /// The stake or withdraw authority #[inline(always)] - pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn authority(&mut self, authority: solana_pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } /// `[optional account]` - /// Lockup authority + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration #[inline(always)] pub fn lockup_authority( &mut self, - lockup_authority: Option, + lockup_authority: Option, ) -> &mut Self { self.lockup_authority = lockup_authority; self @@ -157,10 +165,7 @@ impl AuthorizeBuilder { } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -168,16 +173,16 @@ impl AuthorizeBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = Authorize { stake: self.stake.expect("stake is not set"), - clock_sysvar: self.clock_sysvar.unwrap_or(solana_program::pubkey!( + clock_sysvar: self.clock_sysvar.unwrap_or(solana_pubkey::pubkey!( "SysvarC1ock11111111111111111111111111111111" )), authority: self.authority.expect("authority is not set"), @@ -195,34 +200,34 @@ impl AuthorizeBuilder { /// `authorize` CPI accounts. pub struct AuthorizeCpiAccounts<'a, 'b> { /// Stake account to be updated - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, - /// Stake or withdraw authority - pub authority: &'b solana_program::account_info::AccountInfo<'a>, - /// Lockup authority - pub lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, + /// The stake or withdraw authority + pub authority: &'b solana_account_info::AccountInfo<'a>, + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration + pub lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, } /// `authorize` CPI instruction. pub struct AuthorizeCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, /// Stake account to be updated - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, - /// Stake or withdraw authority - pub authority: &'b solana_program::account_info::AccountInfo<'a>, - /// Lockup authority - pub lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, + /// The stake or withdraw authority + pub authority: &'b solana_account_info::AccountInfo<'a>, + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration + pub lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, /// The arguments for the instruction. pub __args: AuthorizeInstructionArgs, } impl<'a, 'b> AuthorizeCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: AuthorizeCpiAccounts<'a, 'b>, args: AuthorizeInstructionArgs, ) -> Self { @@ -236,69 +241,56 @@ impl<'a, 'b> AuthorizeCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(4 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - *self.stake.key, - false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(*self.stake.key, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.clock_sysvar.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.authority.key, true, )); if let Some(lockup_authority) = self.lockup_authority { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *lockup_authority.key, true, )); } remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let mut data = borsh::to_vec(&AuthorizeInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&self.__args).unwrap(); + let mut data = AuthorizeInstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); data.append(&mut args); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -316,9 +308,9 @@ impl<'a, 'b> AuthorizeCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -337,7 +329,7 @@ pub struct AuthorizeCpiBuilder<'a, 'b> { } impl<'a, 'b> AuthorizeCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(AuthorizeCpiBuilderInstruction { __program: program, stake: None, @@ -352,7 +344,7 @@ impl<'a, 'b> AuthorizeCpiBuilder<'a, 'b> { } /// Stake account to be updated #[inline(always)] - pub fn stake(&mut self, stake: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn stake(&mut self, stake: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.stake = Some(stake); self } @@ -360,26 +352,23 @@ impl<'a, 'b> AuthorizeCpiBuilder<'a, 'b> { #[inline(always)] pub fn clock_sysvar( &mut self, - clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + clock_sysvar: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.clock_sysvar = Some(clock_sysvar); self } - /// Stake or withdraw authority + /// The stake or withdraw authority #[inline(always)] - pub fn authority( - &mut self, - authority: &'b solana_program::account_info::AccountInfo<'a>, - ) -> &mut Self { + pub fn authority(&mut self, authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.authority = Some(authority); self } /// `[optional account]` - /// Lockup authority + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration #[inline(always)] pub fn lockup_authority( &mut self, - lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, ) -> &mut Self { self.instruction.lockup_authority = lockup_authority; self @@ -398,7 +387,7 @@ impl<'a, 'b> AuthorizeCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -414,11 +403,7 @@ impl<'a, 'b> AuthorizeCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -426,15 +411,12 @@ impl<'a, 'b> AuthorizeCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let args = AuthorizeInstructionArgs { arg0: self.instruction.arg0.clone().expect("arg0 is not set"), arg1: self.instruction.arg1.clone().expect("arg1 is not set"), @@ -463,17 +445,13 @@ impl<'a, 'b> AuthorizeCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct AuthorizeCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - clock_sysvar: Option<&'b solana_program::account_info::AccountInfo<'a>>, - authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, - lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + __program: &'b solana_account_info::AccountInfo<'a>, + stake: Option<&'b solana_account_info::AccountInfo<'a>>, + clock_sysvar: Option<&'b solana_account_info::AccountInfo<'a>>, + authority: Option<&'b solana_account_info::AccountInfo<'a>>, + lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, arg0: Option, arg1: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/authorize_checked.rs b/clients/rust/src/generated/instructions/authorize_checked.rs index 62476187..70873adf 100644 --- a/clients/rust/src/generated/instructions/authorize_checked.rs +++ b/clients/rust/src/generated/instructions/authorize_checked.rs @@ -10,62 +10,63 @@ use { borsh::{BorshDeserialize, BorshSerialize}, }; +pub const AUTHORIZE_CHECKED_DISCRIMINATOR: u32 = 10; + /// Accounts. #[derive(Debug)] pub struct AuthorizeChecked { /// Stake account to be updated - pub stake: solana_program::pubkey::Pubkey, + pub stake: solana_pubkey::Pubkey, /// Clock sysvar - pub clock_sysvar: solana_program::pubkey::Pubkey, + pub clock_sysvar: solana_pubkey::Pubkey, /// The stake or withdraw authority - pub authority: solana_program::pubkey::Pubkey, + pub authority: solana_pubkey::Pubkey, /// The new stake or withdraw authority - pub new_authority: solana_program::pubkey::Pubkey, - /// Lockup authority - pub lockup_authority: Option, + pub new_authority: solana_pubkey::Pubkey, + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration + pub lockup_authority: Option, } impl AuthorizeChecked { pub fn instruction( &self, args: AuthorizeCheckedInstructionArgs, - ) -> solana_program::instruction::Instruction { + ) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(args, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, args: AuthorizeCheckedInstructionArgs, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(5 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - self.stake, false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(self.stake, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( self.clock_sysvar, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.authority, true, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.new_authority, true, )); if let Some(lockup_authority) = self.lockup_authority { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( lockup_authority, true, )); } accounts.extend_from_slice(remaining_accounts); - let mut data = borsh::to_vec(&AuthorizeCheckedInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&args).unwrap(); + let mut data = AuthorizeCheckedInstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); data.append(&mut args); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -83,6 +84,10 @@ impl AuthorizeCheckedInstructionData { pub fn new() -> Self { Self { discriminator: 10 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for AuthorizeCheckedInstructionData { @@ -97,6 +102,12 @@ pub struct AuthorizeCheckedInstructionArgs { pub stake_authorize: StakeAuthorize, } +impl AuthorizeCheckedInstructionArgs { + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } +} + /// Instruction builder for `AuthorizeChecked`. /// /// ### Accounts: @@ -108,13 +119,13 @@ pub struct AuthorizeCheckedInstructionArgs { /// 4. `[signer, optional]` lockup_authority #[derive(Clone, Debug, Default)] pub struct AuthorizeCheckedBuilder { - stake: Option, - clock_sysvar: Option, - authority: Option, - new_authority: Option, - lockup_authority: Option, + stake: Option, + clock_sysvar: Option, + authority: Option, + new_authority: Option, + lockup_authority: Option, stake_authorize: Option, - __remaining_accounts: Vec, + __remaining_accounts: Vec, } impl AuthorizeCheckedBuilder { @@ -123,35 +134,35 @@ impl AuthorizeCheckedBuilder { } /// Stake account to be updated #[inline(always)] - pub fn stake(&mut self, stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake(&mut self, stake: solana_pubkey::Pubkey) -> &mut Self { self.stake = Some(stake); self } /// `[optional account, default to 'SysvarC1ock11111111111111111111111111111111']` /// Clock sysvar #[inline(always)] - pub fn clock_sysvar(&mut self, clock_sysvar: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn clock_sysvar(&mut self, clock_sysvar: solana_pubkey::Pubkey) -> &mut Self { self.clock_sysvar = Some(clock_sysvar); self } /// The stake or withdraw authority #[inline(always)] - pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn authority(&mut self, authority: solana_pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } /// The new stake or withdraw authority #[inline(always)] - pub fn new_authority(&mut self, new_authority: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn new_authority(&mut self, new_authority: solana_pubkey::Pubkey) -> &mut Self { self.new_authority = Some(new_authority); self } /// `[optional account]` - /// Lockup authority + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration #[inline(always)] pub fn lockup_authority( &mut self, - lockup_authority: Option, + lockup_authority: Option, ) -> &mut Self { self.lockup_authority = lockup_authority; self @@ -163,10 +174,7 @@ impl AuthorizeCheckedBuilder { } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -174,16 +182,16 @@ impl AuthorizeCheckedBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = AuthorizeChecked { stake: self.stake.expect("stake is not set"), - clock_sysvar: self.clock_sysvar.unwrap_or(solana_program::pubkey!( + clock_sysvar: self.clock_sysvar.unwrap_or(solana_pubkey::pubkey!( "SysvarC1ock11111111111111111111111111111111" )), authority: self.authority.expect("authority is not set"), @@ -204,38 +212,38 @@ impl AuthorizeCheckedBuilder { /// `authorize_checked` CPI accounts. pub struct AuthorizeCheckedCpiAccounts<'a, 'b> { /// Stake account to be updated - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, /// The stake or withdraw authority - pub authority: &'b solana_program::account_info::AccountInfo<'a>, + pub authority: &'b solana_account_info::AccountInfo<'a>, /// The new stake or withdraw authority - pub new_authority: &'b solana_program::account_info::AccountInfo<'a>, - /// Lockup authority - pub lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + pub new_authority: &'b solana_account_info::AccountInfo<'a>, + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration + pub lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, } /// `authorize_checked` CPI instruction. pub struct AuthorizeCheckedCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, /// Stake account to be updated - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, /// The stake or withdraw authority - pub authority: &'b solana_program::account_info::AccountInfo<'a>, + pub authority: &'b solana_account_info::AccountInfo<'a>, /// The new stake or withdraw authority - pub new_authority: &'b solana_program::account_info::AccountInfo<'a>, - /// Lockup authority - pub lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + pub new_authority: &'b solana_account_info::AccountInfo<'a>, + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration + pub lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, /// The arguments for the instruction. pub __args: AuthorizeCheckedInstructionArgs, } impl<'a, 'b> AuthorizeCheckedCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: AuthorizeCheckedCpiAccounts<'a, 'b>, args: AuthorizeCheckedInstructionArgs, ) -> Self { @@ -250,73 +258,60 @@ impl<'a, 'b> AuthorizeCheckedCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(5 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - *self.stake.key, - false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(*self.stake.key, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.clock_sysvar.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.authority.key, true, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.new_authority.key, true, )); if let Some(lockup_authority) = self.lockup_authority { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *lockup_authority.key, true, )); } remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let mut data = borsh::to_vec(&AuthorizeCheckedInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&self.__args).unwrap(); + let mut data = AuthorizeCheckedInstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); data.append(&mut args); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -335,9 +330,9 @@ impl<'a, 'b> AuthorizeCheckedCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -357,7 +352,7 @@ pub struct AuthorizeCheckedCpiBuilder<'a, 'b> { } impl<'a, 'b> AuthorizeCheckedCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(AuthorizeCheckedCpiBuilderInstruction { __program: program, stake: None, @@ -372,7 +367,7 @@ impl<'a, 'b> AuthorizeCheckedCpiBuilder<'a, 'b> { } /// Stake account to be updated #[inline(always)] - pub fn stake(&mut self, stake: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn stake(&mut self, stake: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.stake = Some(stake); self } @@ -380,17 +375,14 @@ impl<'a, 'b> AuthorizeCheckedCpiBuilder<'a, 'b> { #[inline(always)] pub fn clock_sysvar( &mut self, - clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + clock_sysvar: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.clock_sysvar = Some(clock_sysvar); self } /// The stake or withdraw authority #[inline(always)] - pub fn authority( - &mut self, - authority: &'b solana_program::account_info::AccountInfo<'a>, - ) -> &mut Self { + pub fn authority(&mut self, authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.authority = Some(authority); self } @@ -398,17 +390,17 @@ impl<'a, 'b> AuthorizeCheckedCpiBuilder<'a, 'b> { #[inline(always)] pub fn new_authority( &mut self, - new_authority: &'b solana_program::account_info::AccountInfo<'a>, + new_authority: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.new_authority = Some(new_authority); self } /// `[optional account]` - /// Lockup authority + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration #[inline(always)] pub fn lockup_authority( &mut self, - lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, ) -> &mut Self { self.instruction.lockup_authority = lockup_authority; self @@ -422,7 +414,7 @@ impl<'a, 'b> AuthorizeCheckedCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -438,11 +430,7 @@ impl<'a, 'b> AuthorizeCheckedCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -450,15 +438,12 @@ impl<'a, 'b> AuthorizeCheckedCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let args = AuthorizeCheckedInstructionArgs { stake_authorize: self .instruction @@ -495,17 +480,13 @@ impl<'a, 'b> AuthorizeCheckedCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct AuthorizeCheckedCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - clock_sysvar: Option<&'b solana_program::account_info::AccountInfo<'a>>, - authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, - new_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, - lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + __program: &'b solana_account_info::AccountInfo<'a>, + stake: Option<&'b solana_account_info::AccountInfo<'a>>, + clock_sysvar: Option<&'b solana_account_info::AccountInfo<'a>>, + authority: Option<&'b solana_account_info::AccountInfo<'a>>, + new_authority: Option<&'b solana_account_info::AccountInfo<'a>>, + lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, stake_authorize: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/authorize_checked_with_seed.rs b/clients/rust/src/generated/instructions/authorize_checked_with_seed.rs index d408063d..bdb7629c 100644 --- a/clients/rust/src/generated/instructions/authorize_checked_with_seed.rs +++ b/clients/rust/src/generated/instructions/authorize_checked_with_seed.rs @@ -8,64 +8,67 @@ use { crate::generated::types::StakeAuthorize, borsh::{BorshDeserialize, BorshSerialize}, - solana_program::pubkey::Pubkey, + solana_pubkey::Pubkey, }; +pub const AUTHORIZE_CHECKED_WITH_SEED_DISCRIMINATOR: u32 = 11; + /// Accounts. #[derive(Debug)] pub struct AuthorizeCheckedWithSeed { /// Stake account to be updated - pub stake: solana_program::pubkey::Pubkey, + pub stake: solana_pubkey::Pubkey, /// Base key of stake or withdraw authority - pub base: solana_program::pubkey::Pubkey, + pub base: solana_pubkey::Pubkey, /// Clock sysvar - pub clock_sysvar: solana_program::pubkey::Pubkey, + pub clock_sysvar: solana_pubkey::Pubkey, /// The new stake or withdraw authority - pub new_authority: solana_program::pubkey::Pubkey, - /// Lockup authority - pub lockup_authority: Option, + pub new_authority: solana_pubkey::Pubkey, + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration + pub lockup_authority: Option, } impl AuthorizeCheckedWithSeed { pub fn instruction( &self, args: AuthorizeCheckedWithSeedInstructionArgs, - ) -> solana_program::instruction::Instruction { + ) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(args, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, args: AuthorizeCheckedWithSeedInstructionArgs, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(5 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - self.stake, false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(self.stake, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( self.base, true, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.clock_sysvar, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.new_authority, true, )); if let Some(lockup_authority) = self.lockup_authority { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( lockup_authority, true, )); } accounts.extend_from_slice(remaining_accounts); - let mut data = borsh::to_vec(&AuthorizeCheckedWithSeedInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&args).unwrap(); + let mut data = AuthorizeCheckedWithSeedInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); data.append(&mut args); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -83,6 +86,10 @@ impl AuthorizeCheckedWithSeedInstructionData { pub fn new() -> Self { Self { discriminator: 11 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for AuthorizeCheckedWithSeedInstructionData { @@ -99,6 +106,12 @@ pub struct AuthorizeCheckedWithSeedInstructionArgs { pub authority_owner: Pubkey, } +impl AuthorizeCheckedWithSeedInstructionArgs { + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } +} + /// Instruction builder for `AuthorizeCheckedWithSeed`. /// /// ### Accounts: @@ -110,15 +123,15 @@ pub struct AuthorizeCheckedWithSeedInstructionArgs { /// 4. `[signer, optional]` lockup_authority #[derive(Clone, Debug, Default)] pub struct AuthorizeCheckedWithSeedBuilder { - stake: Option, - base: Option, - clock_sysvar: Option, - new_authority: Option, - lockup_authority: Option, + stake: Option, + base: Option, + clock_sysvar: Option, + new_authority: Option, + lockup_authority: Option, stake_authorize: Option, authority_seed: Option, authority_owner: Option, - __remaining_accounts: Vec, + __remaining_accounts: Vec, } impl AuthorizeCheckedWithSeedBuilder { @@ -127,35 +140,35 @@ impl AuthorizeCheckedWithSeedBuilder { } /// Stake account to be updated #[inline(always)] - pub fn stake(&mut self, stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake(&mut self, stake: solana_pubkey::Pubkey) -> &mut Self { self.stake = Some(stake); self } /// Base key of stake or withdraw authority #[inline(always)] - pub fn base(&mut self, base: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn base(&mut self, base: solana_pubkey::Pubkey) -> &mut Self { self.base = Some(base); self } /// `[optional account, default to 'SysvarC1ock11111111111111111111111111111111']` /// Clock sysvar #[inline(always)] - pub fn clock_sysvar(&mut self, clock_sysvar: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn clock_sysvar(&mut self, clock_sysvar: solana_pubkey::Pubkey) -> &mut Self { self.clock_sysvar = Some(clock_sysvar); self } /// The new stake or withdraw authority #[inline(always)] - pub fn new_authority(&mut self, new_authority: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn new_authority(&mut self, new_authority: solana_pubkey::Pubkey) -> &mut Self { self.new_authority = Some(new_authority); self } /// `[optional account]` - /// Lockup authority + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration #[inline(always)] pub fn lockup_authority( &mut self, - lockup_authority: Option, + lockup_authority: Option, ) -> &mut Self { self.lockup_authority = lockup_authority; self @@ -177,10 +190,7 @@ impl AuthorizeCheckedWithSeedBuilder { } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -188,17 +198,17 @@ impl AuthorizeCheckedWithSeedBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = AuthorizeCheckedWithSeed { stake: self.stake.expect("stake is not set"), base: self.base.expect("base is not set"), - clock_sysvar: self.clock_sysvar.unwrap_or(solana_program::pubkey!( + clock_sysvar: self.clock_sysvar.unwrap_or(solana_pubkey::pubkey!( "SysvarC1ock11111111111111111111111111111111" )), new_authority: self.new_authority.expect("new_authority is not set"), @@ -226,38 +236,38 @@ impl AuthorizeCheckedWithSeedBuilder { /// `authorize_checked_with_seed` CPI accounts. pub struct AuthorizeCheckedWithSeedCpiAccounts<'a, 'b> { /// Stake account to be updated - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Base key of stake or withdraw authority - pub base: &'b solana_program::account_info::AccountInfo<'a>, + pub base: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, /// The new stake or withdraw authority - pub new_authority: &'b solana_program::account_info::AccountInfo<'a>, - /// Lockup authority - pub lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + pub new_authority: &'b solana_account_info::AccountInfo<'a>, + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration + pub lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, } /// `authorize_checked_with_seed` CPI instruction. pub struct AuthorizeCheckedWithSeedCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, /// Stake account to be updated - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Base key of stake or withdraw authority - pub base: &'b solana_program::account_info::AccountInfo<'a>, + pub base: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, /// The new stake or withdraw authority - pub new_authority: &'b solana_program::account_info::AccountInfo<'a>, - /// Lockup authority - pub lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + pub new_authority: &'b solana_account_info::AccountInfo<'a>, + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration + pub lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, /// The arguments for the instruction. pub __args: AuthorizeCheckedWithSeedInstructionArgs, } impl<'a, 'b> AuthorizeCheckedWithSeedCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: AuthorizeCheckedWithSeedCpiAccounts<'a, 'b>, args: AuthorizeCheckedWithSeedInstructionArgs, ) -> Self { @@ -272,73 +282,62 @@ impl<'a, 'b> AuthorizeCheckedWithSeedCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(5 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - *self.stake.key, - false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(*self.stake.key, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.base.key, true, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.clock_sysvar.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.new_authority.key, true, )); if let Some(lockup_authority) = self.lockup_authority { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *lockup_authority.key, true, )); } remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let mut data = borsh::to_vec(&AuthorizeCheckedWithSeedInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&self.__args).unwrap(); + let mut data = AuthorizeCheckedWithSeedInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); data.append(&mut args); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -357,9 +356,9 @@ impl<'a, 'b> AuthorizeCheckedWithSeedCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -379,7 +378,7 @@ pub struct AuthorizeCheckedWithSeedCpiBuilder<'a, 'b> { } impl<'a, 'b> AuthorizeCheckedWithSeedCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(AuthorizeCheckedWithSeedCpiBuilderInstruction { __program: program, stake: None, @@ -396,13 +395,13 @@ impl<'a, 'b> AuthorizeCheckedWithSeedCpiBuilder<'a, 'b> { } /// Stake account to be updated #[inline(always)] - pub fn stake(&mut self, stake: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn stake(&mut self, stake: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.stake = Some(stake); self } /// Base key of stake or withdraw authority #[inline(always)] - pub fn base(&mut self, base: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn base(&mut self, base: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.base = Some(base); self } @@ -410,7 +409,7 @@ impl<'a, 'b> AuthorizeCheckedWithSeedCpiBuilder<'a, 'b> { #[inline(always)] pub fn clock_sysvar( &mut self, - clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + clock_sysvar: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.clock_sysvar = Some(clock_sysvar); self @@ -419,17 +418,17 @@ impl<'a, 'b> AuthorizeCheckedWithSeedCpiBuilder<'a, 'b> { #[inline(always)] pub fn new_authority( &mut self, - new_authority: &'b solana_program::account_info::AccountInfo<'a>, + new_authority: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.new_authority = Some(new_authority); self } /// `[optional account]` - /// Lockup authority + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration #[inline(always)] pub fn lockup_authority( &mut self, - lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, ) -> &mut Self { self.instruction.lockup_authority = lockup_authority; self @@ -453,7 +452,7 @@ impl<'a, 'b> AuthorizeCheckedWithSeedCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -469,11 +468,7 @@ impl<'a, 'b> AuthorizeCheckedWithSeedCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -481,15 +476,12 @@ impl<'a, 'b> AuthorizeCheckedWithSeedCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let args = AuthorizeCheckedWithSeedInstructionArgs { stake_authorize: self .instruction @@ -536,19 +528,15 @@ impl<'a, 'b> AuthorizeCheckedWithSeedCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct AuthorizeCheckedWithSeedCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - base: Option<&'b solana_program::account_info::AccountInfo<'a>>, - clock_sysvar: Option<&'b solana_program::account_info::AccountInfo<'a>>, - new_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, - lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + __program: &'b solana_account_info::AccountInfo<'a>, + stake: Option<&'b solana_account_info::AccountInfo<'a>>, + base: Option<&'b solana_account_info::AccountInfo<'a>>, + clock_sysvar: Option<&'b solana_account_info::AccountInfo<'a>>, + new_authority: Option<&'b solana_account_info::AccountInfo<'a>>, + lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, stake_authorize: Option, authority_seed: Option, authority_owner: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/authorize_with_seed.rs b/clients/rust/src/generated/instructions/authorize_with_seed.rs index 86b83f62..45e2eab7 100644 --- a/clients/rust/src/generated/instructions/authorize_with_seed.rs +++ b/clients/rust/src/generated/instructions/authorize_with_seed.rs @@ -8,58 +8,61 @@ use { crate::generated::types::StakeAuthorize, borsh::{BorshDeserialize, BorshSerialize}, - solana_program::pubkey::Pubkey, + solana_pubkey::Pubkey, }; +pub const AUTHORIZE_WITH_SEED_DISCRIMINATOR: u32 = 8; + /// Accounts. #[derive(Debug)] pub struct AuthorizeWithSeed { /// Stake account to be updated - pub stake: solana_program::pubkey::Pubkey, + pub stake: solana_pubkey::Pubkey, /// Base key of stake or withdraw authority - pub base: solana_program::pubkey::Pubkey, + pub base: solana_pubkey::Pubkey, /// Clock sysvar - pub clock_sysvar: solana_program::pubkey::Pubkey, - /// Lockup authority - pub lockup_authority: Option, + pub clock_sysvar: solana_pubkey::Pubkey, + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration + pub lockup_authority: Option, } impl AuthorizeWithSeed { pub fn instruction( &self, args: AuthorizeWithSeedInstructionArgs, - ) -> solana_program::instruction::Instruction { + ) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(args, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, args: AuthorizeWithSeedInstructionArgs, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(4 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - self.stake, false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(self.stake, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( self.base, true, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.clock_sysvar, false, )); if let Some(lockup_authority) = self.lockup_authority { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( lockup_authority, true, )); } accounts.extend_from_slice(remaining_accounts); - let mut data = borsh::to_vec(&AuthorizeWithSeedInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&args).unwrap(); + let mut data = AuthorizeWithSeedInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = args.try_to_vec().unwrap(); data.append(&mut args); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -77,6 +80,10 @@ impl AuthorizeWithSeedInstructionData { pub fn new() -> Self { Self { discriminator: 8 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for AuthorizeWithSeedInstructionData { @@ -94,6 +101,12 @@ pub struct AuthorizeWithSeedInstructionArgs { pub authority_owner: Pubkey, } +impl AuthorizeWithSeedInstructionArgs { + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } +} + /// Instruction builder for `AuthorizeWithSeed`. /// /// ### Accounts: @@ -104,15 +117,15 @@ pub struct AuthorizeWithSeedInstructionArgs { /// 3. `[signer, optional]` lockup_authority #[derive(Clone, Debug, Default)] pub struct AuthorizeWithSeedBuilder { - stake: Option, - base: Option, - clock_sysvar: Option, - lockup_authority: Option, + stake: Option, + base: Option, + clock_sysvar: Option, + lockup_authority: Option, new_authorized_pubkey: Option, stake_authorize: Option, authority_seed: Option, authority_owner: Option, - __remaining_accounts: Vec, + __remaining_accounts: Vec, } impl AuthorizeWithSeedBuilder { @@ -121,29 +134,29 @@ impl AuthorizeWithSeedBuilder { } /// Stake account to be updated #[inline(always)] - pub fn stake(&mut self, stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake(&mut self, stake: solana_pubkey::Pubkey) -> &mut Self { self.stake = Some(stake); self } /// Base key of stake or withdraw authority #[inline(always)] - pub fn base(&mut self, base: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn base(&mut self, base: solana_pubkey::Pubkey) -> &mut Self { self.base = Some(base); self } /// `[optional account, default to 'SysvarC1ock11111111111111111111111111111111']` /// Clock sysvar #[inline(always)] - pub fn clock_sysvar(&mut self, clock_sysvar: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn clock_sysvar(&mut self, clock_sysvar: solana_pubkey::Pubkey) -> &mut Self { self.clock_sysvar = Some(clock_sysvar); self } /// `[optional account]` - /// Lockup authority + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration #[inline(always)] pub fn lockup_authority( &mut self, - lockup_authority: Option, + lockup_authority: Option, ) -> &mut Self { self.lockup_authority = lockup_authority; self @@ -170,10 +183,7 @@ impl AuthorizeWithSeedBuilder { } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -181,17 +191,17 @@ impl AuthorizeWithSeedBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = AuthorizeWithSeed { stake: self.stake.expect("stake is not set"), base: self.base.expect("base is not set"), - clock_sysvar: self.clock_sysvar.unwrap_or(solana_program::pubkey!( + clock_sysvar: self.clock_sysvar.unwrap_or(solana_pubkey::pubkey!( "SysvarC1ock11111111111111111111111111111111" )), lockup_authority: self.lockup_authority, @@ -222,34 +232,34 @@ impl AuthorizeWithSeedBuilder { /// `authorize_with_seed` CPI accounts. pub struct AuthorizeWithSeedCpiAccounts<'a, 'b> { /// Stake account to be updated - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Base key of stake or withdraw authority - pub base: &'b solana_program::account_info::AccountInfo<'a>, + pub base: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, - /// Lockup authority - pub lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration + pub lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, } /// `authorize_with_seed` CPI instruction. pub struct AuthorizeWithSeedCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, /// Stake account to be updated - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Base key of stake or withdraw authority - pub base: &'b solana_program::account_info::AccountInfo<'a>, + pub base: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, - /// Lockup authority - pub lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration + pub lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, /// The arguments for the instruction. pub __args: AuthorizeWithSeedInstructionArgs, } impl<'a, 'b> AuthorizeWithSeedCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: AuthorizeWithSeedCpiAccounts<'a, 'b>, args: AuthorizeWithSeedInstructionArgs, ) -> Self { @@ -263,69 +273,58 @@ impl<'a, 'b> AuthorizeWithSeedCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(4 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - *self.stake.key, - false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(*self.stake.key, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.base.key, true, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.clock_sysvar.key, false, )); if let Some(lockup_authority) = self.lockup_authority { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *lockup_authority.key, true, )); } remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let mut data = borsh::to_vec(&AuthorizeWithSeedInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&self.__args).unwrap(); + let mut data = AuthorizeWithSeedInstructionData::new() + .try_to_vec() + .unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); data.append(&mut args); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -343,9 +342,9 @@ impl<'a, 'b> AuthorizeWithSeedCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -364,7 +363,7 @@ pub struct AuthorizeWithSeedCpiBuilder<'a, 'b> { } impl<'a, 'b> AuthorizeWithSeedCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(AuthorizeWithSeedCpiBuilderInstruction { __program: program, stake: None, @@ -381,13 +380,13 @@ impl<'a, 'b> AuthorizeWithSeedCpiBuilder<'a, 'b> { } /// Stake account to be updated #[inline(always)] - pub fn stake(&mut self, stake: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn stake(&mut self, stake: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.stake = Some(stake); self } /// Base key of stake or withdraw authority #[inline(always)] - pub fn base(&mut self, base: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn base(&mut self, base: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.base = Some(base); self } @@ -395,17 +394,17 @@ impl<'a, 'b> AuthorizeWithSeedCpiBuilder<'a, 'b> { #[inline(always)] pub fn clock_sysvar( &mut self, - clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + clock_sysvar: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.clock_sysvar = Some(clock_sysvar); self } /// `[optional account]` - /// Lockup authority + /// Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration #[inline(always)] pub fn lockup_authority( &mut self, - lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, ) -> &mut Self { self.instruction.lockup_authority = lockup_authority; self @@ -434,7 +433,7 @@ impl<'a, 'b> AuthorizeWithSeedCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -450,11 +449,7 @@ impl<'a, 'b> AuthorizeWithSeedCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -462,15 +457,12 @@ impl<'a, 'b> AuthorizeWithSeedCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let args = AuthorizeWithSeedInstructionArgs { new_authorized_pubkey: self .instruction @@ -517,19 +509,15 @@ impl<'a, 'b> AuthorizeWithSeedCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct AuthorizeWithSeedCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - base: Option<&'b solana_program::account_info::AccountInfo<'a>>, - clock_sysvar: Option<&'b solana_program::account_info::AccountInfo<'a>>, - lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + __program: &'b solana_account_info::AccountInfo<'a>, + stake: Option<&'b solana_account_info::AccountInfo<'a>>, + base: Option<&'b solana_account_info::AccountInfo<'a>>, + clock_sysvar: Option<&'b solana_account_info::AccountInfo<'a>>, + lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, new_authorized_pubkey: Option, stake_authorize: Option, authority_seed: Option, authority_owner: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/deactivate.rs b/clients/rust/src/generated/instructions/deactivate.rs index 468e458b..67a76ba2 100644 --- a/clients/rust/src/generated/instructions/deactivate.rs +++ b/clients/rust/src/generated/instructions/deactivate.rs @@ -7,42 +7,43 @@ use borsh::{BorshDeserialize, BorshSerialize}; +pub const DEACTIVATE_DISCRIMINATOR: u32 = 5; + /// Accounts. #[derive(Debug)] pub struct Deactivate { - /// Delegated stake account - pub stake: solana_program::pubkey::Pubkey, + /// Delegated stake account to be deactivated + pub stake: solana_pubkey::Pubkey, /// Clock sysvar - pub clock_sysvar: solana_program::pubkey::Pubkey, + pub clock_sysvar: solana_pubkey::Pubkey, /// Stake authority - pub stake_authority: solana_program::pubkey::Pubkey, + pub stake_authority: solana_pubkey::Pubkey, } impl Deactivate { - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(&[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(3 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - self.stake, false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(self.stake, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( self.clock_sysvar, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.stake_authority, true, )); accounts.extend_from_slice(remaining_accounts); - let data = borsh::to_vec(&DeactivateInstructionData::new()).unwrap(); + let data = DeactivateInstructionData::new().try_to_vec().unwrap(); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -60,6 +61,10 @@ impl DeactivateInstructionData { pub fn new() -> Self { Self { discriminator: 5 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for DeactivateInstructionData { @@ -77,44 +82,38 @@ impl Default for DeactivateInstructionData { /// 2. `[signer]` stake_authority #[derive(Clone, Debug, Default)] pub struct DeactivateBuilder { - stake: Option, - clock_sysvar: Option, - stake_authority: Option, - __remaining_accounts: Vec, + stake: Option, + clock_sysvar: Option, + stake_authority: Option, + __remaining_accounts: Vec, } impl DeactivateBuilder { pub fn new() -> Self { Self::default() } - /// Delegated stake account + /// Delegated stake account to be deactivated #[inline(always)] - pub fn stake(&mut self, stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake(&mut self, stake: solana_pubkey::Pubkey) -> &mut Self { self.stake = Some(stake); self } /// `[optional account, default to 'SysvarC1ock11111111111111111111111111111111']` /// Clock sysvar #[inline(always)] - pub fn clock_sysvar(&mut self, clock_sysvar: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn clock_sysvar(&mut self, clock_sysvar: solana_pubkey::Pubkey) -> &mut Self { self.clock_sysvar = Some(clock_sysvar); self } /// Stake authority #[inline(always)] - pub fn stake_authority( - &mut self, - stake_authority: solana_program::pubkey::Pubkey, - ) -> &mut Self { + pub fn stake_authority(&mut self, stake_authority: solana_pubkey::Pubkey) -> &mut Self { self.stake_authority = Some(stake_authority); self } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -122,16 +121,16 @@ impl DeactivateBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = Deactivate { stake: self.stake.expect("stake is not set"), - clock_sysvar: self.clock_sysvar.unwrap_or(solana_program::pubkey!( + clock_sysvar: self.clock_sysvar.unwrap_or(solana_pubkey::pubkey!( "SysvarC1ock11111111111111111111111111111111" )), stake_authority: self.stake_authority.expect("stake_authority is not set"), @@ -143,29 +142,29 @@ impl DeactivateBuilder { /// `deactivate` CPI accounts. pub struct DeactivateCpiAccounts<'a, 'b> { - /// Delegated stake account - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + /// Delegated stake account to be deactivated + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, /// Stake authority - pub stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub stake_authority: &'b solana_account_info::AccountInfo<'a>, } /// `deactivate` CPI instruction. pub struct DeactivateCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, - /// Delegated stake account - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, + /// Delegated stake account to be deactivated + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, /// Stake authority - pub stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub stake_authority: &'b solana_account_info::AccountInfo<'a>, } impl<'a, 'b> DeactivateCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: DeactivateCpiAccounts<'a, 'b>, ) -> Self { Self { @@ -176,61 +175,48 @@ impl<'a, 'b> DeactivateCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(3 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - *self.stake.key, - false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(*self.stake.key, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.clock_sysvar.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.stake_authority.key, true, )); remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let data = borsh::to_vec(&DeactivateInstructionData::new()).unwrap(); + let data = DeactivateInstructionData::new().try_to_vec().unwrap(); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -245,9 +231,9 @@ impl<'a, 'b> DeactivateCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -265,7 +251,7 @@ pub struct DeactivateCpiBuilder<'a, 'b> { } impl<'a, 'b> DeactivateCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(DeactivateCpiBuilderInstruction { __program: program, stake: None, @@ -275,9 +261,9 @@ impl<'a, 'b> DeactivateCpiBuilder<'a, 'b> { }); Self { instruction } } - /// Delegated stake account + /// Delegated stake account to be deactivated #[inline(always)] - pub fn stake(&mut self, stake: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn stake(&mut self, stake: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.stake = Some(stake); self } @@ -285,7 +271,7 @@ impl<'a, 'b> DeactivateCpiBuilder<'a, 'b> { #[inline(always)] pub fn clock_sysvar( &mut self, - clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + clock_sysvar: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.clock_sysvar = Some(clock_sysvar); self @@ -294,7 +280,7 @@ impl<'a, 'b> DeactivateCpiBuilder<'a, 'b> { #[inline(always)] pub fn stake_authority( &mut self, - stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + stake_authority: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.stake_authority = Some(stake_authority); self @@ -303,7 +289,7 @@ impl<'a, 'b> DeactivateCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -319,11 +305,7 @@ impl<'a, 'b> DeactivateCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -331,15 +313,12 @@ impl<'a, 'b> DeactivateCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let instruction = DeactivateCpi { __program: self.instruction.__program, @@ -364,14 +343,10 @@ impl<'a, 'b> DeactivateCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct DeactivateCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - clock_sysvar: Option<&'b solana_program::account_info::AccountInfo<'a>>, - stake_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + __program: &'b solana_account_info::AccountInfo<'a>, + stake: Option<&'b solana_account_info::AccountInfo<'a>>, + clock_sysvar: Option<&'b solana_account_info::AccountInfo<'a>>, + stake_authority: Option<&'b solana_account_info::AccountInfo<'a>>, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/deactivate_delinquent.rs b/clients/rust/src/generated/instructions/deactivate_delinquent.rs index 3ccc5ffe..6a2ec350 100644 --- a/clients/rust/src/generated/instructions/deactivate_delinquent.rs +++ b/clients/rust/src/generated/instructions/deactivate_delinquent.rs @@ -7,42 +7,45 @@ use borsh::{BorshDeserialize, BorshSerialize}; +pub const DEACTIVATE_DELINQUENT_DISCRIMINATOR: u32 = 14; + /// Accounts. #[derive(Debug)] pub struct DeactivateDelinquent { /// Delegated stake account - pub stake: solana_program::pubkey::Pubkey, - /// Delinquent vote account - pub delinquent_vote: solana_program::pubkey::Pubkey, - /// Reference vote account - pub reference_vote: solana_program::pubkey::Pubkey, + pub stake: solana_pubkey::Pubkey, + /// Delinquent vote account for the delegated stake account + pub delinquent_vote: solana_pubkey::Pubkey, + /// Reference vote account that has voted at least once in the last `MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION` epochs + pub reference_vote: solana_pubkey::Pubkey, } impl DeactivateDelinquent { - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(&[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(3 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - self.stake, false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(self.stake, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( self.delinquent_vote, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.reference_vote, false, )); accounts.extend_from_slice(remaining_accounts); - let data = borsh::to_vec(&DeactivateDelinquentInstructionData::new()).unwrap(); + let data = DeactivateDelinquentInstructionData::new() + .try_to_vec() + .unwrap(); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -60,6 +63,10 @@ impl DeactivateDelinquentInstructionData { pub fn new() -> Self { Self { discriminator: 14 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for DeactivateDelinquentInstructionData { @@ -77,10 +84,10 @@ impl Default for DeactivateDelinquentInstructionData { /// 2. `[]` reference_vote #[derive(Clone, Debug, Default)] pub struct DeactivateDelinquentBuilder { - stake: Option, - delinquent_vote: Option, - reference_vote: Option, - __remaining_accounts: Vec, + stake: Option, + delinquent_vote: Option, + reference_vote: Option, + __remaining_accounts: Vec, } impl DeactivateDelinquentBuilder { @@ -89,31 +96,25 @@ impl DeactivateDelinquentBuilder { } /// Delegated stake account #[inline(always)] - pub fn stake(&mut self, stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake(&mut self, stake: solana_pubkey::Pubkey) -> &mut Self { self.stake = Some(stake); self } - /// Delinquent vote account + /// Delinquent vote account for the delegated stake account #[inline(always)] - pub fn delinquent_vote( - &mut self, - delinquent_vote: solana_program::pubkey::Pubkey, - ) -> &mut Self { + pub fn delinquent_vote(&mut self, delinquent_vote: solana_pubkey::Pubkey) -> &mut Self { self.delinquent_vote = Some(delinquent_vote); self } - /// Reference vote account + /// Reference vote account that has voted at least once in the last `MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION` epochs #[inline(always)] - pub fn reference_vote(&mut self, reference_vote: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn reference_vote(&mut self, reference_vote: solana_pubkey::Pubkey) -> &mut Self { self.reference_vote = Some(reference_vote); self } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -121,13 +122,13 @@ impl DeactivateDelinquentBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = DeactivateDelinquent { stake: self.stake.expect("stake is not set"), delinquent_vote: self.delinquent_vote.expect("delinquent_vote is not set"), @@ -141,28 +142,28 @@ impl DeactivateDelinquentBuilder { /// `deactivate_delinquent` CPI accounts. pub struct DeactivateDelinquentCpiAccounts<'a, 'b> { /// Delegated stake account - pub stake: &'b solana_program::account_info::AccountInfo<'a>, - /// Delinquent vote account - pub delinquent_vote: &'b solana_program::account_info::AccountInfo<'a>, - /// Reference vote account - pub reference_vote: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, + /// Delinquent vote account for the delegated stake account + pub delinquent_vote: &'b solana_account_info::AccountInfo<'a>, + /// Reference vote account that has voted at least once in the last `MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION` epochs + pub reference_vote: &'b solana_account_info::AccountInfo<'a>, } /// `deactivate_delinquent` CPI instruction. pub struct DeactivateDelinquentCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, /// Delegated stake account - pub stake: &'b solana_program::account_info::AccountInfo<'a>, - /// Delinquent vote account - pub delinquent_vote: &'b solana_program::account_info::AccountInfo<'a>, - /// Reference vote account - pub reference_vote: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, + /// Delinquent vote account for the delegated stake account + pub delinquent_vote: &'b solana_account_info::AccountInfo<'a>, + /// Reference vote account that has voted at least once in the last `MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION` epochs + pub reference_vote: &'b solana_account_info::AccountInfo<'a>, } impl<'a, 'b> DeactivateDelinquentCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: DeactivateDelinquentCpiAccounts<'a, 'b>, ) -> Self { Self { @@ -173,61 +174,50 @@ impl<'a, 'b> DeactivateDelinquentCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(3 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - *self.stake.key, - false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(*self.stake.key, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.delinquent_vote.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.reference_vote.key, false, )); remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let data = borsh::to_vec(&DeactivateDelinquentInstructionData::new()).unwrap(); + let data = DeactivateDelinquentInstructionData::new() + .try_to_vec() + .unwrap(); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -242,9 +232,9 @@ impl<'a, 'b> DeactivateDelinquentCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -262,7 +252,7 @@ pub struct DeactivateDelinquentCpiBuilder<'a, 'b> { } impl<'a, 'b> DeactivateDelinquentCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(DeactivateDelinquentCpiBuilderInstruction { __program: program, stake: None, @@ -274,24 +264,24 @@ impl<'a, 'b> DeactivateDelinquentCpiBuilder<'a, 'b> { } /// Delegated stake account #[inline(always)] - pub fn stake(&mut self, stake: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn stake(&mut self, stake: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.stake = Some(stake); self } - /// Delinquent vote account + /// Delinquent vote account for the delegated stake account #[inline(always)] pub fn delinquent_vote( &mut self, - delinquent_vote: &'b solana_program::account_info::AccountInfo<'a>, + delinquent_vote: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.delinquent_vote = Some(delinquent_vote); self } - /// Reference vote account + /// Reference vote account that has voted at least once in the last `MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION` epochs #[inline(always)] pub fn reference_vote( &mut self, - reference_vote: &'b solana_program::account_info::AccountInfo<'a>, + reference_vote: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.reference_vote = Some(reference_vote); self @@ -300,7 +290,7 @@ impl<'a, 'b> DeactivateDelinquentCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -316,11 +306,7 @@ impl<'a, 'b> DeactivateDelinquentCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -328,15 +314,12 @@ impl<'a, 'b> DeactivateDelinquentCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let instruction = DeactivateDelinquentCpi { __program: self.instruction.__program, @@ -361,14 +344,10 @@ impl<'a, 'b> DeactivateDelinquentCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct DeactivateDelinquentCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - delinquent_vote: Option<&'b solana_program::account_info::AccountInfo<'a>>, - reference_vote: Option<&'b solana_program::account_info::AccountInfo<'a>>, + __program: &'b solana_account_info::AccountInfo<'a>, + stake: Option<&'b solana_account_info::AccountInfo<'a>>, + delinquent_vote: Option<&'b solana_account_info::AccountInfo<'a>>, + reference_vote: Option<&'b solana_account_info::AccountInfo<'a>>, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/delegate_stake.rs b/clients/rust/src/generated/instructions/delegate_stake.rs index 617f2ca8..00fe1591 100644 --- a/clients/rust/src/generated/instructions/delegate_stake.rs +++ b/clients/rust/src/generated/instructions/delegate_stake.rs @@ -7,59 +7,60 @@ use borsh::{BorshDeserialize, BorshSerialize}; +pub const DELEGATE_STAKE_DISCRIMINATOR: u32 = 2; + /// Accounts. #[derive(Debug)] pub struct DelegateStake { /// Initialized stake account to be delegated - pub stake: solana_program::pubkey::Pubkey, + pub stake: solana_pubkey::Pubkey, /// Vote account to which this stake will be delegated - pub vote: solana_program::pubkey::Pubkey, + pub vote: solana_pubkey::Pubkey, /// Clock sysvar - pub clock_sysvar: solana_program::pubkey::Pubkey, - /// Stake history sysvar - pub stake_history: solana_program::pubkey::Pubkey, + pub clock_sysvar: solana_pubkey::Pubkey, + /// Stake history sysvar that carries stake warmup/cooldown history + pub stake_history: solana_pubkey::Pubkey, /// Unused account, formerly the stake config - pub unused: solana_program::pubkey::Pubkey, + pub unused: solana_pubkey::Pubkey, /// Stake authority - pub stake_authority: solana_program::pubkey::Pubkey, + pub stake_authority: solana_pubkey::Pubkey, } impl DelegateStake { - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(&[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(6 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - self.stake, false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(self.stake, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( self.vote, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.clock_sysvar, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.stake_history, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.unused, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.stake_authority, true, )); accounts.extend_from_slice(remaining_accounts); - let data = borsh::to_vec(&DelegateStakeInstructionData::new()).unwrap(); + let data = DelegateStakeInstructionData::new().try_to_vec().unwrap(); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -77,6 +78,10 @@ impl DelegateStakeInstructionData { pub fn new() -> Self { Self { discriminator: 2 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for DelegateStakeInstructionData { @@ -92,18 +97,18 @@ impl Default for DelegateStakeInstructionData { /// 0. `[writable]` stake /// 1. `[]` vote /// 2. `[optional]` clock_sysvar (default to `SysvarC1ock11111111111111111111111111111111`) -/// 3. `[]` stake_history +/// 3. `[optional]` stake_history (default to `SysvarStakeHistory1111111111111111111111111`) /// 4. `[]` unused /// 5. `[signer]` stake_authority #[derive(Clone, Debug, Default)] pub struct DelegateStakeBuilder { - stake: Option, - vote: Option, - clock_sysvar: Option, - stake_history: Option, - unused: Option, - stake_authority: Option, - __remaining_accounts: Vec, + stake: Option, + vote: Option, + clock_sysvar: Option, + stake_history: Option, + unused: Option, + stake_authority: Option, + __remaining_accounts: Vec, } impl DelegateStakeBuilder { @@ -112,50 +117,45 @@ impl DelegateStakeBuilder { } /// Initialized stake account to be delegated #[inline(always)] - pub fn stake(&mut self, stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake(&mut self, stake: solana_pubkey::Pubkey) -> &mut Self { self.stake = Some(stake); self } /// Vote account to which this stake will be delegated #[inline(always)] - pub fn vote(&mut self, vote: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn vote(&mut self, vote: solana_pubkey::Pubkey) -> &mut Self { self.vote = Some(vote); self } /// `[optional account, default to 'SysvarC1ock11111111111111111111111111111111']` /// Clock sysvar #[inline(always)] - pub fn clock_sysvar(&mut self, clock_sysvar: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn clock_sysvar(&mut self, clock_sysvar: solana_pubkey::Pubkey) -> &mut Self { self.clock_sysvar = Some(clock_sysvar); self } - /// Stake history sysvar + /// `[optional account, default to 'SysvarStakeHistory1111111111111111111111111']` + /// Stake history sysvar that carries stake warmup/cooldown history #[inline(always)] - pub fn stake_history(&mut self, stake_history: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake_history(&mut self, stake_history: solana_pubkey::Pubkey) -> &mut Self { self.stake_history = Some(stake_history); self } /// Unused account, formerly the stake config #[inline(always)] - pub fn unused(&mut self, unused: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn unused(&mut self, unused: solana_pubkey::Pubkey) -> &mut Self { self.unused = Some(unused); self } /// Stake authority #[inline(always)] - pub fn stake_authority( - &mut self, - stake_authority: solana_program::pubkey::Pubkey, - ) -> &mut Self { + pub fn stake_authority(&mut self, stake_authority: solana_pubkey::Pubkey) -> &mut Self { self.stake_authority = Some(stake_authority); self } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -163,20 +163,22 @@ impl DelegateStakeBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = DelegateStake { stake: self.stake.expect("stake is not set"), vote: self.vote.expect("vote is not set"), - clock_sysvar: self.clock_sysvar.unwrap_or(solana_program::pubkey!( + clock_sysvar: self.clock_sysvar.unwrap_or(solana_pubkey::pubkey!( "SysvarC1ock11111111111111111111111111111111" )), - stake_history: self.stake_history.expect("stake_history is not set"), + stake_history: self.stake_history.unwrap_or(solana_pubkey::pubkey!( + "SysvarStakeHistory1111111111111111111111111" + )), unused: self.unused.expect("unused is not set"), stake_authority: self.stake_authority.expect("stake_authority is not set"), }; @@ -188,40 +190,40 @@ impl DelegateStakeBuilder { /// `delegate_stake` CPI accounts. pub struct DelegateStakeCpiAccounts<'a, 'b> { /// Initialized stake account to be delegated - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Vote account to which this stake will be delegated - pub vote: &'b solana_program::account_info::AccountInfo<'a>, + pub vote: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, - /// Stake history sysvar - pub stake_history: &'b solana_program::account_info::AccountInfo<'a>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, + /// Stake history sysvar that carries stake warmup/cooldown history + pub stake_history: &'b solana_account_info::AccountInfo<'a>, /// Unused account, formerly the stake config - pub unused: &'b solana_program::account_info::AccountInfo<'a>, + pub unused: &'b solana_account_info::AccountInfo<'a>, /// Stake authority - pub stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub stake_authority: &'b solana_account_info::AccountInfo<'a>, } /// `delegate_stake` CPI instruction. pub struct DelegateStakeCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, /// Initialized stake account to be delegated - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Vote account to which this stake will be delegated - pub vote: &'b solana_program::account_info::AccountInfo<'a>, + pub vote: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, - /// Stake history sysvar - pub stake_history: &'b solana_program::account_info::AccountInfo<'a>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, + /// Stake history sysvar that carries stake warmup/cooldown history + pub stake_history: &'b solana_account_info::AccountInfo<'a>, /// Unused account, formerly the stake config - pub unused: &'b solana_program::account_info::AccountInfo<'a>, + pub unused: &'b solana_account_info::AccountInfo<'a>, /// Stake authority - pub stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub stake_authority: &'b solana_account_info::AccountInfo<'a>, } impl<'a, 'b> DelegateStakeCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: DelegateStakeCpiAccounts<'a, 'b>, ) -> Self { Self { @@ -235,73 +237,60 @@ impl<'a, 'b> DelegateStakeCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(6 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - *self.stake.key, - false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(*self.stake.key, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.vote.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.clock_sysvar.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.stake_history.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.unused.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.stake_authority.key, true, )); remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let data = borsh::to_vec(&DelegateStakeInstructionData::new()).unwrap(); + let data = DelegateStakeInstructionData::new().try_to_vec().unwrap(); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -319,9 +308,9 @@ impl<'a, 'b> DelegateStakeCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -342,7 +331,7 @@ pub struct DelegateStakeCpiBuilder<'a, 'b> { } impl<'a, 'b> DelegateStakeCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(DelegateStakeCpiBuilderInstruction { __program: program, stake: None, @@ -357,13 +346,13 @@ impl<'a, 'b> DelegateStakeCpiBuilder<'a, 'b> { } /// Initialized stake account to be delegated #[inline(always)] - pub fn stake(&mut self, stake: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn stake(&mut self, stake: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.stake = Some(stake); self } /// Vote account to which this stake will be delegated #[inline(always)] - pub fn vote(&mut self, vote: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn vote(&mut self, vote: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.vote = Some(vote); self } @@ -371,26 +360,23 @@ impl<'a, 'b> DelegateStakeCpiBuilder<'a, 'b> { #[inline(always)] pub fn clock_sysvar( &mut self, - clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + clock_sysvar: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.clock_sysvar = Some(clock_sysvar); self } - /// Stake history sysvar + /// Stake history sysvar that carries stake warmup/cooldown history #[inline(always)] pub fn stake_history( &mut self, - stake_history: &'b solana_program::account_info::AccountInfo<'a>, + stake_history: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.stake_history = Some(stake_history); self } /// Unused account, formerly the stake config #[inline(always)] - pub fn unused( - &mut self, - unused: &'b solana_program::account_info::AccountInfo<'a>, - ) -> &mut Self { + pub fn unused(&mut self, unused: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.unused = Some(unused); self } @@ -398,7 +384,7 @@ impl<'a, 'b> DelegateStakeCpiBuilder<'a, 'b> { #[inline(always)] pub fn stake_authority( &mut self, - stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + stake_authority: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.stake_authority = Some(stake_authority); self @@ -407,7 +393,7 @@ impl<'a, 'b> DelegateStakeCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -423,11 +409,7 @@ impl<'a, 'b> DelegateStakeCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -435,15 +417,12 @@ impl<'a, 'b> DelegateStakeCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let instruction = DelegateStakeCpi { __program: self.instruction.__program, @@ -477,17 +456,13 @@ impl<'a, 'b> DelegateStakeCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct DelegateStakeCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - vote: Option<&'b solana_program::account_info::AccountInfo<'a>>, - clock_sysvar: Option<&'b solana_program::account_info::AccountInfo<'a>>, - stake_history: Option<&'b solana_program::account_info::AccountInfo<'a>>, - unused: Option<&'b solana_program::account_info::AccountInfo<'a>>, - stake_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + __program: &'b solana_account_info::AccountInfo<'a>, + stake: Option<&'b solana_account_info::AccountInfo<'a>>, + vote: Option<&'b solana_account_info::AccountInfo<'a>>, + clock_sysvar: Option<&'b solana_account_info::AccountInfo<'a>>, + stake_history: Option<&'b solana_account_info::AccountInfo<'a>>, + unused: Option<&'b solana_account_info::AccountInfo<'a>>, + stake_authority: Option<&'b solana_account_info::AccountInfo<'a>>, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/get_minimum_delegation.rs b/clients/rust/src/generated/instructions/get_minimum_delegation.rs index d510e2cb..4a211159 100644 --- a/clients/rust/src/generated/instructions/get_minimum_delegation.rs +++ b/clients/rust/src/generated/instructions/get_minimum_delegation.rs @@ -7,24 +7,29 @@ use borsh::{BorshDeserialize, BorshSerialize}; +pub const GET_MINIMUM_DELEGATION_DISCRIMINATOR: u32 = 13; + /// Accounts. #[derive(Debug)] pub struct GetMinimumDelegation {} impl GetMinimumDelegation { - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(&[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(remaining_accounts.len()); accounts.extend_from_slice(remaining_accounts); - let data = borsh::to_vec(&GetMinimumDelegationInstructionData::new()).unwrap(); + let data = GetMinimumDelegationInstructionData::new() + .try_to_vec() + .unwrap(); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -42,6 +47,10 @@ impl GetMinimumDelegationInstructionData { pub fn new() -> Self { Self { discriminator: 13 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for GetMinimumDelegationInstructionData { @@ -56,7 +65,7 @@ impl Default for GetMinimumDelegationInstructionData { /// #[derive(Clone, Debug, Default)] pub struct GetMinimumDelegationBuilder { - __remaining_accounts: Vec, + __remaining_accounts: Vec, } impl GetMinimumDelegationBuilder { @@ -65,10 +74,7 @@ impl GetMinimumDelegationBuilder { } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -76,13 +82,13 @@ impl GetMinimumDelegationBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = GetMinimumDelegation {}; accounts.instruction_with_remaining_accounts(&self.__remaining_accounts) @@ -92,57 +98,49 @@ impl GetMinimumDelegationBuilder { /// `get_minimum_delegation` CPI instruction. pub struct GetMinimumDelegationCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, } impl<'a, 'b> GetMinimumDelegationCpi<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { Self { __program: program } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(remaining_accounts.len()); remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let data = borsh::to_vec(&GetMinimumDelegationInstructionData::new()).unwrap(); + let data = GetMinimumDelegationInstructionData::new() + .try_to_vec() + .unwrap(); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -154,9 +152,9 @@ impl<'a, 'b> GetMinimumDelegationCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -171,7 +169,7 @@ pub struct GetMinimumDelegationCpiBuilder<'a, 'b> { } impl<'a, 'b> GetMinimumDelegationCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(GetMinimumDelegationCpiBuilderInstruction { __program: program, __remaining_accounts: Vec::new(), @@ -182,7 +180,7 @@ impl<'a, 'b> GetMinimumDelegationCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -198,11 +196,7 @@ impl<'a, 'b> GetMinimumDelegationCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -210,15 +204,12 @@ impl<'a, 'b> GetMinimumDelegationCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let instruction = GetMinimumDelegationCpi { __program: self.instruction.__program, }; @@ -231,11 +222,7 @@ impl<'a, 'b> GetMinimumDelegationCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct GetMinimumDelegationCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, + __program: &'b solana_account_info::AccountInfo<'a>, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/initialize.rs b/clients/rust/src/generated/instructions/initialize.rs index 24bc81f5..e8df55af 100644 --- a/clients/rust/src/generated/instructions/initialize.rs +++ b/clients/rust/src/generated/instructions/initialize.rs @@ -10,42 +10,40 @@ use { borsh::{BorshDeserialize, BorshSerialize}, }; +pub const INITIALIZE_DISCRIMINATOR: u32 = 0; + /// Accounts. #[derive(Debug)] pub struct Initialize { /// Uninitialized stake account - pub stake: solana_program::pubkey::Pubkey, + pub stake: solana_pubkey::Pubkey, /// Rent sysvar - pub rent_sysvar: solana_program::pubkey::Pubkey, + pub rent_sysvar: solana_pubkey::Pubkey, } impl Initialize { - pub fn instruction( - &self, - args: InitializeInstructionArgs, - ) -> solana_program::instruction::Instruction { + pub fn instruction(&self, args: InitializeInstructionArgs) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(args, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, args: InitializeInstructionArgs, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(2 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - self.stake, false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(self.stake, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( self.rent_sysvar, false, )); accounts.extend_from_slice(remaining_accounts); - let mut data = borsh::to_vec(&InitializeInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&args).unwrap(); + let mut data = InitializeInstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); data.append(&mut args); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -63,6 +61,10 @@ impl InitializeInstructionData { pub fn new() -> Self { Self { discriminator: 0 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for InitializeInstructionData { @@ -78,6 +80,12 @@ pub struct InitializeInstructionArgs { pub arg1: Lockup, } +impl InitializeInstructionArgs { + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } +} + /// Instruction builder for `Initialize`. /// /// ### Accounts: @@ -86,11 +94,11 @@ pub struct InitializeInstructionArgs { /// 1. `[optional]` rent_sysvar (default to `SysvarRent111111111111111111111111111111111`) #[derive(Clone, Debug, Default)] pub struct InitializeBuilder { - stake: Option, - rent_sysvar: Option, + stake: Option, + rent_sysvar: Option, arg0: Option, arg1: Option, - __remaining_accounts: Vec, + __remaining_accounts: Vec, } impl InitializeBuilder { @@ -99,14 +107,14 @@ impl InitializeBuilder { } /// Uninitialized stake account #[inline(always)] - pub fn stake(&mut self, stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake(&mut self, stake: solana_pubkey::Pubkey) -> &mut Self { self.stake = Some(stake); self } /// `[optional account, default to 'SysvarRent111111111111111111111111111111111']` /// Rent sysvar #[inline(always)] - pub fn rent_sysvar(&mut self, rent_sysvar: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn rent_sysvar(&mut self, rent_sysvar: solana_pubkey::Pubkey) -> &mut Self { self.rent_sysvar = Some(rent_sysvar); self } @@ -122,10 +130,7 @@ impl InitializeBuilder { } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -133,16 +138,16 @@ impl InitializeBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = Initialize { stake: self.stake.expect("stake is not set"), - rent_sysvar: self.rent_sysvar.unwrap_or(solana_program::pubkey!( + rent_sysvar: self.rent_sysvar.unwrap_or(solana_pubkey::pubkey!( "SysvarRent111111111111111111111111111111111" )), }; @@ -158,26 +163,26 @@ impl InitializeBuilder { /// `initialize` CPI accounts. pub struct InitializeCpiAccounts<'a, 'b> { /// Uninitialized stake account - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Rent sysvar - pub rent_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + pub rent_sysvar: &'b solana_account_info::AccountInfo<'a>, } /// `initialize` CPI instruction. pub struct InitializeCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, /// Uninitialized stake account - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Rent sysvar - pub rent_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + pub rent_sysvar: &'b solana_account_info::AccountInfo<'a>, /// The arguments for the instruction. pub __args: InitializeInstructionArgs, } impl<'a, 'b> InitializeCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: InitializeCpiAccounts<'a, 'b>, args: InitializeInstructionArgs, ) -> Self { @@ -189,59 +194,46 @@ impl<'a, 'b> InitializeCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(2 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - *self.stake.key, - false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(*self.stake.key, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.rent_sysvar.key, false, )); remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let mut data = borsh::to_vec(&InitializeInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&self.__args).unwrap(); + let mut data = InitializeInstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); data.append(&mut args); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -255,9 +247,9 @@ impl<'a, 'b> InitializeCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -274,7 +266,7 @@ pub struct InitializeCpiBuilder<'a, 'b> { } impl<'a, 'b> InitializeCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(InitializeCpiBuilderInstruction { __program: program, stake: None, @@ -287,7 +279,7 @@ impl<'a, 'b> InitializeCpiBuilder<'a, 'b> { } /// Uninitialized stake account #[inline(always)] - pub fn stake(&mut self, stake: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn stake(&mut self, stake: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.stake = Some(stake); self } @@ -295,7 +287,7 @@ impl<'a, 'b> InitializeCpiBuilder<'a, 'b> { #[inline(always)] pub fn rent_sysvar( &mut self, - rent_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + rent_sysvar: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.rent_sysvar = Some(rent_sysvar); self @@ -314,7 +306,7 @@ impl<'a, 'b> InitializeCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -330,11 +322,7 @@ impl<'a, 'b> InitializeCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -342,15 +330,12 @@ impl<'a, 'b> InitializeCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let args = InitializeInstructionArgs { arg0: self.instruction.arg0.clone().expect("arg0 is not set"), arg1: self.instruction.arg1.clone().expect("arg1 is not set"), @@ -375,15 +360,11 @@ impl<'a, 'b> InitializeCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct InitializeCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - rent_sysvar: Option<&'b solana_program::account_info::AccountInfo<'a>>, + __program: &'b solana_account_info::AccountInfo<'a>, + stake: Option<&'b solana_account_info::AccountInfo<'a>>, + rent_sysvar: Option<&'b solana_account_info::AccountInfo<'a>>, arg0: Option, arg1: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/initialize_checked.rs b/clients/rust/src/generated/instructions/initialize_checked.rs index 929046f7..6d563ada 100644 --- a/clients/rust/src/generated/instructions/initialize_checked.rs +++ b/clients/rust/src/generated/instructions/initialize_checked.rs @@ -7,48 +7,51 @@ use borsh::{BorshDeserialize, BorshSerialize}; +pub const INITIALIZE_CHECKED_DISCRIMINATOR: u32 = 9; + /// Accounts. #[derive(Debug)] pub struct InitializeChecked { /// Uninitialized stake account - pub stake: solana_program::pubkey::Pubkey, + pub stake: solana_pubkey::Pubkey, /// Rent sysvar - pub rent_sysvar: solana_program::pubkey::Pubkey, + pub rent_sysvar: solana_pubkey::Pubkey, /// The stake authority - pub stake_authority: solana_program::pubkey::Pubkey, + pub stake_authority: solana_pubkey::Pubkey, /// The withdraw authority - pub withdraw_authority: solana_program::pubkey::Pubkey, + pub withdraw_authority: solana_pubkey::Pubkey, } impl InitializeChecked { - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(&[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(4 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - self.stake, false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(self.stake, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( self.rent_sysvar, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.stake_authority, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.withdraw_authority, true, )); accounts.extend_from_slice(remaining_accounts); - let data = borsh::to_vec(&InitializeCheckedInstructionData::new()).unwrap(); + let data = InitializeCheckedInstructionData::new() + .try_to_vec() + .unwrap(); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -66,6 +69,10 @@ impl InitializeCheckedInstructionData { pub fn new() -> Self { Self { discriminator: 9 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for InitializeCheckedInstructionData { @@ -84,11 +91,11 @@ impl Default for InitializeCheckedInstructionData { /// 3. `[signer]` withdraw_authority #[derive(Clone, Debug, Default)] pub struct InitializeCheckedBuilder { - stake: Option, - rent_sysvar: Option, - stake_authority: Option, - withdraw_authority: Option, - __remaining_accounts: Vec, + stake: Option, + rent_sysvar: Option, + stake_authority: Option, + withdraw_authority: Option, + __remaining_accounts: Vec, } impl InitializeCheckedBuilder { @@ -97,41 +104,32 @@ impl InitializeCheckedBuilder { } /// Uninitialized stake account #[inline(always)] - pub fn stake(&mut self, stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake(&mut self, stake: solana_pubkey::Pubkey) -> &mut Self { self.stake = Some(stake); self } /// `[optional account, default to 'SysvarRent111111111111111111111111111111111']` /// Rent sysvar #[inline(always)] - pub fn rent_sysvar(&mut self, rent_sysvar: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn rent_sysvar(&mut self, rent_sysvar: solana_pubkey::Pubkey) -> &mut Self { self.rent_sysvar = Some(rent_sysvar); self } /// The stake authority #[inline(always)] - pub fn stake_authority( - &mut self, - stake_authority: solana_program::pubkey::Pubkey, - ) -> &mut Self { + pub fn stake_authority(&mut self, stake_authority: solana_pubkey::Pubkey) -> &mut Self { self.stake_authority = Some(stake_authority); self } /// The withdraw authority #[inline(always)] - pub fn withdraw_authority( - &mut self, - withdraw_authority: solana_program::pubkey::Pubkey, - ) -> &mut Self { + pub fn withdraw_authority(&mut self, withdraw_authority: solana_pubkey::Pubkey) -> &mut Self { self.withdraw_authority = Some(withdraw_authority); self } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -139,16 +137,16 @@ impl InitializeCheckedBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = InitializeChecked { stake: self.stake.expect("stake is not set"), - rent_sysvar: self.rent_sysvar.unwrap_or(solana_program::pubkey!( + rent_sysvar: self.rent_sysvar.unwrap_or(solana_pubkey::pubkey!( "SysvarRent111111111111111111111111111111111" )), stake_authority: self.stake_authority.expect("stake_authority is not set"), @@ -164,32 +162,32 @@ impl InitializeCheckedBuilder { /// `initialize_checked` CPI accounts. pub struct InitializeCheckedCpiAccounts<'a, 'b> { /// Uninitialized stake account - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Rent sysvar - pub rent_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + pub rent_sysvar: &'b solana_account_info::AccountInfo<'a>, /// The stake authority - pub stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub stake_authority: &'b solana_account_info::AccountInfo<'a>, /// The withdraw authority - pub withdraw_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub withdraw_authority: &'b solana_account_info::AccountInfo<'a>, } /// `initialize_checked` CPI instruction. pub struct InitializeCheckedCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, /// Uninitialized stake account - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Rent sysvar - pub rent_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + pub rent_sysvar: &'b solana_account_info::AccountInfo<'a>, /// The stake authority - pub stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub stake_authority: &'b solana_account_info::AccountInfo<'a>, /// The withdraw authority - pub withdraw_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub withdraw_authority: &'b solana_account_info::AccountInfo<'a>, } impl<'a, 'b> InitializeCheckedCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: InitializeCheckedCpiAccounts<'a, 'b>, ) -> Self { Self { @@ -201,65 +199,54 @@ impl<'a, 'b> InitializeCheckedCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(4 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - *self.stake.key, - false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(*self.stake.key, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.rent_sysvar.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.stake_authority.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.withdraw_authority.key, true, )); remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let data = borsh::to_vec(&InitializeCheckedInstructionData::new()).unwrap(); + let data = InitializeCheckedInstructionData::new() + .try_to_vec() + .unwrap(); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -275,9 +262,9 @@ impl<'a, 'b> InitializeCheckedCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -296,7 +283,7 @@ pub struct InitializeCheckedCpiBuilder<'a, 'b> { } impl<'a, 'b> InitializeCheckedCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(InitializeCheckedCpiBuilderInstruction { __program: program, stake: None, @@ -309,7 +296,7 @@ impl<'a, 'b> InitializeCheckedCpiBuilder<'a, 'b> { } /// Uninitialized stake account #[inline(always)] - pub fn stake(&mut self, stake: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn stake(&mut self, stake: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.stake = Some(stake); self } @@ -317,7 +304,7 @@ impl<'a, 'b> InitializeCheckedCpiBuilder<'a, 'b> { #[inline(always)] pub fn rent_sysvar( &mut self, - rent_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + rent_sysvar: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.rent_sysvar = Some(rent_sysvar); self @@ -326,7 +313,7 @@ impl<'a, 'b> InitializeCheckedCpiBuilder<'a, 'b> { #[inline(always)] pub fn stake_authority( &mut self, - stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + stake_authority: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.stake_authority = Some(stake_authority); self @@ -335,7 +322,7 @@ impl<'a, 'b> InitializeCheckedCpiBuilder<'a, 'b> { #[inline(always)] pub fn withdraw_authority( &mut self, - withdraw_authority: &'b solana_program::account_info::AccountInfo<'a>, + withdraw_authority: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.withdraw_authority = Some(withdraw_authority); self @@ -344,7 +331,7 @@ impl<'a, 'b> InitializeCheckedCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -360,11 +347,7 @@ impl<'a, 'b> InitializeCheckedCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -372,15 +355,12 @@ impl<'a, 'b> InitializeCheckedCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let instruction = InitializeCheckedCpi { __program: self.instruction.__program, @@ -410,15 +390,11 @@ impl<'a, 'b> InitializeCheckedCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct InitializeCheckedCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - rent_sysvar: Option<&'b solana_program::account_info::AccountInfo<'a>>, - stake_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, - withdraw_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + __program: &'b solana_account_info::AccountInfo<'a>, + stake: Option<&'b solana_account_info::AccountInfo<'a>>, + rent_sysvar: Option<&'b solana_account_info::AccountInfo<'a>>, + stake_authority: Option<&'b solana_account_info::AccountInfo<'a>>, + withdraw_authority: Option<&'b solana_account_info::AccountInfo<'a>>, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/merge.rs b/clients/rust/src/generated/instructions/merge.rs index e56caa51..47a2d4a6 100644 --- a/clients/rust/src/generated/instructions/merge.rs +++ b/clients/rust/src/generated/instructions/merge.rs @@ -7,55 +7,58 @@ use borsh::{BorshDeserialize, BorshSerialize}; +pub const MERGE_DISCRIMINATOR: u32 = 7; + /// Accounts. #[derive(Debug)] pub struct Merge { - /// Destination stake account - pub destination_stake: solana_program::pubkey::Pubkey, - /// Source stake account - pub source_stake: solana_program::pubkey::Pubkey, + /// Destination stake account for the merge + pub destination_stake: solana_pubkey::Pubkey, + /// Source stake account for to merge. This account will be drained + pub source_stake: solana_pubkey::Pubkey, /// Clock sysvar - pub clock_sysvar: solana_program::pubkey::Pubkey, - /// Stake history sysvar - pub stake_history: solana_program::pubkey::Pubkey, + pub clock_sysvar: solana_pubkey::Pubkey, + /// Stake history sysvar that carries stake warmup/cooldown history + pub stake_history: solana_pubkey::Pubkey, /// Stake authority - pub stake_authority: solana_program::pubkey::Pubkey, + pub stake_authority: solana_pubkey::Pubkey, } impl Merge { - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(&[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(5 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( + accounts.push(solana_instruction::AccountMeta::new( self.destination_stake, false, )); - accounts.push(solana_program::instruction::AccountMeta::new( + accounts.push(solana_instruction::AccountMeta::new( self.source_stake, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.clock_sysvar, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.stake_history, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.stake_authority, true, )); accounts.extend_from_slice(remaining_accounts); - let data = borsh::to_vec(&MergeInstructionData::new()).unwrap(); + let data = MergeInstructionData::new().try_to_vec().unwrap(); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -73,6 +76,10 @@ impl MergeInstructionData { pub fn new() -> Self { Self { discriminator: 7 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for MergeInstructionData { @@ -88,65 +95,57 @@ impl Default for MergeInstructionData { /// 0. `[writable]` destination_stake /// 1. `[writable]` source_stake /// 2. `[optional]` clock_sysvar (default to `SysvarC1ock11111111111111111111111111111111`) -/// 3. `[]` stake_history +/// 3. `[optional]` stake_history (default to `SysvarStakeHistory1111111111111111111111111`) /// 4. `[signer]` stake_authority #[derive(Clone, Debug, Default)] pub struct MergeBuilder { - destination_stake: Option, - source_stake: Option, - clock_sysvar: Option, - stake_history: Option, - stake_authority: Option, - __remaining_accounts: Vec, + destination_stake: Option, + source_stake: Option, + clock_sysvar: Option, + stake_history: Option, + stake_authority: Option, + __remaining_accounts: Vec, } impl MergeBuilder { pub fn new() -> Self { Self::default() } - /// Destination stake account + /// Destination stake account for the merge #[inline(always)] - pub fn destination_stake( - &mut self, - destination_stake: solana_program::pubkey::Pubkey, - ) -> &mut Self { + pub fn destination_stake(&mut self, destination_stake: solana_pubkey::Pubkey) -> &mut Self { self.destination_stake = Some(destination_stake); self } - /// Source stake account + /// Source stake account for to merge. This account will be drained #[inline(always)] - pub fn source_stake(&mut self, source_stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn source_stake(&mut self, source_stake: solana_pubkey::Pubkey) -> &mut Self { self.source_stake = Some(source_stake); self } /// `[optional account, default to 'SysvarC1ock11111111111111111111111111111111']` /// Clock sysvar #[inline(always)] - pub fn clock_sysvar(&mut self, clock_sysvar: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn clock_sysvar(&mut self, clock_sysvar: solana_pubkey::Pubkey) -> &mut Self { self.clock_sysvar = Some(clock_sysvar); self } - /// Stake history sysvar + /// `[optional account, default to 'SysvarStakeHistory1111111111111111111111111']` + /// Stake history sysvar that carries stake warmup/cooldown history #[inline(always)] - pub fn stake_history(&mut self, stake_history: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake_history(&mut self, stake_history: solana_pubkey::Pubkey) -> &mut Self { self.stake_history = Some(stake_history); self } /// Stake authority #[inline(always)] - pub fn stake_authority( - &mut self, - stake_authority: solana_program::pubkey::Pubkey, - ) -> &mut Self { + pub fn stake_authority(&mut self, stake_authority: solana_pubkey::Pubkey) -> &mut Self { self.stake_authority = Some(stake_authority); self } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -154,22 +153,24 @@ impl MergeBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = Merge { destination_stake: self .destination_stake .expect("destination_stake is not set"), source_stake: self.source_stake.expect("source_stake is not set"), - clock_sysvar: self.clock_sysvar.unwrap_or(solana_program::pubkey!( + clock_sysvar: self.clock_sysvar.unwrap_or(solana_pubkey::pubkey!( "SysvarC1ock11111111111111111111111111111111" )), - stake_history: self.stake_history.expect("stake_history is not set"), + stake_history: self.stake_history.unwrap_or(solana_pubkey::pubkey!( + "SysvarStakeHistory1111111111111111111111111" + )), stake_authority: self.stake_authority.expect("stake_authority is not set"), }; @@ -179,37 +180,37 @@ impl MergeBuilder { /// `merge` CPI accounts. pub struct MergeCpiAccounts<'a, 'b> { - /// Destination stake account - pub destination_stake: &'b solana_program::account_info::AccountInfo<'a>, - /// Source stake account - pub source_stake: &'b solana_program::account_info::AccountInfo<'a>, + /// Destination stake account for the merge + pub destination_stake: &'b solana_account_info::AccountInfo<'a>, + /// Source stake account for to merge. This account will be drained + pub source_stake: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, - /// Stake history sysvar - pub stake_history: &'b solana_program::account_info::AccountInfo<'a>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, + /// Stake history sysvar that carries stake warmup/cooldown history + pub stake_history: &'b solana_account_info::AccountInfo<'a>, /// Stake authority - pub stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub stake_authority: &'b solana_account_info::AccountInfo<'a>, } /// `merge` CPI instruction. pub struct MergeCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, - /// Destination stake account - pub destination_stake: &'b solana_program::account_info::AccountInfo<'a>, - /// Source stake account - pub source_stake: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, + /// Destination stake account for the merge + pub destination_stake: &'b solana_account_info::AccountInfo<'a>, + /// Source stake account for to merge. This account will be drained + pub source_stake: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, - /// Stake history sysvar - pub stake_history: &'b solana_program::account_info::AccountInfo<'a>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, + /// Stake history sysvar that carries stake warmup/cooldown history + pub stake_history: &'b solana_account_info::AccountInfo<'a>, /// Stake authority - pub stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub stake_authority: &'b solana_account_info::AccountInfo<'a>, } impl<'a, 'b> MergeCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: MergeCpiAccounts<'a, 'b>, ) -> Self { Self { @@ -222,69 +223,59 @@ impl<'a, 'b> MergeCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(5 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( + accounts.push(solana_instruction::AccountMeta::new( *self.destination_stake.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new( + accounts.push(solana_instruction::AccountMeta::new( *self.source_stake.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.clock_sysvar.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.stake_history.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.stake_authority.key, true, )); remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let data = borsh::to_vec(&MergeInstructionData::new()).unwrap(); + let data = MergeInstructionData::new().try_to_vec().unwrap(); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -301,9 +292,9 @@ impl<'a, 'b> MergeCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -323,7 +314,7 @@ pub struct MergeCpiBuilder<'a, 'b> { } impl<'a, 'b> MergeCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(MergeCpiBuilderInstruction { __program: program, destination_stake: None, @@ -335,20 +326,20 @@ impl<'a, 'b> MergeCpiBuilder<'a, 'b> { }); Self { instruction } } - /// Destination stake account + /// Destination stake account for the merge #[inline(always)] pub fn destination_stake( &mut self, - destination_stake: &'b solana_program::account_info::AccountInfo<'a>, + destination_stake: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.destination_stake = Some(destination_stake); self } - /// Source stake account + /// Source stake account for to merge. This account will be drained #[inline(always)] pub fn source_stake( &mut self, - source_stake: &'b solana_program::account_info::AccountInfo<'a>, + source_stake: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.source_stake = Some(source_stake); self @@ -357,16 +348,16 @@ impl<'a, 'b> MergeCpiBuilder<'a, 'b> { #[inline(always)] pub fn clock_sysvar( &mut self, - clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + clock_sysvar: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.clock_sysvar = Some(clock_sysvar); self } - /// Stake history sysvar + /// Stake history sysvar that carries stake warmup/cooldown history #[inline(always)] pub fn stake_history( &mut self, - stake_history: &'b solana_program::account_info::AccountInfo<'a>, + stake_history: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.stake_history = Some(stake_history); self @@ -375,7 +366,7 @@ impl<'a, 'b> MergeCpiBuilder<'a, 'b> { #[inline(always)] pub fn stake_authority( &mut self, - stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + stake_authority: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.stake_authority = Some(stake_authority); self @@ -384,7 +375,7 @@ impl<'a, 'b> MergeCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -400,11 +391,7 @@ impl<'a, 'b> MergeCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -412,15 +399,12 @@ impl<'a, 'b> MergeCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let instruction = MergeCpi { __program: self.instruction.__program, @@ -458,16 +442,12 @@ impl<'a, 'b> MergeCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct MergeCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - destination_stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - source_stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - clock_sysvar: Option<&'b solana_program::account_info::AccountInfo<'a>>, - stake_history: Option<&'b solana_program::account_info::AccountInfo<'a>>, - stake_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + __program: &'b solana_account_info::AccountInfo<'a>, + destination_stake: Option<&'b solana_account_info::AccountInfo<'a>>, + source_stake: Option<&'b solana_account_info::AccountInfo<'a>>, + clock_sysvar: Option<&'b solana_account_info::AccountInfo<'a>>, + stake_history: Option<&'b solana_account_info::AccountInfo<'a>>, + stake_authority: Option<&'b solana_account_info::AccountInfo<'a>>, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/move_lamports.rs b/clients/rust/src/generated/instructions/move_lamports.rs index cc30b72c..68e75247 100644 --- a/clients/rust/src/generated/instructions/move_lamports.rs +++ b/clients/rust/src/generated/instructions/move_lamports.rs @@ -7,49 +7,52 @@ use borsh::{BorshDeserialize, BorshSerialize}; +pub const MOVE_LAMPORTS_DISCRIMINATOR: u32 = 17; + /// Accounts. #[derive(Debug)] pub struct MoveLamports { /// Active or inactive source stake account - pub source_stake: solana_program::pubkey::Pubkey, + pub source_stake: solana_pubkey::Pubkey, /// Mergeable destination stake account - pub destination_stake: solana_program::pubkey::Pubkey, + pub destination_stake: solana_pubkey::Pubkey, /// Stake authority - pub stake_authority: solana_program::pubkey::Pubkey, + pub stake_authority: solana_pubkey::Pubkey, } impl MoveLamports { pub fn instruction( &self, args: MoveLamportsInstructionArgs, - ) -> solana_program::instruction::Instruction { + ) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(args, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, args: MoveLamportsInstructionArgs, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(3 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( + accounts.push(solana_instruction::AccountMeta::new( self.source_stake, false, )); - accounts.push(solana_program::instruction::AccountMeta::new( + accounts.push(solana_instruction::AccountMeta::new( self.destination_stake, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.stake_authority, true, )); accounts.extend_from_slice(remaining_accounts); - let mut data = borsh::to_vec(&MoveLamportsInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&args).unwrap(); + let mut data = MoveLamportsInstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); data.append(&mut args); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -67,6 +70,10 @@ impl MoveLamportsInstructionData { pub fn new() -> Self { Self { discriminator: 17 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for MoveLamportsInstructionData { @@ -81,6 +88,12 @@ pub struct MoveLamportsInstructionArgs { pub args: u64, } +impl MoveLamportsInstructionArgs { + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } +} + /// Instruction builder for `MoveLamports`. /// /// ### Accounts: @@ -90,11 +103,11 @@ pub struct MoveLamportsInstructionArgs { /// 2. `[signer]` stake_authority #[derive(Clone, Debug, Default)] pub struct MoveLamportsBuilder { - source_stake: Option, - destination_stake: Option, - stake_authority: Option, + source_stake: Option, + destination_stake: Option, + stake_authority: Option, args: Option, - __remaining_accounts: Vec, + __remaining_accounts: Vec, } impl MoveLamportsBuilder { @@ -103,25 +116,19 @@ impl MoveLamportsBuilder { } /// Active or inactive source stake account #[inline(always)] - pub fn source_stake(&mut self, source_stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn source_stake(&mut self, source_stake: solana_pubkey::Pubkey) -> &mut Self { self.source_stake = Some(source_stake); self } /// Mergeable destination stake account #[inline(always)] - pub fn destination_stake( - &mut self, - destination_stake: solana_program::pubkey::Pubkey, - ) -> &mut Self { + pub fn destination_stake(&mut self, destination_stake: solana_pubkey::Pubkey) -> &mut Self { self.destination_stake = Some(destination_stake); self } /// Stake authority #[inline(always)] - pub fn stake_authority( - &mut self, - stake_authority: solana_program::pubkey::Pubkey, - ) -> &mut Self { + pub fn stake_authority(&mut self, stake_authority: solana_pubkey::Pubkey) -> &mut Self { self.stake_authority = Some(stake_authority); self } @@ -132,10 +139,7 @@ impl MoveLamportsBuilder { } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -143,13 +147,13 @@ impl MoveLamportsBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = MoveLamports { source_stake: self.source_stake.expect("source_stake is not set"), destination_stake: self @@ -168,30 +172,30 @@ impl MoveLamportsBuilder { /// `move_lamports` CPI accounts. pub struct MoveLamportsCpiAccounts<'a, 'b> { /// Active or inactive source stake account - pub source_stake: &'b solana_program::account_info::AccountInfo<'a>, + pub source_stake: &'b solana_account_info::AccountInfo<'a>, /// Mergeable destination stake account - pub destination_stake: &'b solana_program::account_info::AccountInfo<'a>, + pub destination_stake: &'b solana_account_info::AccountInfo<'a>, /// Stake authority - pub stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub stake_authority: &'b solana_account_info::AccountInfo<'a>, } /// `move_lamports` CPI instruction. pub struct MoveLamportsCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, /// Active or inactive source stake account - pub source_stake: &'b solana_program::account_info::AccountInfo<'a>, + pub source_stake: &'b solana_account_info::AccountInfo<'a>, /// Mergeable destination stake account - pub destination_stake: &'b solana_program::account_info::AccountInfo<'a>, + pub destination_stake: &'b solana_account_info::AccountInfo<'a>, /// Stake authority - pub stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub stake_authority: &'b solana_account_info::AccountInfo<'a>, /// The arguments for the instruction. pub __args: MoveLamportsInstructionArgs, } impl<'a, 'b> MoveLamportsCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: MoveLamportsCpiAccounts<'a, 'b>, args: MoveLamportsInstructionArgs, ) -> Self { @@ -204,63 +208,53 @@ impl<'a, 'b> MoveLamportsCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(3 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( + accounts.push(solana_instruction::AccountMeta::new( *self.source_stake.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new( + accounts.push(solana_instruction::AccountMeta::new( *self.destination_stake.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.stake_authority.key, true, )); remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let mut data = borsh::to_vec(&MoveLamportsInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&self.__args).unwrap(); + let mut data = MoveLamportsInstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); data.append(&mut args); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -275,9 +269,9 @@ impl<'a, 'b> MoveLamportsCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -295,7 +289,7 @@ pub struct MoveLamportsCpiBuilder<'a, 'b> { } impl<'a, 'b> MoveLamportsCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(MoveLamportsCpiBuilderInstruction { __program: program, source_stake: None, @@ -310,7 +304,7 @@ impl<'a, 'b> MoveLamportsCpiBuilder<'a, 'b> { #[inline(always)] pub fn source_stake( &mut self, - source_stake: &'b solana_program::account_info::AccountInfo<'a>, + source_stake: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.source_stake = Some(source_stake); self @@ -319,7 +313,7 @@ impl<'a, 'b> MoveLamportsCpiBuilder<'a, 'b> { #[inline(always)] pub fn destination_stake( &mut self, - destination_stake: &'b solana_program::account_info::AccountInfo<'a>, + destination_stake: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.destination_stake = Some(destination_stake); self @@ -328,7 +322,7 @@ impl<'a, 'b> MoveLamportsCpiBuilder<'a, 'b> { #[inline(always)] pub fn stake_authority( &mut self, - stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + stake_authority: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.stake_authority = Some(stake_authority); self @@ -342,7 +336,7 @@ impl<'a, 'b> MoveLamportsCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -358,11 +352,7 @@ impl<'a, 'b> MoveLamportsCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -370,15 +360,12 @@ impl<'a, 'b> MoveLamportsCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let args = MoveLamportsInstructionArgs { args: self.instruction.args.clone().expect("args is not set"), }; @@ -410,15 +397,11 @@ impl<'a, 'b> MoveLamportsCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct MoveLamportsCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - source_stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - destination_stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - stake_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + __program: &'b solana_account_info::AccountInfo<'a>, + source_stake: Option<&'b solana_account_info::AccountInfo<'a>>, + destination_stake: Option<&'b solana_account_info::AccountInfo<'a>>, + stake_authority: Option<&'b solana_account_info::AccountInfo<'a>>, args: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/move_stake.rs b/clients/rust/src/generated/instructions/move_stake.rs index c8953253..9e6dfbde 100644 --- a/clients/rust/src/generated/instructions/move_stake.rs +++ b/clients/rust/src/generated/instructions/move_stake.rs @@ -7,49 +7,49 @@ use borsh::{BorshDeserialize, BorshSerialize}; +pub const MOVE_STAKE_DISCRIMINATOR: u32 = 16; + /// Accounts. #[derive(Debug)] pub struct MoveStake { /// Active source stake account - pub source_stake: solana_program::pubkey::Pubkey, + pub source_stake: solana_pubkey::Pubkey, /// Active or inactive destination stake account - pub destination_stake: solana_program::pubkey::Pubkey, + pub destination_stake: solana_pubkey::Pubkey, /// Stake authority - pub stake_authority: solana_program::pubkey::Pubkey, + pub stake_authority: solana_pubkey::Pubkey, } impl MoveStake { - pub fn instruction( - &self, - args: MoveStakeInstructionArgs, - ) -> solana_program::instruction::Instruction { + pub fn instruction(&self, args: MoveStakeInstructionArgs) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(args, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, args: MoveStakeInstructionArgs, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(3 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( + accounts.push(solana_instruction::AccountMeta::new( self.source_stake, false, )); - accounts.push(solana_program::instruction::AccountMeta::new( + accounts.push(solana_instruction::AccountMeta::new( self.destination_stake, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.stake_authority, true, )); accounts.extend_from_slice(remaining_accounts); - let mut data = borsh::to_vec(&MoveStakeInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&args).unwrap(); + let mut data = MoveStakeInstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); data.append(&mut args); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -67,6 +67,10 @@ impl MoveStakeInstructionData { pub fn new() -> Self { Self { discriminator: 16 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for MoveStakeInstructionData { @@ -81,6 +85,12 @@ pub struct MoveStakeInstructionArgs { pub args: u64, } +impl MoveStakeInstructionArgs { + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } +} + /// Instruction builder for `MoveStake`. /// /// ### Accounts: @@ -90,11 +100,11 @@ pub struct MoveStakeInstructionArgs { /// 2. `[signer]` stake_authority #[derive(Clone, Debug, Default)] pub struct MoveStakeBuilder { - source_stake: Option, - destination_stake: Option, - stake_authority: Option, + source_stake: Option, + destination_stake: Option, + stake_authority: Option, args: Option, - __remaining_accounts: Vec, + __remaining_accounts: Vec, } impl MoveStakeBuilder { @@ -103,25 +113,19 @@ impl MoveStakeBuilder { } /// Active source stake account #[inline(always)] - pub fn source_stake(&mut self, source_stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn source_stake(&mut self, source_stake: solana_pubkey::Pubkey) -> &mut Self { self.source_stake = Some(source_stake); self } /// Active or inactive destination stake account #[inline(always)] - pub fn destination_stake( - &mut self, - destination_stake: solana_program::pubkey::Pubkey, - ) -> &mut Self { + pub fn destination_stake(&mut self, destination_stake: solana_pubkey::Pubkey) -> &mut Self { self.destination_stake = Some(destination_stake); self } /// Stake authority #[inline(always)] - pub fn stake_authority( - &mut self, - stake_authority: solana_program::pubkey::Pubkey, - ) -> &mut Self { + pub fn stake_authority(&mut self, stake_authority: solana_pubkey::Pubkey) -> &mut Self { self.stake_authority = Some(stake_authority); self } @@ -132,10 +136,7 @@ impl MoveStakeBuilder { } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -143,13 +144,13 @@ impl MoveStakeBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = MoveStake { source_stake: self.source_stake.expect("source_stake is not set"), destination_stake: self @@ -168,30 +169,30 @@ impl MoveStakeBuilder { /// `move_stake` CPI accounts. pub struct MoveStakeCpiAccounts<'a, 'b> { /// Active source stake account - pub source_stake: &'b solana_program::account_info::AccountInfo<'a>, + pub source_stake: &'b solana_account_info::AccountInfo<'a>, /// Active or inactive destination stake account - pub destination_stake: &'b solana_program::account_info::AccountInfo<'a>, + pub destination_stake: &'b solana_account_info::AccountInfo<'a>, /// Stake authority - pub stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub stake_authority: &'b solana_account_info::AccountInfo<'a>, } /// `move_stake` CPI instruction. pub struct MoveStakeCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, /// Active source stake account - pub source_stake: &'b solana_program::account_info::AccountInfo<'a>, + pub source_stake: &'b solana_account_info::AccountInfo<'a>, /// Active or inactive destination stake account - pub destination_stake: &'b solana_program::account_info::AccountInfo<'a>, + pub destination_stake: &'b solana_account_info::AccountInfo<'a>, /// Stake authority - pub stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub stake_authority: &'b solana_account_info::AccountInfo<'a>, /// The arguments for the instruction. pub __args: MoveStakeInstructionArgs, } impl<'a, 'b> MoveStakeCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: MoveStakeCpiAccounts<'a, 'b>, args: MoveStakeInstructionArgs, ) -> Self { @@ -204,63 +205,53 @@ impl<'a, 'b> MoveStakeCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(3 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( + accounts.push(solana_instruction::AccountMeta::new( *self.source_stake.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new( + accounts.push(solana_instruction::AccountMeta::new( *self.destination_stake.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.stake_authority.key, true, )); remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let mut data = borsh::to_vec(&MoveStakeInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&self.__args).unwrap(); + let mut data = MoveStakeInstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); data.append(&mut args); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -275,9 +266,9 @@ impl<'a, 'b> MoveStakeCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -295,7 +286,7 @@ pub struct MoveStakeCpiBuilder<'a, 'b> { } impl<'a, 'b> MoveStakeCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(MoveStakeCpiBuilderInstruction { __program: program, source_stake: None, @@ -310,7 +301,7 @@ impl<'a, 'b> MoveStakeCpiBuilder<'a, 'b> { #[inline(always)] pub fn source_stake( &mut self, - source_stake: &'b solana_program::account_info::AccountInfo<'a>, + source_stake: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.source_stake = Some(source_stake); self @@ -319,7 +310,7 @@ impl<'a, 'b> MoveStakeCpiBuilder<'a, 'b> { #[inline(always)] pub fn destination_stake( &mut self, - destination_stake: &'b solana_program::account_info::AccountInfo<'a>, + destination_stake: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.destination_stake = Some(destination_stake); self @@ -328,7 +319,7 @@ impl<'a, 'b> MoveStakeCpiBuilder<'a, 'b> { #[inline(always)] pub fn stake_authority( &mut self, - stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + stake_authority: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.stake_authority = Some(stake_authority); self @@ -342,7 +333,7 @@ impl<'a, 'b> MoveStakeCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -358,11 +349,7 @@ impl<'a, 'b> MoveStakeCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -370,15 +357,12 @@ impl<'a, 'b> MoveStakeCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let args = MoveStakeInstructionArgs { args: self.instruction.args.clone().expect("args is not set"), }; @@ -410,15 +394,11 @@ impl<'a, 'b> MoveStakeCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct MoveStakeCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - source_stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - destination_stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - stake_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + __program: &'b solana_account_info::AccountInfo<'a>, + source_stake: Option<&'b solana_account_info::AccountInfo<'a>>, + destination_stake: Option<&'b solana_account_info::AccountInfo<'a>>, + stake_authority: Option<&'b solana_account_info::AccountInfo<'a>>, args: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/set_lockup.rs b/clients/rust/src/generated/instructions/set_lockup.rs index f92de1e9..2d03c567 100644 --- a/clients/rust/src/generated/instructions/set_lockup.rs +++ b/clients/rust/src/generated/instructions/set_lockup.rs @@ -6,46 +6,45 @@ //! use { + crate::generated::types::{Epoch, UnixTimestamp}, borsh::{BorshDeserialize, BorshSerialize}, - solana_program::pubkey::Pubkey, + solana_pubkey::Pubkey, }; +pub const SET_LOCKUP_DISCRIMINATOR: u32 = 6; + /// Accounts. #[derive(Debug)] pub struct SetLockup { /// Initialized stake account - pub stake: solana_program::pubkey::Pubkey, + pub stake: solana_pubkey::Pubkey, /// Lockup authority or withdraw authority - pub authority: solana_program::pubkey::Pubkey, + pub authority: solana_pubkey::Pubkey, } impl SetLockup { - pub fn instruction( - &self, - args: SetLockupInstructionArgs, - ) -> solana_program::instruction::Instruction { + pub fn instruction(&self, args: SetLockupInstructionArgs) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(args, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, args: SetLockupInstructionArgs, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(2 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - self.stake, false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(self.stake, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( self.authority, true, )); accounts.extend_from_slice(remaining_accounts); - let mut data = borsh::to_vec(&SetLockupInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&args).unwrap(); + let mut data = SetLockupInstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); data.append(&mut args); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -63,6 +62,10 @@ impl SetLockupInstructionData { pub fn new() -> Self { Self { discriminator: 6 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for SetLockupInstructionData { @@ -74,11 +77,17 @@ impl Default for SetLockupInstructionData { #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct SetLockupInstructionArgs { - pub unix_timestamp: Option, - pub epoch: Option, + pub unix_timestamp: Option, + pub epoch: Option, pub custodian: Option, } +impl SetLockupInstructionArgs { + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } +} + /// Instruction builder for `SetLockup`. /// /// ### Accounts: @@ -87,12 +96,12 @@ pub struct SetLockupInstructionArgs { /// 1. `[signer]` authority #[derive(Clone, Debug, Default)] pub struct SetLockupBuilder { - stake: Option, - authority: Option, - unix_timestamp: Option, - epoch: Option, + stake: Option, + authority: Option, + unix_timestamp: Option, + epoch: Option, custodian: Option, - __remaining_accounts: Vec, + __remaining_accounts: Vec, } impl SetLockupBuilder { @@ -101,25 +110,25 @@ impl SetLockupBuilder { } /// Initialized stake account #[inline(always)] - pub fn stake(&mut self, stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake(&mut self, stake: solana_pubkey::Pubkey) -> &mut Self { self.stake = Some(stake); self } /// Lockup authority or withdraw authority #[inline(always)] - pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn authority(&mut self, authority: solana_pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } /// `[optional argument]` #[inline(always)] - pub fn unix_timestamp(&mut self, unix_timestamp: i64) -> &mut Self { + pub fn unix_timestamp(&mut self, unix_timestamp: UnixTimestamp) -> &mut Self { self.unix_timestamp = Some(unix_timestamp); self } /// `[optional argument]` #[inline(always)] - pub fn epoch(&mut self, epoch: u64) -> &mut Self { + pub fn epoch(&mut self, epoch: Epoch) -> &mut Self { self.epoch = Some(epoch); self } @@ -131,10 +140,7 @@ impl SetLockupBuilder { } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -142,13 +148,13 @@ impl SetLockupBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = SetLockup { stake: self.stake.expect("stake is not set"), authority: self.authority.expect("authority is not set"), @@ -166,26 +172,26 @@ impl SetLockupBuilder { /// `set_lockup` CPI accounts. pub struct SetLockupCpiAccounts<'a, 'b> { /// Initialized stake account - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Lockup authority or withdraw authority - pub authority: &'b solana_program::account_info::AccountInfo<'a>, + pub authority: &'b solana_account_info::AccountInfo<'a>, } /// `set_lockup` CPI instruction. pub struct SetLockupCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, /// Initialized stake account - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Lockup authority or withdraw authority - pub authority: &'b solana_program::account_info::AccountInfo<'a>, + pub authority: &'b solana_account_info::AccountInfo<'a>, /// The arguments for the instruction. pub __args: SetLockupInstructionArgs, } impl<'a, 'b> SetLockupCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: SetLockupCpiAccounts<'a, 'b>, args: SetLockupInstructionArgs, ) -> Self { @@ -197,59 +203,46 @@ impl<'a, 'b> SetLockupCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(2 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - *self.stake.key, - false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(*self.stake.key, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.authority.key, true, )); remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let mut data = borsh::to_vec(&SetLockupInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&self.__args).unwrap(); + let mut data = SetLockupInstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); data.append(&mut args); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -263,9 +256,9 @@ impl<'a, 'b> SetLockupCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -282,7 +275,7 @@ pub struct SetLockupCpiBuilder<'a, 'b> { } impl<'a, 'b> SetLockupCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(SetLockupCpiBuilderInstruction { __program: program, stake: None, @@ -296,28 +289,25 @@ impl<'a, 'b> SetLockupCpiBuilder<'a, 'b> { } /// Initialized stake account #[inline(always)] - pub fn stake(&mut self, stake: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn stake(&mut self, stake: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.stake = Some(stake); self } /// Lockup authority or withdraw authority #[inline(always)] - pub fn authority( - &mut self, - authority: &'b solana_program::account_info::AccountInfo<'a>, - ) -> &mut Self { + pub fn authority(&mut self, authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.authority = Some(authority); self } /// `[optional argument]` #[inline(always)] - pub fn unix_timestamp(&mut self, unix_timestamp: i64) -> &mut Self { + pub fn unix_timestamp(&mut self, unix_timestamp: UnixTimestamp) -> &mut Self { self.instruction.unix_timestamp = Some(unix_timestamp); self } /// `[optional argument]` #[inline(always)] - pub fn epoch(&mut self, epoch: u64) -> &mut Self { + pub fn epoch(&mut self, epoch: Epoch) -> &mut Self { self.instruction.epoch = Some(epoch); self } @@ -331,7 +321,7 @@ impl<'a, 'b> SetLockupCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -347,11 +337,7 @@ impl<'a, 'b> SetLockupCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -359,15 +345,12 @@ impl<'a, 'b> SetLockupCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let args = SetLockupInstructionArgs { unix_timestamp: self.instruction.unix_timestamp.clone(), epoch: self.instruction.epoch.clone(), @@ -390,16 +373,12 @@ impl<'a, 'b> SetLockupCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct SetLockupCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, - unix_timestamp: Option, - epoch: Option, + __program: &'b solana_account_info::AccountInfo<'a>, + stake: Option<&'b solana_account_info::AccountInfo<'a>>, + authority: Option<&'b solana_account_info::AccountInfo<'a>>, + unix_timestamp: Option, + epoch: Option, custodian: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/set_lockup_checked.rs b/clients/rust/src/generated/instructions/set_lockup_checked.rs index fbfb6125..90e33a22 100644 --- a/clients/rust/src/generated/instructions/set_lockup_checked.rs +++ b/clients/rust/src/generated/instructions/set_lockup_checked.rs @@ -5,52 +5,56 @@ //! //! -use borsh::{BorshDeserialize, BorshSerialize}; +use { + crate::generated::types::{Epoch, UnixTimestamp}, + borsh::{BorshDeserialize, BorshSerialize}, +}; + +pub const SET_LOCKUP_CHECKED_DISCRIMINATOR: u32 = 12; /// Accounts. #[derive(Debug)] pub struct SetLockupChecked { /// Initialized stake account - pub stake: solana_program::pubkey::Pubkey, + pub stake: solana_pubkey::Pubkey, /// Lockup authority or withdraw authority - pub authority: solana_program::pubkey::Pubkey, + pub authority: solana_pubkey::Pubkey, /// New lockup authority - pub new_authority: Option, + pub new_authority: Option, } impl SetLockupChecked { pub fn instruction( &self, args: SetLockupCheckedInstructionArgs, - ) -> solana_program::instruction::Instruction { + ) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(args, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, args: SetLockupCheckedInstructionArgs, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(3 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - self.stake, false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(self.stake, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( self.authority, true, )); if let Some(new_authority) = self.new_authority { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( new_authority, true, )); } accounts.extend_from_slice(remaining_accounts); - let mut data = borsh::to_vec(&SetLockupCheckedInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&args).unwrap(); + let mut data = SetLockupCheckedInstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); data.append(&mut args); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -68,6 +72,10 @@ impl SetLockupCheckedInstructionData { pub fn new() -> Self { Self { discriminator: 12 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for SetLockupCheckedInstructionData { @@ -79,8 +87,14 @@ impl Default for SetLockupCheckedInstructionData { #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct SetLockupCheckedInstructionArgs { - pub unix_timestamp: Option, - pub epoch: Option, + pub unix_timestamp: Option, + pub epoch: Option, +} + +impl SetLockupCheckedInstructionArgs { + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } /// Instruction builder for `SetLockupChecked`. @@ -92,12 +106,12 @@ pub struct SetLockupCheckedInstructionArgs { /// 2. `[signer, optional]` new_authority #[derive(Clone, Debug, Default)] pub struct SetLockupCheckedBuilder { - stake: Option, - authority: Option, - new_authority: Option, - unix_timestamp: Option, - epoch: Option, - __remaining_accounts: Vec, + stake: Option, + authority: Option, + new_authority: Option, + unix_timestamp: Option, + epoch: Option, + __remaining_accounts: Vec, } impl SetLockupCheckedBuilder { @@ -106,44 +120,38 @@ impl SetLockupCheckedBuilder { } /// Initialized stake account #[inline(always)] - pub fn stake(&mut self, stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake(&mut self, stake: solana_pubkey::Pubkey) -> &mut Self { self.stake = Some(stake); self } /// Lockup authority or withdraw authority #[inline(always)] - pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn authority(&mut self, authority: solana_pubkey::Pubkey) -> &mut Self { self.authority = Some(authority); self } /// `[optional account]` /// New lockup authority #[inline(always)] - pub fn new_authority( - &mut self, - new_authority: Option, - ) -> &mut Self { + pub fn new_authority(&mut self, new_authority: Option) -> &mut Self { self.new_authority = new_authority; self } /// `[optional argument]` #[inline(always)] - pub fn unix_timestamp(&mut self, unix_timestamp: i64) -> &mut Self { + pub fn unix_timestamp(&mut self, unix_timestamp: UnixTimestamp) -> &mut Self { self.unix_timestamp = Some(unix_timestamp); self } /// `[optional argument]` #[inline(always)] - pub fn epoch(&mut self, epoch: u64) -> &mut Self { + pub fn epoch(&mut self, epoch: Epoch) -> &mut Self { self.epoch = Some(epoch); self } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -151,13 +159,13 @@ impl SetLockupCheckedBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = SetLockupChecked { stake: self.stake.expect("stake is not set"), authority: self.authority.expect("authority is not set"), @@ -175,30 +183,30 @@ impl SetLockupCheckedBuilder { /// `set_lockup_checked` CPI accounts. pub struct SetLockupCheckedCpiAccounts<'a, 'b> { /// Initialized stake account - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Lockup authority or withdraw authority - pub authority: &'b solana_program::account_info::AccountInfo<'a>, + pub authority: &'b solana_account_info::AccountInfo<'a>, /// New lockup authority - pub new_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + pub new_authority: Option<&'b solana_account_info::AccountInfo<'a>>, } /// `set_lockup_checked` CPI instruction. pub struct SetLockupCheckedCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, /// Initialized stake account - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Lockup authority or withdraw authority - pub authority: &'b solana_program::account_info::AccountInfo<'a>, + pub authority: &'b solana_account_info::AccountInfo<'a>, /// New lockup authority - pub new_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + pub new_authority: Option<&'b solana_account_info::AccountInfo<'a>>, /// The arguments for the instruction. pub __args: SetLockupCheckedInstructionArgs, } impl<'a, 'b> SetLockupCheckedCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: SetLockupCheckedCpiAccounts<'a, 'b>, args: SetLockupCheckedInstructionArgs, ) -> Self { @@ -211,65 +219,52 @@ impl<'a, 'b> SetLockupCheckedCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(3 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - *self.stake.key, - false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(*self.stake.key, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.authority.key, true, )); if let Some(new_authority) = self.new_authority { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *new_authority.key, true, )); } remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let mut data = borsh::to_vec(&SetLockupCheckedInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&self.__args).unwrap(); + let mut data = SetLockupCheckedInstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); data.append(&mut args); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -286,9 +281,9 @@ impl<'a, 'b> SetLockupCheckedCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -306,7 +301,7 @@ pub struct SetLockupCheckedCpiBuilder<'a, 'b> { } impl<'a, 'b> SetLockupCheckedCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(SetLockupCheckedCpiBuilderInstruction { __program: program, stake: None, @@ -320,16 +315,13 @@ impl<'a, 'b> SetLockupCheckedCpiBuilder<'a, 'b> { } /// Initialized stake account #[inline(always)] - pub fn stake(&mut self, stake: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn stake(&mut self, stake: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.stake = Some(stake); self } /// Lockup authority or withdraw authority #[inline(always)] - pub fn authority( - &mut self, - authority: &'b solana_program::account_info::AccountInfo<'a>, - ) -> &mut Self { + pub fn authority(&mut self, authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.authority = Some(authority); self } @@ -338,20 +330,20 @@ impl<'a, 'b> SetLockupCheckedCpiBuilder<'a, 'b> { #[inline(always)] pub fn new_authority( &mut self, - new_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + new_authority: Option<&'b solana_account_info::AccountInfo<'a>>, ) -> &mut Self { self.instruction.new_authority = new_authority; self } /// `[optional argument]` #[inline(always)] - pub fn unix_timestamp(&mut self, unix_timestamp: i64) -> &mut Self { + pub fn unix_timestamp(&mut self, unix_timestamp: UnixTimestamp) -> &mut Self { self.instruction.unix_timestamp = Some(unix_timestamp); self } /// `[optional argument]` #[inline(always)] - pub fn epoch(&mut self, epoch: u64) -> &mut Self { + pub fn epoch(&mut self, epoch: Epoch) -> &mut Self { self.instruction.epoch = Some(epoch); self } @@ -359,7 +351,7 @@ impl<'a, 'b> SetLockupCheckedCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -375,11 +367,7 @@ impl<'a, 'b> SetLockupCheckedCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -387,15 +375,12 @@ impl<'a, 'b> SetLockupCheckedCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let args = SetLockupCheckedInstructionArgs { unix_timestamp: self.instruction.unix_timestamp.clone(), epoch: self.instruction.epoch.clone(), @@ -419,16 +404,12 @@ impl<'a, 'b> SetLockupCheckedCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct SetLockupCheckedCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, - new_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, - unix_timestamp: Option, - epoch: Option, + __program: &'b solana_account_info::AccountInfo<'a>, + stake: Option<&'b solana_account_info::AccountInfo<'a>>, + authority: Option<&'b solana_account_info::AccountInfo<'a>>, + new_authority: Option<&'b solana_account_info::AccountInfo<'a>>, + unix_timestamp: Option, + epoch: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/split.rs b/clients/rust/src/generated/instructions/split.rs index e17198a1..4b646d0f 100644 --- a/clients/rust/src/generated/instructions/split.rs +++ b/clients/rust/src/generated/instructions/split.rs @@ -7,48 +7,46 @@ use borsh::{BorshDeserialize, BorshSerialize}; +pub const SPLIT_DISCRIMINATOR: u32 = 3; + /// Accounts. #[derive(Debug)] pub struct Split { - /// Stake account to be split - pub stake: solana_program::pubkey::Pubkey, - /// Uninitialized stake account - pub split_stake: solana_program::pubkey::Pubkey, + /// Stake account to be split; must be in the Initialized or Stake state + pub stake: solana_pubkey::Pubkey, + /// Uninitialized stake account that will take the split-off amount + pub split_stake: solana_pubkey::Pubkey, /// Stake authority - pub stake_authority: solana_program::pubkey::Pubkey, + pub stake_authority: solana_pubkey::Pubkey, } impl Split { - pub fn instruction( - &self, - args: SplitInstructionArgs, - ) -> solana_program::instruction::Instruction { + pub fn instruction(&self, args: SplitInstructionArgs) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(args, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, args: SplitInstructionArgs, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(3 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - self.stake, false, - )); - accounts.push(solana_program::instruction::AccountMeta::new( + accounts.push(solana_instruction::AccountMeta::new(self.stake, false)); + accounts.push(solana_instruction::AccountMeta::new( self.split_stake, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.stake_authority, true, )); accounts.extend_from_slice(remaining_accounts); - let mut data = borsh::to_vec(&SplitInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&args).unwrap(); + let mut data = SplitInstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); data.append(&mut args); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -66,6 +64,10 @@ impl SplitInstructionData { pub fn new() -> Self { Self { discriminator: 3 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for SplitInstructionData { @@ -80,6 +82,12 @@ pub struct SplitInstructionArgs { pub args: u64, } +impl SplitInstructionArgs { + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } +} + /// Instruction builder for `Split`. /// /// ### Accounts: @@ -89,35 +97,32 @@ pub struct SplitInstructionArgs { /// 2. `[signer]` stake_authority #[derive(Clone, Debug, Default)] pub struct SplitBuilder { - stake: Option, - split_stake: Option, - stake_authority: Option, + stake: Option, + split_stake: Option, + stake_authority: Option, args: Option, - __remaining_accounts: Vec, + __remaining_accounts: Vec, } impl SplitBuilder { pub fn new() -> Self { Self::default() } - /// Stake account to be split + /// Stake account to be split; must be in the Initialized or Stake state #[inline(always)] - pub fn stake(&mut self, stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake(&mut self, stake: solana_pubkey::Pubkey) -> &mut Self { self.stake = Some(stake); self } - /// Uninitialized stake account + /// Uninitialized stake account that will take the split-off amount #[inline(always)] - pub fn split_stake(&mut self, split_stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn split_stake(&mut self, split_stake: solana_pubkey::Pubkey) -> &mut Self { self.split_stake = Some(split_stake); self } /// Stake authority #[inline(always)] - pub fn stake_authority( - &mut self, - stake_authority: solana_program::pubkey::Pubkey, - ) -> &mut Self { + pub fn stake_authority(&mut self, stake_authority: solana_pubkey::Pubkey) -> &mut Self { self.stake_authority = Some(stake_authority); self } @@ -128,10 +133,7 @@ impl SplitBuilder { } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -139,13 +141,13 @@ impl SplitBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = Split { stake: self.stake.expect("stake is not set"), split_stake: self.split_stake.expect("split_stake is not set"), @@ -161,31 +163,31 @@ impl SplitBuilder { /// `split` CPI accounts. pub struct SplitCpiAccounts<'a, 'b> { - /// Stake account to be split - pub stake: &'b solana_program::account_info::AccountInfo<'a>, - /// Uninitialized stake account - pub split_stake: &'b solana_program::account_info::AccountInfo<'a>, + /// Stake account to be split; must be in the Initialized or Stake state + pub stake: &'b solana_account_info::AccountInfo<'a>, + /// Uninitialized stake account that will take the split-off amount + pub split_stake: &'b solana_account_info::AccountInfo<'a>, /// Stake authority - pub stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub stake_authority: &'b solana_account_info::AccountInfo<'a>, } /// `split` CPI instruction. pub struct SplitCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, - /// Stake account to be split - pub stake: &'b solana_program::account_info::AccountInfo<'a>, - /// Uninitialized stake account - pub split_stake: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, + /// Stake account to be split; must be in the Initialized or Stake state + pub stake: &'b solana_account_info::AccountInfo<'a>, + /// Uninitialized stake account that will take the split-off amount + pub split_stake: &'b solana_account_info::AccountInfo<'a>, /// Stake authority - pub stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + pub stake_authority: &'b solana_account_info::AccountInfo<'a>, /// The arguments for the instruction. pub __args: SplitInstructionArgs, } impl<'a, 'b> SplitCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: SplitCpiAccounts<'a, 'b>, args: SplitInstructionArgs, ) -> Self { @@ -198,63 +200,50 @@ impl<'a, 'b> SplitCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(3 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - *self.stake.key, - false, - )); - accounts.push(solana_program::instruction::AccountMeta::new( + accounts.push(solana_instruction::AccountMeta::new(*self.stake.key, false)); + accounts.push(solana_instruction::AccountMeta::new( *self.split_stake.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.stake_authority.key, true, )); remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let mut data = borsh::to_vec(&SplitInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&self.__args).unwrap(); + let mut data = SplitInstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); data.append(&mut args); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -269,9 +258,9 @@ impl<'a, 'b> SplitCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -289,7 +278,7 @@ pub struct SplitCpiBuilder<'a, 'b> { } impl<'a, 'b> SplitCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(SplitCpiBuilderInstruction { __program: program, stake: None, @@ -300,17 +289,17 @@ impl<'a, 'b> SplitCpiBuilder<'a, 'b> { }); Self { instruction } } - /// Stake account to be split + /// Stake account to be split; must be in the Initialized or Stake state #[inline(always)] - pub fn stake(&mut self, stake: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn stake(&mut self, stake: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.stake = Some(stake); self } - /// Uninitialized stake account + /// Uninitialized stake account that will take the split-off amount #[inline(always)] pub fn split_stake( &mut self, - split_stake: &'b solana_program::account_info::AccountInfo<'a>, + split_stake: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.split_stake = Some(split_stake); self @@ -319,7 +308,7 @@ impl<'a, 'b> SplitCpiBuilder<'a, 'b> { #[inline(always)] pub fn stake_authority( &mut self, - stake_authority: &'b solana_program::account_info::AccountInfo<'a>, + stake_authority: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.stake_authority = Some(stake_authority); self @@ -333,7 +322,7 @@ impl<'a, 'b> SplitCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -349,11 +338,7 @@ impl<'a, 'b> SplitCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -361,15 +346,12 @@ impl<'a, 'b> SplitCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let args = SplitInstructionArgs { args: self.instruction.args.clone().expect("args is not set"), }; @@ -398,15 +380,11 @@ impl<'a, 'b> SplitCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct SplitCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - split_stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - stake_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + __program: &'b solana_account_info::AccountInfo<'a>, + stake: Option<&'b solana_account_info::AccountInfo<'a>>, + split_stake: Option<&'b solana_account_info::AccountInfo<'a>>, + stake_authority: Option<&'b solana_account_info::AccountInfo<'a>>, args: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/instructions/withdraw.rs b/clients/rust/src/generated/instructions/withdraw.rs index 7d21b1c2..edb35253 100644 --- a/clients/rust/src/generated/instructions/withdraw.rs +++ b/clients/rust/src/generated/instructions/withdraw.rs @@ -7,68 +7,63 @@ use borsh::{BorshDeserialize, BorshSerialize}; +pub const WITHDRAW_DISCRIMINATOR: u32 = 4; + /// Accounts. #[derive(Debug)] pub struct Withdraw { /// Stake account from which to withdraw - pub stake: solana_program::pubkey::Pubkey, + pub stake: solana_pubkey::Pubkey, /// Recipient account - pub recipient: solana_program::pubkey::Pubkey, + pub recipient: solana_pubkey::Pubkey, /// Clock sysvar - pub clock_sysvar: solana_program::pubkey::Pubkey, - /// Stake history sysvar - pub stake_history: solana_program::pubkey::Pubkey, + pub clock_sysvar: solana_pubkey::Pubkey, + /// Stake history sysvar that carries stake warmup/cooldown history + pub stake_history: solana_pubkey::Pubkey, /// Withdraw authority - pub withdraw_authority: solana_program::pubkey::Pubkey, - /// Lockup authority - pub lockup_authority: Option, + pub withdraw_authority: solana_pubkey::Pubkey, + /// Lockup authority, if before lockup expiration + pub lockup_authority: Option, } impl Withdraw { - pub fn instruction( - &self, - args: WithdrawInstructionArgs, - ) -> solana_program::instruction::Instruction { + pub fn instruction(&self, args: WithdrawInstructionArgs) -> solana_instruction::Instruction { self.instruction_with_remaining_accounts(args, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::vec_init_then_push)] pub fn instruction_with_remaining_accounts( &self, args: WithdrawInstructionArgs, - remaining_accounts: &[solana_program::instruction::AccountMeta], - ) -> solana_program::instruction::Instruction { + remaining_accounts: &[solana_instruction::AccountMeta], + ) -> solana_instruction::Instruction { let mut accounts = Vec::with_capacity(6 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - self.stake, false, - )); - accounts.push(solana_program::instruction::AccountMeta::new( - self.recipient, - false, - )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new(self.stake, false)); + accounts.push(solana_instruction::AccountMeta::new(self.recipient, false)); + accounts.push(solana_instruction::AccountMeta::new_readonly( self.clock_sysvar, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.stake_history, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( self.withdraw_authority, true, )); if let Some(lockup_authority) = self.lockup_authority { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( lockup_authority, true, )); } accounts.extend_from_slice(remaining_accounts); - let mut data = borsh::to_vec(&WithdrawInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&args).unwrap(); + let mut data = WithdrawInstructionData::new().try_to_vec().unwrap(); + let mut args = args.try_to_vec().unwrap(); data.append(&mut args); - solana_program::instruction::Instruction { + solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -86,6 +81,10 @@ impl WithdrawInstructionData { pub fn new() -> Self { Self { discriminator: 4 } } + + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } } impl Default for WithdrawInstructionData { @@ -100,6 +99,12 @@ pub struct WithdrawInstructionArgs { pub args: u64, } +impl WithdrawInstructionArgs { + pub(crate) fn try_to_vec(&self) -> Result, std::io::Error> { + borsh::to_vec(self) + } +} + /// Instruction builder for `Withdraw`. /// /// ### Accounts: @@ -107,19 +112,19 @@ pub struct WithdrawInstructionArgs { /// 0. `[writable]` stake /// 1. `[writable]` recipient /// 2. `[optional]` clock_sysvar (default to `SysvarC1ock11111111111111111111111111111111`) -/// 3. `[]` stake_history +/// 3. `[optional]` stake_history (default to `SysvarStakeHistory1111111111111111111111111`) /// 4. `[signer]` withdraw_authority /// 5. `[signer, optional]` lockup_authority #[derive(Clone, Debug, Default)] pub struct WithdrawBuilder { - stake: Option, - recipient: Option, - clock_sysvar: Option, - stake_history: Option, - withdraw_authority: Option, - lockup_authority: Option, + stake: Option, + recipient: Option, + clock_sysvar: Option, + stake_history: Option, + withdraw_authority: Option, + lockup_authority: Option, args: Option, - __remaining_accounts: Vec, + __remaining_accounts: Vec, } impl WithdrawBuilder { @@ -128,44 +133,42 @@ impl WithdrawBuilder { } /// Stake account from which to withdraw #[inline(always)] - pub fn stake(&mut self, stake: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake(&mut self, stake: solana_pubkey::Pubkey) -> &mut Self { self.stake = Some(stake); self } /// Recipient account #[inline(always)] - pub fn recipient(&mut self, recipient: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn recipient(&mut self, recipient: solana_pubkey::Pubkey) -> &mut Self { self.recipient = Some(recipient); self } /// `[optional account, default to 'SysvarC1ock11111111111111111111111111111111']` /// Clock sysvar #[inline(always)] - pub fn clock_sysvar(&mut self, clock_sysvar: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn clock_sysvar(&mut self, clock_sysvar: solana_pubkey::Pubkey) -> &mut Self { self.clock_sysvar = Some(clock_sysvar); self } - /// Stake history sysvar + /// `[optional account, default to 'SysvarStakeHistory1111111111111111111111111']` + /// Stake history sysvar that carries stake warmup/cooldown history #[inline(always)] - pub fn stake_history(&mut self, stake_history: solana_program::pubkey::Pubkey) -> &mut Self { + pub fn stake_history(&mut self, stake_history: solana_pubkey::Pubkey) -> &mut Self { self.stake_history = Some(stake_history); self } /// Withdraw authority #[inline(always)] - pub fn withdraw_authority( - &mut self, - withdraw_authority: solana_program::pubkey::Pubkey, - ) -> &mut Self { + pub fn withdraw_authority(&mut self, withdraw_authority: solana_pubkey::Pubkey) -> &mut Self { self.withdraw_authority = Some(withdraw_authority); self } /// `[optional account]` - /// Lockup authority + /// Lockup authority, if before lockup expiration #[inline(always)] pub fn lockup_authority( &mut self, - lockup_authority: Option, + lockup_authority: Option, ) -> &mut Self { self.lockup_authority = lockup_authority; self @@ -177,10 +180,7 @@ impl WithdrawBuilder { } /// Add an additional account to the instruction. #[inline(always)] - pub fn add_remaining_account( - &mut self, - account: solana_program::instruction::AccountMeta, - ) -> &mut Self { + pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self { self.__remaining_accounts.push(account); self } @@ -188,20 +188,22 @@ impl WithdrawBuilder { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[solana_program::instruction::AccountMeta], + accounts: &[solana_instruction::AccountMeta], ) -> &mut Self { self.__remaining_accounts.extend_from_slice(accounts); self } #[allow(clippy::clone_on_copy)] - pub fn instruction(&self) -> solana_program::instruction::Instruction { + pub fn instruction(&self) -> solana_instruction::Instruction { let accounts = Withdraw { stake: self.stake.expect("stake is not set"), recipient: self.recipient.expect("recipient is not set"), - clock_sysvar: self.clock_sysvar.unwrap_or(solana_program::pubkey!( + clock_sysvar: self.clock_sysvar.unwrap_or(solana_pubkey::pubkey!( "SysvarC1ock11111111111111111111111111111111" )), - stake_history: self.stake_history.expect("stake_history is not set"), + stake_history: self.stake_history.unwrap_or(solana_pubkey::pubkey!( + "SysvarStakeHistory1111111111111111111111111" + )), withdraw_authority: self .withdraw_authority .expect("withdraw_authority is not set"), @@ -218,42 +220,42 @@ impl WithdrawBuilder { /// `withdraw` CPI accounts. pub struct WithdrawCpiAccounts<'a, 'b> { /// Stake account from which to withdraw - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Recipient account - pub recipient: &'b solana_program::account_info::AccountInfo<'a>, + pub recipient: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, - /// Stake history sysvar - pub stake_history: &'b solana_program::account_info::AccountInfo<'a>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, + /// Stake history sysvar that carries stake warmup/cooldown history + pub stake_history: &'b solana_account_info::AccountInfo<'a>, /// Withdraw authority - pub withdraw_authority: &'b solana_program::account_info::AccountInfo<'a>, - /// Lockup authority - pub lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + pub withdraw_authority: &'b solana_account_info::AccountInfo<'a>, + /// Lockup authority, if before lockup expiration + pub lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, } /// `withdraw` CPI instruction. pub struct WithdrawCpi<'a, 'b> { /// The program to invoke. - pub __program: &'b solana_program::account_info::AccountInfo<'a>, + pub __program: &'b solana_account_info::AccountInfo<'a>, /// Stake account from which to withdraw - pub stake: &'b solana_program::account_info::AccountInfo<'a>, + pub stake: &'b solana_account_info::AccountInfo<'a>, /// Recipient account - pub recipient: &'b solana_program::account_info::AccountInfo<'a>, + pub recipient: &'b solana_account_info::AccountInfo<'a>, /// Clock sysvar - pub clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, - /// Stake history sysvar - pub stake_history: &'b solana_program::account_info::AccountInfo<'a>, + pub clock_sysvar: &'b solana_account_info::AccountInfo<'a>, + /// Stake history sysvar that carries stake warmup/cooldown history + pub stake_history: &'b solana_account_info::AccountInfo<'a>, /// Withdraw authority - pub withdraw_authority: &'b solana_program::account_info::AccountInfo<'a>, - /// Lockup authority - pub lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + pub withdraw_authority: &'b solana_account_info::AccountInfo<'a>, + /// Lockup authority, if before lockup expiration + pub lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, /// The arguments for the instruction. pub __args: WithdrawInstructionArgs, } impl<'a, 'b> WithdrawCpi<'a, 'b> { pub fn new( - program: &'b solana_program::account_info::AccountInfo<'a>, + program: &'b solana_account_info::AccountInfo<'a>, accounts: WithdrawCpiAccounts<'a, 'b>, args: WithdrawInstructionArgs, ) -> Self { @@ -269,77 +271,64 @@ impl<'a, 'b> WithdrawCpi<'a, 'b> { } } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], &[]) } #[inline(always)] pub fn invoke_with_remaining_accounts( &self, - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(&[], remaining_accounts) } #[inline(always)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { self.invoke_signed_with_remaining_accounts(signers_seeds, &[]) } + #[allow(clippy::arithmetic_side_effects)] #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] pub fn invoke_signed_with_remaining_accounts( &self, signers_seeds: &[&[&[u8]]], - remaining_accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], - ) -> solana_program::entrypoint::ProgramResult { + remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], + ) -> solana_program_error::ProgramResult { let mut accounts = Vec::with_capacity(6 + remaining_accounts.len()); - accounts.push(solana_program::instruction::AccountMeta::new( - *self.stake.key, - false, - )); - accounts.push(solana_program::instruction::AccountMeta::new( + accounts.push(solana_instruction::AccountMeta::new(*self.stake.key, false)); + accounts.push(solana_instruction::AccountMeta::new( *self.recipient.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.clock_sysvar.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.stake_history.key, false, )); - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *self.withdraw_authority.key, true, )); if let Some(lockup_authority) = self.lockup_authority { - accounts.push(solana_program::instruction::AccountMeta::new_readonly( + accounts.push(solana_instruction::AccountMeta::new_readonly( *lockup_authority.key, true, )); } remaining_accounts.iter().for_each(|remaining_account| { - accounts.push(solana_program::instruction::AccountMeta { + accounts.push(solana_instruction::AccountMeta { pubkey: *remaining_account.0.key, is_signer: remaining_account.1, is_writable: remaining_account.2, }) }); - let mut data = borsh::to_vec(&WithdrawInstructionData::new()).unwrap(); - let mut args = borsh::to_vec(&self.__args).unwrap(); + let mut data = WithdrawInstructionData::new().try_to_vec().unwrap(); + let mut args = self.__args.try_to_vec().unwrap(); data.append(&mut args); - let instruction = solana_program::instruction::Instruction { + let instruction = solana_instruction::Instruction { program_id: crate::STAKE_ID, accounts, data, @@ -359,9 +348,9 @@ impl<'a, 'b> WithdrawCpi<'a, 'b> { .for_each(|remaining_account| account_infos.push(remaining_account.0.clone())); if signers_seeds.is_empty() { - solana_program::program::invoke(&instruction, &account_infos) + solana_cpi::invoke(&instruction, &account_infos) } else { - solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds) + solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds) } } } @@ -382,7 +371,7 @@ pub struct WithdrawCpiBuilder<'a, 'b> { } impl<'a, 'b> WithdrawCpiBuilder<'a, 'b> { - pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self { + pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self { let instruction = Box::new(WithdrawCpiBuilderInstruction { __program: program, stake: None, @@ -398,16 +387,13 @@ impl<'a, 'b> WithdrawCpiBuilder<'a, 'b> { } /// Stake account from which to withdraw #[inline(always)] - pub fn stake(&mut self, stake: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self { + pub fn stake(&mut self, stake: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.stake = Some(stake); self } /// Recipient account #[inline(always)] - pub fn recipient( - &mut self, - recipient: &'b solana_program::account_info::AccountInfo<'a>, - ) -> &mut Self { + pub fn recipient(&mut self, recipient: &'b solana_account_info::AccountInfo<'a>) -> &mut Self { self.instruction.recipient = Some(recipient); self } @@ -415,16 +401,16 @@ impl<'a, 'b> WithdrawCpiBuilder<'a, 'b> { #[inline(always)] pub fn clock_sysvar( &mut self, - clock_sysvar: &'b solana_program::account_info::AccountInfo<'a>, + clock_sysvar: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.clock_sysvar = Some(clock_sysvar); self } - /// Stake history sysvar + /// Stake history sysvar that carries stake warmup/cooldown history #[inline(always)] pub fn stake_history( &mut self, - stake_history: &'b solana_program::account_info::AccountInfo<'a>, + stake_history: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.stake_history = Some(stake_history); self @@ -433,17 +419,17 @@ impl<'a, 'b> WithdrawCpiBuilder<'a, 'b> { #[inline(always)] pub fn withdraw_authority( &mut self, - withdraw_authority: &'b solana_program::account_info::AccountInfo<'a>, + withdraw_authority: &'b solana_account_info::AccountInfo<'a>, ) -> &mut Self { self.instruction.withdraw_authority = Some(withdraw_authority); self } /// `[optional account]` - /// Lockup authority + /// Lockup authority, if before lockup expiration #[inline(always)] pub fn lockup_authority( &mut self, - lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, ) -> &mut Self { self.instruction.lockup_authority = lockup_authority; self @@ -457,7 +443,7 @@ impl<'a, 'b> WithdrawCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_account( &mut self, - account: &'b solana_program::account_info::AccountInfo<'a>, + account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool, ) -> &mut Self { @@ -473,11 +459,7 @@ impl<'a, 'b> WithdrawCpiBuilder<'a, 'b> { #[inline(always)] pub fn add_remaining_accounts( &mut self, - accounts: &[( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )], + accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)], ) -> &mut Self { self.instruction .__remaining_accounts @@ -485,15 +467,12 @@ impl<'a, 'b> WithdrawCpiBuilder<'a, 'b> { self } #[inline(always)] - pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult { + pub fn invoke(&self) -> solana_program_error::ProgramResult { self.invoke_signed(&[]) } #[allow(clippy::clone_on_copy)] #[allow(clippy::vec_init_then_push)] - pub fn invoke_signed( - &self, - signers_seeds: &[&[&[u8]]], - ) -> solana_program::entrypoint::ProgramResult { + pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult { let args = WithdrawInstructionArgs { args: self.instruction.args.clone().expect("args is not set"), }; @@ -531,18 +510,14 @@ impl<'a, 'b> WithdrawCpiBuilder<'a, 'b> { #[derive(Clone, Debug)] struct WithdrawCpiBuilderInstruction<'a, 'b> { - __program: &'b solana_program::account_info::AccountInfo<'a>, - stake: Option<&'b solana_program::account_info::AccountInfo<'a>>, - recipient: Option<&'b solana_program::account_info::AccountInfo<'a>>, - clock_sysvar: Option<&'b solana_program::account_info::AccountInfo<'a>>, - stake_history: Option<&'b solana_program::account_info::AccountInfo<'a>>, - withdraw_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, - lockup_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>, + __program: &'b solana_account_info::AccountInfo<'a>, + stake: Option<&'b solana_account_info::AccountInfo<'a>>, + recipient: Option<&'b solana_account_info::AccountInfo<'a>>, + clock_sysvar: Option<&'b solana_account_info::AccountInfo<'a>>, + stake_history: Option<&'b solana_account_info::AccountInfo<'a>>, + withdraw_authority: Option<&'b solana_account_info::AccountInfo<'a>>, + lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>, args: Option, /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`. - __remaining_accounts: Vec<( - &'b solana_program::account_info::AccountInfo<'a>, - bool, - bool, - )>, + __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>, } diff --git a/clients/rust/src/generated/programs.rs b/clients/rust/src/generated/programs.rs index e3286ac3..f9d1f59f 100644 --- a/clients/rust/src/generated/programs.rs +++ b/clients/rust/src/generated/programs.rs @@ -5,7 +5,7 @@ //! //! -use solana_program::{pubkey, pubkey::Pubkey}; +use solana_pubkey::{pubkey, Pubkey}; /// `stake` program ID. pub const STAKE_ID: Pubkey = pubkey!("Stake11111111111111111111111111111111111111"); diff --git a/clients/rust/src/generated/types/authorized.rs b/clients/rust/src/generated/types/authorized.rs index e6406ae9..03d3bfbe 100644 --- a/clients/rust/src/generated/types/authorized.rs +++ b/clients/rust/src/generated/types/authorized.rs @@ -7,7 +7,7 @@ use { borsh::{BorshDeserialize, BorshSerialize}, - solana_program::pubkey::Pubkey, + solana_pubkey::Pubkey, }; #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, PartialEq)] diff --git a/clients/rust/src/generated/types/delegation.rs b/clients/rust/src/generated/types/delegation.rs index a9066b51..67195f5d 100644 --- a/clients/rust/src/generated/types/delegation.rs +++ b/clients/rust/src/generated/types/delegation.rs @@ -6,8 +6,9 @@ //! use { + crate::generated::types::Epoch, borsh::{BorshDeserialize, BorshSerialize}, - solana_program::pubkey::Pubkey, + solana_pubkey::Pubkey, }; #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, PartialEq)] @@ -19,7 +20,7 @@ pub struct Delegation { )] pub voter_pubkey: Pubkey, pub stake: u64, - pub activation_epoch: u64, - pub deactivation_epoch: u64, + pub activation_epoch: Epoch, + pub deactivation_epoch: Epoch, pub warmup_cooldown_rate: f64, } diff --git a/clients/rust/src/generated/types/epoch.rs b/clients/rust/src/generated/types/epoch.rs new file mode 100644 index 00000000..0060ad16 --- /dev/null +++ b/clients/rust/src/generated/types/epoch.rs @@ -0,0 +1,8 @@ +//! This code was AUTOGENERATED using the codama library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun codama to update it. +//! +//! +//! + +pub type Epoch = u64; diff --git a/clients/rust/src/generated/types/lockup.rs b/clients/rust/src/generated/types/lockup.rs index c25a723f..906b9fa7 100644 --- a/clients/rust/src/generated/types/lockup.rs +++ b/clients/rust/src/generated/types/lockup.rs @@ -6,15 +6,16 @@ //! use { + crate::generated::types::{Epoch, UnixTimestamp}, borsh::{BorshDeserialize, BorshSerialize}, - solana_program::pubkey::Pubkey, + solana_pubkey::Pubkey, }; #[derive(BorshSerialize, BorshDeserialize, Clone, Debug, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Lockup { - pub unix_timestamp: i64, - pub epoch: u64, + pub unix_timestamp: UnixTimestamp, + pub epoch: Epoch, #[cfg_attr( feature = "serde", serde(with = "serde_with::As::") diff --git a/clients/rust/src/generated/types/mod.rs b/clients/rust/src/generated/types/mod.rs index 41560dee..052ebd93 100644 --- a/clients/rust/src/generated/types/mod.rs +++ b/clients/rust/src/generated/types/mod.rs @@ -7,6 +7,7 @@ pub(crate) mod r#authorized; pub(crate) mod r#delegation; +pub(crate) mod r#epoch; pub(crate) mod r#lockup; pub(crate) mod r#meta; pub(crate) mod r#stake; @@ -14,8 +15,10 @@ pub(crate) mod r#stake_authorize; pub(crate) mod r#stake_flags; pub(crate) mod r#stake_state; pub(crate) mod r#stake_state_v2; +pub(crate) mod r#unix_timestamp; pub use self::{ - r#authorized::*, r#delegation::*, r#lockup::*, r#meta::*, r#stake::*, r#stake_authorize::*, - r#stake_flags::*, r#stake_state::*, r#stake_state_v2::*, + r#authorized::*, r#delegation::*, r#epoch::*, r#lockup::*, r#meta::*, r#stake::*, + r#stake_authorize::*, r#stake_flags::*, r#stake_state::*, r#stake_state_v2::*, + r#unix_timestamp::*, }; diff --git a/clients/rust/src/generated/types/unix_timestamp.rs b/clients/rust/src/generated/types/unix_timestamp.rs new file mode 100644 index 00000000..62d0860b --- /dev/null +++ b/clients/rust/src/generated/types/unix_timestamp.rs @@ -0,0 +1,8 @@ +//! This code was AUTOGENERATED using the codama library. +//! Please DO NOT EDIT THIS FILE, instead use visitors +//! to add features, then rerun codama to update it. +//! +//! +//! + +pub type UnixTimestamp = i64; diff --git a/clients/rust/src/hooked/stake_state_account.rs b/clients/rust/src/hooked/stake_state_account.rs index 640ef03b..360b3c54 100644 --- a/clients/rust/src/hooked/stake_state_account.rs +++ b/clients/rust/src/hooked/stake_state_account.rs @@ -106,12 +106,10 @@ impl StakeStateAccount { } } -impl<'a> TryFrom<&solana_program::account_info::AccountInfo<'a>> for StakeStateAccount { +impl<'a> TryFrom<&solana_account_info::AccountInfo<'a>> for StakeStateAccount { type Error = std::io::Error; - fn try_from( - account_info: &solana_program::account_info::AccountInfo<'a>, - ) -> Result { + fn try_from(account_info: &solana_account_info::AccountInfo<'a>) -> Result { let mut data: &[u8] = &(*account_info.data).borrow(); Self::deserialize(&mut data) } diff --git a/codama.json b/codama.json new file mode 100644 index 00000000..ca9ea06e --- /dev/null +++ b/codama.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://codama.gg/schemas/codama.json", + "idls": [ + { + "path": "interface/idl.json", + "format": "codama" + } + ], + "generators": [ + { + "generator": "@codama/renderers-js", + "path": "clients/js/src/generated" + }, + { + "generator": "@codama/renderers-rust", + "path": "clients/rust/src/generated" + } + ] +} + diff --git a/interface/Cargo.toml b/interface/Cargo.toml index f91d225d..2a534a0e 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -18,6 +18,8 @@ program-id = "Stake11111111111111111111111111111111111111" [dependencies] borsh = { version = "1.5.7", features = ["derive", "unstable__schema"], optional = true } +codama = { version = "0.7.0", optional = true, git = "https://github.com/rustopian/codama-rs.git", branch = "multiple-attributes" } +codama-macros = { version = "0.7.0", optional = true, git = "https://github.com/rustopian/codama-rs.git", branch = "multiple-attributes" } num-traits = "0.2" serde = { version = "1.0.210", optional = true } serde_derive = { version = "1.0.210", optional = true } @@ -32,6 +34,9 @@ solana-system-interface = "2.0.0" solana-sysvar = { version = "3.0.0", optional = true } solana-sysvar-id = { version = "3.0.0", optional = true } +[target.'cfg(not(target_os = "solana"))'.dependencies] +serde_json = { version = "1.0", optional = true } + [dev-dependencies] anyhow = "1" assert_matches = "1.5.0" @@ -67,6 +72,7 @@ borsh = [ "solana-program-error/borsh", "solana-pubkey/borsh" ] +codama = ["dep:codama", "dep:codama-macros", "dep:serde_json"] frozen-abi = [ "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", diff --git a/interface/idl.json b/interface/idl.json index 87cf2042..b329bed8 100644 --- a/interface/idl.json +++ b/interface/idl.json @@ -1,1078 +1,1853 @@ { - "version": "0.1.0", - "name": "solana_stake_interface", - "instructions": [ - { - "name": "Initialize", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "docs": [ - "Uninitialized stake account" - ] - }, - { - "name": "rentSysvar", - "isMut": false, - "isSigner": false, - "docs": [ - "Rent sysvar" - ] + "additionalPrograms": [], + "kind": "rootNode", + "program": { + "accounts": [], + "definedTypes": [ + { + "kind": "definedTypeNode", + "name": "lockupParams", + "type": { + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "unixTimestamp", + "type": { + "item": { + "kind": "definedTypeLinkNode", + "name": "unixTimestamp" + }, + "kind": "optionTypeNode", + "prefix": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "epoch", + "type": { + "item": { + "kind": "definedTypeLinkNode", + "name": "epoch" + }, + "kind": "optionTypeNode", + "prefix": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "custodian", + "type": { + "item": { + "kind": "publicKeyTypeNode" + }, + "kind": "optionTypeNode", + "prefix": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } + } + } + ], + "kind": "structTypeNode" } - ], - "args": [ - { - "name": "arg0", - "type": { - "defined": "Authorized" - } - }, - { - "name": "arg1", - "type": { - "defined": "Lockup" - } + }, + { + "kind": "definedTypeNode", + "name": "lockupCheckedParams", + "type": { + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "unixTimestamp", + "type": { + "item": { + "kind": "definedTypeLinkNode", + "name": "unixTimestamp" + }, + "kind": "optionTypeNode", + "prefix": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "epoch", + "type": { + "item": { + "kind": "definedTypeLinkNode", + "name": "epoch" + }, + "kind": "optionTypeNode", + "prefix": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } + } + } + ], + "kind": "structTypeNode" } - ], - "discriminant": { - "type": "u32", - "value": 0 - } - }, - { - "name": "Authorize", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "docs": [ - "Stake account to be updated" - ] - }, - { - "name": "clockSysvar", - "isMut": false, - "isSigner": false, - "docs": [ - "Clock sysvar" - ] - }, - { - "name": "authority", - "isMut": false, - "isSigner": true, - "docs": [ - "Stake or withdraw authority" - ] - }, - { - "name": "lockupAuthority", - "isMut": false, - "isSigner": true, - "isOptional": true, - "docs": [ - "Lockup authority" - ] + }, + { + "kind": "definedTypeNode", + "name": "authorizeWithSeedParams", + "type": { + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "newAuthorizedPubkey", + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "stakeAuthorize", + "type": { + "kind": "definedTypeLinkNode", + "name": "stakeAuthorize" + } + }, + { + "kind": "structFieldTypeNode", + "name": "authoritySeed", + "type": { + "kind": "sizePrefixTypeNode", + "prefix": { + "endian": "le", + "format": "u32", + "kind": "numberTypeNode" + }, + "type": { + "encoding": "utf8", + "kind": "stringTypeNode" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorityOwner", + "type": { + "kind": "publicKeyTypeNode" + } + } + ], + "kind": "structTypeNode" } - ], - "args": [ - { - "name": "arg0", - "type": "publicKey" - }, - { - "name": "arg1", - "type": { - "defined": "StakeAuthorize" - } + }, + { + "kind": "definedTypeNode", + "name": "authorizeCheckedWithSeedParams", + "type": { + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "stakeAuthorize", + "type": { + "kind": "definedTypeLinkNode", + "name": "stakeAuthorize" + } + }, + { + "kind": "structFieldTypeNode", + "name": "authoritySeed", + "type": { + "kind": "sizePrefixTypeNode", + "prefix": { + "endian": "le", + "format": "u32", + "kind": "numberTypeNode" + }, + "type": { + "encoding": "utf8", + "kind": "stringTypeNode" + } + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorityOwner", + "type": { + "kind": "publicKeyTypeNode" + } + } + ], + "kind": "structTypeNode" } - ], - "discriminant": { - "type": "u32", - "value": 1 - } - }, - { - "name": "DelegateStake", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "docs": [ - "Initialized stake account to be delegated" - ] - }, - { - "name": "vote", - "isMut": false, - "isSigner": false, - "docs": [ - "Vote account to which this stake will be delegated" - ] - }, - { - "name": "clockSysvar", - "isMut": false, - "isSigner": false, - "docs": [ - "Clock sysvar" - ] - }, - { - "name": "stakeHistory", - "isMut": false, - "isSigner": false, - "docs": [ - "Stake history sysvar" - ] - }, - { - "name": "unused", - "isMut": false, - "isSigner": false, - "docs": [ - "Unused account, formerly the stake config" - ] - }, - { - "name": "stakeAuthority", - "isMut": false, - "isSigner": true, - "docs": [ - "Stake authority" - ] + }, + { + "kind": "definedTypeNode", + "name": "stakeFlags", + "type": { + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "bits", + "type": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } + } + ], + "kind": "structTypeNode" } - ], - "args": [], - "discriminant": { - "type": "u32", - "value": 2 - } - }, - { - "name": "Split", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "docs": [ - "Stake account to be split" - ] - }, - { - "name": "splitStake", - "isMut": true, - "isSigner": false, - "docs": [ - "Uninitialized stake account" - ] - }, - { - "name": "stakeAuthority", - "isMut": false, - "isSigner": true, - "docs": [ - "Stake authority" + }, + { + "kind": "definedTypeNode", + "name": "stakeState", + "type": { + "kind": "enumTypeNode", + "size": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + }, + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "uninitialized" + }, + { + "kind": "enumTupleVariantTypeNode", + "name": "initialized", + "tuple": { + "items": [ + { + "kind": "definedTypeLinkNode", + "name": "meta" + } + ], + "kind": "tupleTypeNode" + } + }, + { + "kind": "enumTupleVariantTypeNode", + "name": "stake", + "tuple": { + "items": [ + { + "kind": "definedTypeLinkNode", + "name": "meta" + }, + { + "kind": "definedTypeLinkNode", + "name": "stake" + } + ], + "kind": "tupleTypeNode" + } + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "rewardsPool" + } ] } - ], - "args": [ - { - "name": "args", - "type": "u64" - } - ], - "discriminant": { - "type": "u32", - "value": 3 - } - }, - { - "name": "Withdraw", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "docs": [ - "Stake account from which to withdraw" - ] - }, - { - "name": "recipient", - "isMut": true, - "isSigner": false, - "docs": [ - "Recipient account" - ] - }, - { - "name": "clockSysvar", - "isMut": false, - "isSigner": false, - "docs": [ - "Clock sysvar" - ] - }, - { - "name": "stakeHistory", - "isMut": false, - "isSigner": false, - "docs": [ - "Stake history sysvar" - ] - }, - { - "name": "withdrawAuthority", - "isMut": false, - "isSigner": true, - "docs": [ - "Withdraw authority" - ] - }, - { - "name": "lockupAuthority", - "isMut": false, - "isSigner": true, - "isOptional": true, - "docs": [ - "Lockup authority" + }, + { + "kind": "definedTypeNode", + "name": "stakeStateV2", + "type": { + "kind": "enumTypeNode", + "size": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + }, + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "uninitialized" + }, + { + "kind": "enumTupleVariantTypeNode", + "name": "initialized", + "tuple": { + "items": [ + { + "kind": "definedTypeLinkNode", + "name": "meta" + } + ], + "kind": "tupleTypeNode" + } + }, + { + "kind": "enumTupleVariantTypeNode", + "name": "stake", + "tuple": { + "items": [ + { + "kind": "definedTypeLinkNode", + "name": "meta" + }, + { + "kind": "definedTypeLinkNode", + "name": "stake" + }, + { + "kind": "definedTypeLinkNode", + "name": "stakeFlags" + } + ], + "kind": "tupleTypeNode" + } + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "rewardsPool" + } ] } - ], - "args": [ - { - "name": "args", - "type": "u64" - } - ], - "discriminant": { - "type": "u32", - "value": 4 - } - }, - { - "name": "Deactivate", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "docs": [ - "Delegated stake account" - ] - }, - { - "name": "clockSysvar", - "isMut": false, - "isSigner": false, - "docs": [ - "Clock sysvar" - ] - }, - { - "name": "stakeAuthority", - "isMut": false, - "isSigner": true, - "docs": [ - "Stake authority" + }, + { + "kind": "definedTypeNode", + "name": "stakeAuthorize", + "type": { + "kind": "enumTypeNode", + "size": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + }, + "variants": [ + { + "kind": "enumEmptyVariantTypeNode", + "name": "staker" + }, + { + "kind": "enumEmptyVariantTypeNode", + "name": "withdrawer" + } ] } - ], - "args": [], - "discriminant": { - "type": "u32", - "value": 5 - } - }, - { - "name": "SetLockup", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "docs": [ - "Initialized stake account" - ] - }, - { - "name": "authority", - "isMut": false, - "isSigner": true, - "docs": [ - "Lockup authority or withdraw authority" - ] + }, + { + "kind": "definedTypeNode", + "name": "lockup", + "type": { + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "unixTimestamp", + "type": { + "kind": "definedTypeLinkNode", + "name": "unixTimestamp" + } + }, + { + "kind": "structFieldTypeNode", + "name": "epoch", + "type": { + "kind": "definedTypeLinkNode", + "name": "epoch" + } + }, + { + "kind": "structFieldTypeNode", + "name": "custodian", + "type": { + "kind": "publicKeyTypeNode" + } + } + ], + "kind": "structTypeNode" } - ], - "args": [ - { - "name": "lockupArgs", - "type": { - "defined": "LockupArgs" - } + }, + { + "kind": "definedTypeNode", + "name": "authorized", + "type": { + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "staker", + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "withdrawer", + "type": { + "kind": "publicKeyTypeNode" + } + } + ], + "kind": "structTypeNode" } - ], - "discriminant": { - "type": "u32", - "value": 6 - } - }, - { - "name": "Merge", - "accounts": [ - { - "name": "destinationStake", - "isMut": true, - "isSigner": false, - "docs": [ - "Destination stake account" - ] - }, - { - "name": "sourceStake", - "isMut": true, - "isSigner": false, - "docs": [ - "Source stake account" - ] - }, - { - "name": "clockSysvar", - "isMut": false, - "isSigner": false, - "docs": [ - "Clock sysvar" - ] - }, - { - "name": "stakeHistory", - "isMut": false, - "isSigner": false, - "docs": [ - "Stake history sysvar" - ] - }, - { - "name": "stakeAuthority", - "isMut": false, - "isSigner": true, - "docs": [ - "Stake authority" - ] + }, + { + "kind": "definedTypeNode", + "name": "meta", + "type": { + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "rentExemptReserve", + "type": { + "endian": "le", + "format": "u64", + "kind": "numberTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "authorized", + "type": { + "kind": "definedTypeLinkNode", + "name": "authorized" + } + }, + { + "kind": "structFieldTypeNode", + "name": "lockup", + "type": { + "kind": "definedTypeLinkNode", + "name": "lockup" + } + } + ], + "kind": "structTypeNode" } - ], - "args": [], - "discriminant": { - "type": "u32", - "value": 7 - } - }, - { - "name": "AuthorizeWithSeed", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "docs": [ - "Stake account to be updated" - ] - }, - { - "name": "base", - "isMut": false, - "isSigner": true, - "docs": [ - "Base key of stake or withdraw authority" - ] - }, - { - "name": "clockSysvar", - "isMut": false, - "isSigner": false, - "docs": [ - "Clock sysvar" - ] - }, - { - "name": "lockupAuthority", - "isMut": false, - "isSigner": true, - "isOptional": true, - "docs": [ - "Lockup authority" - ] + }, + { + "kind": "definedTypeNode", + "name": "delegation", + "type": { + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "voterPubkey", + "type": { + "kind": "publicKeyTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "stake", + "type": { + "endian": "le", + "format": "u64", + "kind": "numberTypeNode" + } + }, + { + "kind": "structFieldTypeNode", + "name": "activationEpoch", + "type": { + "kind": "definedTypeLinkNode", + "name": "epoch" + } + }, + { + "kind": "structFieldTypeNode", + "name": "deactivationEpoch", + "type": { + "kind": "definedTypeLinkNode", + "name": "epoch" + } + }, + { + "kind": "structFieldTypeNode", + "name": "warmupCooldownRate", + "type": { + "endian": "le", + "format": "f64", + "kind": "numberTypeNode" + } + } + ], + "kind": "structTypeNode" } - ], - "args": [ - { - "name": "authorizeWithSeedArgs", - "type": { - "defined": "AuthorizeWithSeedArgs" - } + }, + { + "kind": "definedTypeNode", + "name": "stake", + "type": { + "fields": [ + { + "kind": "structFieldTypeNode", + "name": "delegation", + "type": { + "kind": "definedTypeLinkNode", + "name": "delegation" + } + }, + { + "kind": "structFieldTypeNode", + "name": "creditsObserved", + "type": { + "endian": "le", + "format": "u64", + "kind": "numberTypeNode" + } + } + ], + "kind": "structTypeNode" } - ], - "discriminant": { - "type": "u32", - "value": 8 } - }, - { - "name": "InitializeChecked", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "docs": [ - "Uninitialized stake account" - ] - }, - { - "name": "rentSysvar", - "isMut": false, - "isSigner": false, - "docs": [ - "Rent sysvar" - ] - }, - { - "name": "stakeAuthority", - "isMut": false, - "isSigner": false, - "docs": [ - "The stake authority" - ] - }, - { - "name": "withdrawAuthority", - "isMut": false, - "isSigner": true, - "docs": [ - "The withdraw authority" - ] - } - ], - "args": [], - "discriminant": { - "type": "u32", - "value": 9 + ], + "errors": [ + { + "code": 0, + "kind": "errorNode", + "message": "Not enough credits to redeem", + "name": "noCreditsToRedeem" + }, + { + "code": 1, + "kind": "errorNode", + "message": "Lockup has not yet expired", + "name": "lockupInForce" + }, + { + "code": 2, + "kind": "errorNode", + "message": "Stake already deactivated", + "name": "alreadyDeactivated" + }, + { + "code": 3, + "kind": "errorNode", + "message": "One re-delegation permitted per epoch", + "name": "tooSoonToRedelegate" + }, + { + "code": 4, + "kind": "errorNode", + "message": "Split amount is more than is staked", + "name": "insufficientStake" + }, + { + "code": 5, + "kind": "errorNode", + "message": "Stake account with transient stake cannot be merged", + "name": "mergeTransientStake" + }, + { + "code": 6, + "kind": "errorNode", + "message": "Stake account merge failed due to different authority, lockups or state", + "name": "mergeMismatch" + }, + { + "code": 7, + "kind": "errorNode", + "message": "Custodian address not present", + "name": "custodianMissing" + }, + { + "code": 8, + "kind": "errorNode", + "message": "Custodian signature not present", + "name": "custodianSignatureMissing" + }, + { + "code": 9, + "kind": "errorNode", + "message": "Insufficient voting activity in the reference vote account", + "name": "insufficientReferenceVotes" + }, + { + "code": 10, + "kind": "errorNode", + "message": "Stake account is not delegated to the provided vote account", + "name": "voteAddressMismatch" + }, + { + "code": 11, + "kind": "errorNode", + "message": "Stake account has not been delinquent for the minimum epochs required for deactivation", + "name": "minimumDelinquentEpochsForDeactivationNotMet" + }, + { + "code": 12, + "kind": "errorNode", + "message": "Delegation amount is less than the minimum", + "name": "insufficientDelegation" + }, + { + "code": 13, + "kind": "errorNode", + "message": "Stake account with transient or inactive stake cannot be redelegated", + "name": "redelegateTransientOrInactiveStake" + }, + { + "code": 14, + "kind": "errorNode", + "message": "Stake redelegation to the same vote account is not permitted", + "name": "redelegateToSameVoteAccount" + }, + { + "code": 15, + "kind": "errorNode", + "message": "Redelegated stake must be fully activated before deactivation", + "name": "redelegatedStakeMustFullyActivateBeforeDeactivationIsPermitted" + }, + { + "code": 16, + "kind": "errorNode", + "message": "Stake action is not permitted while the epoch rewards period is active", + "name": "epochRewardsActive" } - }, - { - "name": "AuthorizeChecked", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "docs": [ - "Stake account to be updated" - ] - }, - { - "name": "clockSysvar", - "isMut": false, - "isSigner": false, - "docs": [ - "Clock sysvar" - ] - }, - { - "name": "authority", - "isMut": false, - "isSigner": true, - "docs": [ - "The stake or withdraw authority" - ] - }, - { - "name": "newAuthority", - "isMut": false, - "isSigner": true, - "docs": [ - "The new stake or withdraw authority" - ] - }, - { - "name": "lockupAuthority", - "isMut": false, - "isSigner": true, - "isOptional": true, - "docs": [ - "Lockup authority" - ] - } - ], - "args": [ - { - "name": "stakeAuthorize", - "type": { - "defined": "StakeAuthorize" + ], + "instructions": [ + { + "accounts": [ + { + "docs": [ + "Uninitialized stake account" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "stake" + }, + { + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111" + }, + "docs": [ + "Rent sysvar" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "rentSysvar" } - } - ], - "discriminant": { - "type": "u32", - "value": 10 - } - }, - { - "name": "AuthorizeCheckedWithSeed", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "docs": [ - "Stake account to be updated" - ] - }, - { - "name": "base", - "isMut": false, - "isSigner": true, - "docs": [ - "Base key of stake or withdraw authority" - ] - }, - { - "name": "clockSysvar", - "isMut": false, - "isSigner": false, - "docs": [ - "Clock sysvar" - ] - }, - { - "name": "newAuthority", - "isMut": false, - "isSigner": true, - "docs": [ - "The new stake or withdraw authority" - ] - }, - { - "name": "lockupAuthority", - "isMut": false, - "isSigner": true, - "isOptional": true, - "docs": [ - "Lockup authority" - ] - } - ], - "args": [ - { - "name": "authorizeCheckedWithSeedArgs", - "type": { - "defined": "AuthorizeCheckedWithSeedArgs" + ], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 0 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "arg0", + "type": { + "kind": "definedTypeLinkNode", + "name": "authorized" + } + }, + { + "kind": "instructionArgumentNode", + "name": "arg1", + "type": { + "kind": "definedTypeLinkNode", + "name": "lockup" + } } - } - ], - "discriminant": { - "type": "u32", - "value": 11 - } - }, - { - "name": "SetLockupChecked", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "docs": [ - "Initialized stake account" - ] - }, - { - "name": "authority", - "isMut": false, - "isSigner": true, - "docs": [ - "Lockup authority or withdraw authority" - ] - }, - { - "name": "newAuthority", - "isMut": false, - "isSigner": true, - "isOptional": true, - "docs": [ - "New lockup authority" - ] - } - ], - "args": [ - { - "name": "lockupCheckedArgs", - "type": { - "defined": "LockupCheckedArgs" + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 } - } - ], - "discriminant": { - "type": "u32", - "value": 12 - } - }, - { - "name": "GetMinimumDelegation", - "accounts": [], - "args": [], - "discriminant": { - "type": "u32", - "value": 13 - } - }, - { - "name": "DeactivateDelinquent", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "docs": [ - "Delegated stake account" - ] - }, - { - "name": "delinquentVote", - "isMut": false, - "isSigner": false, - "docs": [ - "Delinquent vote account" - ] - }, - { - "name": "referenceVote", - "isMut": false, - "isSigner": false, - "docs": [ - "Reference vote account" - ] - } - ], - "args": [], - "discriminant": { - "type": "u32", - "value": 14 - } - }, - { - "name": "Redelegate", - "accounts": [], - "args": [], - "discriminant": { - "type": "u32", - "value": 15 - } - }, - { - "name": "MoveStake", - "accounts": [ - { - "name": "sourceStake", - "isMut": true, - "isSigner": false, - "docs": [ - "Active source stake account" - ] - }, - { - "name": "destinationStake", - "isMut": true, - "isSigner": false, - "docs": [ - "Active or inactive destination stake account" - ] - }, - { - "name": "stakeAuthority", - "isMut": false, - "isSigner": true, - "docs": [ - "Stake authority" - ] - } - ], - "args": [ - { - "name": "args", - "type": "u64" - } - ], - "discriminant": { - "type": "u32", - "value": 16 - } - }, - { - "name": "MoveLamports", - "accounts": [ - { - "name": "sourceStake", - "isMut": true, - "isSigner": false, - "docs": [ - "Active or inactive source stake account" - ] - }, - { - "name": "destinationStake", - "isMut": true, - "isSigner": false, - "docs": [ - "Mergeable destination stake account" - ] - }, - { - "name": "stakeAuthority", - "isMut": false, - "isSigner": true, - "docs": [ - "Stake authority" - ] - } - ], - "args": [ - { - "name": "args", - "type": "u64" - } - ], - "discriminant": { - "type": "u32", - "value": 17 - } - } - ], - "types": [ - { - "name": "LockupArgs", - "type": { - "kind": "struct", - "fields": [ - { - "name": "unixTimestamp", + ], + "kind": "instructionNode", + "name": "initialize" + }, + { + "accounts": [ + { + "docs": [ + "Stake account to be updated" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "stake" + }, + { + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarC1ock11111111111111111111111111111111" + }, + "docs": [ + "Clock sysvar" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "clockSysvar" + }, + { + "docs": [ + "The stake or withdraw authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "authority" + }, + { + "docs": [ + "Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration" + ], + "isOptional": true, + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "lockupAuthority" + } + ], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 1 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", "type": { - "option": { - "defined": "UnixTimestamp" - } + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" } }, { - "name": "epoch", + "kind": "instructionArgumentNode", + "name": "arg0", "type": { - "option": { - "defined": "Epoch" - } + "kind": "publicKeyTypeNode" } }, { - "name": "custodian", + "kind": "instructionArgumentNode", + "name": "arg1", "type": { - "option": "publicKey" + "kind": "definedTypeLinkNode", + "name": "stakeAuthorize" } } - ] - } - }, - { - "name": "LockupCheckedArgs", - "type": { - "kind": "struct", - "fields": [ - { - "name": "unixTimestamp", + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "authorize" + }, + { + "accounts": [ + { + "docs": [ + "Initialized stake account to be delegated" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "stake" + }, + { + "docs": [ + "Vote account to which this stake will be delegated" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "vote" + }, + { + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarC1ock11111111111111111111111111111111" + }, + "docs": [ + "Clock sysvar" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "clockSysvar" + }, + { + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarStakeHistory1111111111111111111111111" + }, + "docs": [ + "Stake history sysvar that carries stake warmup/cooldown history" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "stakeHistory" + }, + { + "docs": [ + "Unused account, formerly the stake config" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "unused" + }, + { + "docs": [ + "Stake authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "stakeAuthority" + } + ], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 2 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", "type": { - "option": { - "defined": "UnixTimestamp" - } + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "delegateStake" + }, + { + "accounts": [ + { + "docs": [ + "Stake account to be split; must be in the Initialized or Stake state" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "stake" + }, + { + "docs": [ + "Uninitialized stake account that will take the split-off amount" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "splitStake" }, { - "name": "epoch", + "docs": [ + "Stake authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "stakeAuthority" + } + ], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 3 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", "type": { - "option": { - "defined": "Epoch" - } + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" } - } - ] - } - }, - { - "name": "AuthorizeWithSeedArgs", - "type": { - "kind": "struct", - "fields": [ - { - "name": "newAuthorizedPubkey", - "type": "publicKey" }, { - "name": "stakeAuthorize", + "kind": "instructionArgumentNode", + "name": "args", "type": { - "defined": "StakeAuthorize" + "endian": "le", + "format": "u64", + "kind": "numberTypeNode" } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "split" + }, + { + "accounts": [ + { + "docs": [ + "Stake account from which to withdraw" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "stake" + }, + { + "docs": [ + "Recipient account" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "recipient" + }, + { + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarC1ock11111111111111111111111111111111" + }, + "docs": [ + "Clock sysvar" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "clockSysvar" }, { - "name": "authoritySeed", - "type": "string" + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarStakeHistory1111111111111111111111111" + }, + "docs": [ + "Stake history sysvar that carries stake warmup/cooldown history" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "stakeHistory" }, { - "name": "authorityOwner", - "type": "publicKey" + "docs": [ + "Withdraw authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "withdrawAuthority" + }, + { + "docs": [ + "Lockup authority, if before lockup expiration" + ], + "isOptional": true, + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "lockupAuthority" } - ] - } - }, - { - "name": "AuthorizeCheckedWithSeedArgs", - "type": { - "kind": "struct", - "fields": [ + ], + "arguments": [ { - "name": "stakeAuthorize", + "defaultValue": { + "kind": "numberValueNode", + "number": 4 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } + }, + { + "kind": "instructionArgumentNode", + "name": "args", "type": { - "defined": "StakeAuthorize" + "endian": "le", + "format": "u64", + "kind": "numberTypeNode" } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "withdraw" + }, + { + "accounts": [ + { + "docs": [ + "Delegated stake account to be deactivated" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "stake" }, { - "name": "authoritySeed", - "type": "string" + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarC1ock11111111111111111111111111111111" + }, + "docs": [ + "Clock sysvar" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "clockSysvar" }, { - "name": "authorityOwner", - "type": "publicKey" + "docs": [ + "Stake authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "stakeAuthority" } - ] - } - }, - { - "name": "StakeFlags", - "type": { - "kind": "struct", - "fields": [ - { - "name": "bits", - "type": "u8" + ], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 5 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } } - ] - } - }, - { - "name": "Lockup", - "type": { - "kind": "struct", - "fields": [ - { - "name": "unixTimestamp", + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "deactivate" + }, + { + "accounts": [ + { + "docs": [ + "Initialized stake account" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "stake" + }, + { + "docs": [ + "Lockup authority or withdraw authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "authority" + } + ], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 6 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", "type": { - "defined": "UnixTimestamp" + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" } }, { - "name": "epoch", + "kind": "instructionArgumentNode", + "name": "arg0", "type": { - "defined": "Epoch" + "kind": "definedTypeLinkNode", + "name": "lockupArgs" } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "setLockup" + }, + { + "accounts": [ + { + "docs": [ + "Destination stake account for the merge" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "destinationStake" + }, + { + "docs": [ + "Source stake account for to merge. This account will be drained" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "sourceStake" }, { - "name": "custodian", - "type": "publicKey" + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarC1ock11111111111111111111111111111111" + }, + "docs": [ + "Clock sysvar" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "clockSysvar" + }, + { + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarStakeHistory1111111111111111111111111" + }, + "docs": [ + "Stake history sysvar that carries stake warmup/cooldown history" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "stakeHistory" + }, + { + "docs": [ + "Stake authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "stakeAuthority" } - ] - } - }, - { - "name": "Authorized", - "type": { - "kind": "struct", - "fields": [ - { - "name": "staker", - "type": "publicKey" + ], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 7 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "merge" + }, + { + "accounts": [ + { + "docs": [ + "Stake account to be updated" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "stake" + }, + { + "docs": [ + "Base key of stake or withdraw authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "base" }, { - "name": "withdrawer", - "type": "publicKey" + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarC1ock11111111111111111111111111111111" + }, + "docs": [ + "Clock sysvar" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "clockSysvar" + }, + { + "docs": [ + "Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration" + ], + "isOptional": true, + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "lockupAuthority" } - ] - } - }, - { - "name": "Meta", - "type": { - "kind": "struct", - "fields": [ - { - "name": "rentExemptReserve", - "type": "u64" + ], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 8 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } }, { - "name": "authorized", + "kind": "instructionArgumentNode", + "name": "arg0", "type": { - "defined": "Authorized" + "kind": "definedTypeLinkNode", + "name": "authorizeWithSeedArgs" } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "authorizeWithSeed" + }, + { + "accounts": [ + { + "docs": [ + "Uninitialized stake account" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "stake" }, { - "name": "lockup", + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarRent111111111111111111111111111111111" + }, + "docs": [ + "Rent sysvar" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "rentSysvar" + }, + { + "docs": [ + "The stake authority" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "stakeAuthority" + }, + { + "docs": [ + "The withdraw authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "withdrawAuthority" + } + ], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 9 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", "type": { - "defined": "Lockup" + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" } } - ] - } - }, - { - "name": "Delegation", - "type": { - "kind": "struct", - "fields": [ - { - "name": "voterPubkey", - "type": "publicKey" + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "initializeChecked" + }, + { + "accounts": [ + { + "docs": [ + "Stake account to be updated" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "stake" + }, + { + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarC1ock11111111111111111111111111111111" + }, + "docs": [ + "Clock sysvar" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "clockSysvar" }, { - "name": "stake", - "type": "u64" + "docs": [ + "The stake or withdraw authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "authority" + }, + { + "docs": [ + "The new stake or withdraw authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "newAuthority" + }, + { + "docs": [ + "Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration" + ], + "isOptional": true, + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "lockupAuthority" + } + ], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 10 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } }, { - "name": "activationEpoch", + "kind": "instructionArgumentNode", + "name": "stakeAuthorize", "type": { - "defined": "Epoch" + "kind": "definedTypeLinkNode", + "name": "stakeAuthorize" } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "authorizeChecked" + }, + { + "accounts": [ + { + "docs": [ + "Stake account to be updated" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "stake" + }, + { + "docs": [ + "Base key of stake or withdraw authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "base" + }, + { + "defaultValue": { + "kind": "publicKeyValueNode", + "publicKey": "SysvarC1ock11111111111111111111111111111111" + }, + "docs": [ + "Clock sysvar" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "clockSysvar" + }, + { + "docs": [ + "The new stake or withdraw authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "newAuthority" }, { - "name": "deactivationEpoch", + "docs": [ + "Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration" + ], + "isOptional": true, + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "lockupAuthority" + } + ], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 11 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", "type": { - "defined": "Epoch" + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" } }, { - "name": "warmupCooldownRate", + "kind": "instructionArgumentNode", + "name": "arg0", "type": { - "defined": "f64" + "kind": "definedTypeLinkNode", + "name": "authorizeCheckedWithSeedArgs" } } - ] - } - }, - { - "name": "Stake", - "type": { - "kind": "struct", - "fields": [ - { - "name": "delegation", + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "authorizeCheckedWithSeed" + }, + { + "accounts": [ + { + "docs": [ + "Initialized stake account" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "stake" + }, + { + "docs": [ + "Lockup authority or withdraw authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "authority" + }, + { + "docs": [ + "New lockup authority" + ], + "isOptional": true, + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "newAuthority" + } + ], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 12 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", "type": { - "defined": "Delegation" + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" } }, { - "name": "creditsObserved", - "type": "u64" + "kind": "instructionArgumentNode", + "name": "arg0", + "type": { + "kind": "definedTypeLinkNode", + "name": "lockupCheckedArgs" + } } - ] - } - }, - { - "name": "StakeState", - "type": { - "kind": "enum", - "variants": [ - { - "name": "Uninitialized" + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "setLockupChecked" + }, + { + "accounts": [], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 13 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "getMinimumDelegation" + }, + { + "accounts": [ + { + "docs": [ + "Delegated stake account" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "stake" }, { - "name": "Initialized", - "fields": [ - { - "defined": "Meta" - } - ] + "docs": [ + "Delinquent vote account for the delegated stake account" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "delinquentVote" }, { - "name": "Stake", - "fields": [ - { - "defined": "Meta" - }, - { - "defined": "Stake" - } - ] + "docs": [ + "Reference vote account that has voted at least once in the last `MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION` epochs" + ], + "isSigner": false, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "referenceVote" + } + ], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 14 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "deactivateDelinquent" + }, + { + "accounts": [], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 15 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "redelegate" + }, + { + "accounts": [ + { + "docs": [ + "Active source stake account" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "sourceStake" }, { - "name": "RewardsPool" + "docs": [ + "Active or inactive destination stake account" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "destinationStake" + }, + { + "docs": [ + "Stake authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "stakeAuthority" } - ] - } - }, - { - "name": "StakeStateV2", - "type": { - "kind": "enum", - "variants": [ - { - "name": "Uninitialized" + ], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 16 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } }, { - "name": "Initialized", - "fields": [ - { - "defined": "Meta" - } - ] + "kind": "instructionArgumentNode", + "name": "args", + "type": { + "endian": "le", + "format": "u64", + "kind": "numberTypeNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 + } + ], + "kind": "instructionNode", + "name": "moveStake" + }, + { + "accounts": [ + { + "docs": [ + "Active or inactive source stake account" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "sourceStake" }, { - "name": "Stake", - "fields": [ - { - "defined": "Meta" - }, - { - "defined": "Stake" - }, - { - "defined": "StakeFlags" - } - ] + "docs": [ + "Mergeable destination stake account" + ], + "isSigner": false, + "isWritable": true, + "kind": "instructionAccountNode", + "name": "destinationStake" }, { - "name": "RewardsPool" + "docs": [ + "Stake authority" + ], + "isSigner": true, + "isWritable": false, + "kind": "instructionAccountNode", + "name": "stakeAuthority" } - ] - } - }, - { - "name": "StakeAuthorize", - "type": { - "kind": "enum", - "variants": [ - { - "name": "Staker" + ], + "arguments": [ + { + "defaultValue": { + "kind": "numberValueNode", + "number": 17 + }, + "defaultValueStrategy": "omitted", + "kind": "instructionArgumentNode", + "name": "discriminator", + "type": { + "endian": "le", + "format": "u8", + "kind": "numberTypeNode" + } }, { - "name": "Withdrawer" + "kind": "instructionArgumentNode", + "name": "args", + "type": { + "endian": "le", + "format": "u64", + "kind": "numberTypeNode" + } + } + ], + "discriminators": [ + { + "kind": "fieldDiscriminatorNode", + "name": "discriminator", + "offset": 0 } - ] + ], + "kind": "instructionNode", + "name": "moveLamports" } - } - ], - "metadata": { - "origin": "shank", - "address": "Stake11111111111111111111111111111111111111", - "binaryVersion": "0.4.2", - "libVersion": "0.4.2" - } + ], + "kind": "programNode", + "name": "solanaStakeInterface", + "pdas": [], + "publicKey": "Stake11111111111111111111111111111111111111", + "version": "2.0.2" + }, + "standard": "codama", + "version": "1.0.0" } diff --git a/interface/src/bin/generate-idl.rs b/interface/src/bin/generate-idl.rs new file mode 100644 index 00000000..f1df8977 --- /dev/null +++ b/interface/src/bin/generate-idl.rs @@ -0,0 +1,32 @@ +//! Codama IDL generation binary. +#[cfg(feature = "codama")] +use { + codama::Codama, + std::{env, fs, path::Path}, +}; + +#[cfg(feature = "codama")] +fn main() -> Result<(), Box> { + // Generate IDL. + let manifest_dir = env::var("CARGO_MANIFEST_DIR")?; + let crate_path = Path::new(&manifest_dir); + let codama = Codama::load(crate_path)?; + let idl_json = codama.get_json_idl()?; + + // Parse and format the JSON with pretty printing. + let parsed: serde_json::Value = serde_json::from_str(&idl_json)?; + let mut formatted_json = serde_json::to_string_pretty(&parsed)?; + formatted_json.push('\n'); + + // Write IDL file. + let idl_path = Path::new(&manifest_dir).join("idl.json"); + fs::write(&idl_path, formatted_json)?; + + println!("IDL written to: {}", idl_path.display()); + Ok(()) +} + +#[cfg(not(feature = "codama"))] +fn main() { + println!("Codama is not enabled"); +} diff --git a/interface/src/error.rs b/interface/src/error.rs index 29923230..d965b340 100644 --- a/interface/src/error.rs +++ b/interface/src/error.rs @@ -1,70 +1,145 @@ +#[cfg(feature = "codama")] +use codama_macros::CodamaErrors; use { num_traits::{FromPrimitive, ToPrimitive}, solana_program_error::ProgramError, }; /// Reasons the Stake might have had an error. +#[cfg_attr(feature = "codama", derive(CodamaErrors))] +#[derive(Clone, Debug, PartialEq, Eq)] #[cfg_attr(test, derive(strum_macros::FromRepr, strum_macros::EnumIter))] #[cfg_attr( feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] -#[derive(Clone, Debug, PartialEq, Eq)] pub enum StakeError { - // 0 /// Not enough credits to redeem. + #[cfg_attr( + feature = "codama", + codama(error(message = "Not enough credits to redeem")) + )] NoCreditsToRedeem, /// Lockup has not yet expired. + #[cfg_attr( + feature = "codama", + codama(error(message = "Lockup has not yet expired")) + )] LockupInForce, /// Stake already deactivated. + #[cfg_attr( + feature = "codama", + codama(error(message = "Stake already deactivated")) + )] AlreadyDeactivated, /// One re-delegation permitted per epoch. + #[cfg_attr( + feature = "codama", + codama(error(message = "One re-delegation permitted per epoch")) + )] TooSoonToRedelegate, /// Split amount is more than is staked. + #[cfg_attr( + feature = "codama", + codama(error(message = "Split amount is more than is staked")) + )] InsufficientStake, - // 5 /// Stake account with transient stake cannot be merged. + #[cfg_attr( + feature = "codama", + codama(error(message = "Stake account with transient stake cannot be merged")) + )] MergeTransientStake, /// Stake account merge failed due to different authority, lockups or state. + #[cfg_attr( + feature = "codama", + codama(error( + message = "Stake account merge failed due to different authority, lockups or state" + )) + )] MergeMismatch, /// Custodian address not present. + #[cfg_attr( + feature = "codama", + codama(error(message = "Custodian address not present")) + )] CustodianMissing, /// Custodian signature not present. + #[cfg_attr( + feature = "codama", + codama(error(message = "Custodian signature not present")) + )] CustodianSignatureMissing, /// Insufficient voting activity in the reference vote account. + #[cfg_attr( + feature = "codama", + codama(error(message = "Insufficient voting activity in the reference vote account")) + )] InsufficientReferenceVotes, - // 10 /// Stake account is not delegated to the provided vote account. + #[cfg_attr( + feature = "codama", + codama(error(message = "Stake account is not delegated to the provided vote account")) + )] VoteAddressMismatch, /// Stake account has not been delinquent for the minimum epochs required /// for deactivation. + #[cfg_attr( + feature = "codama", + codama(error( + message = "Stake account has not been delinquent for the minimum epochs required for deactivation" + )) + )] MinimumDelinquentEpochsForDeactivationNotMet, /// Delegation amount is less than the minimum. + #[cfg_attr( + feature = "codama", + codama(error(message = "Delegation amount is less than the minimum")) + )] InsufficientDelegation, /// Stake account with transient or inactive stake cannot be redelegated. + #[cfg_attr( + feature = "codama", + codama(error( + message = "Stake account with transient or inactive stake cannot be redelegated" + )) + )] RedelegateTransientOrInactiveStake, /// Stake redelegation to the same vote account is not permitted. + #[cfg_attr( + feature = "codama", + codama(error(message = "Stake redelegation to the same vote account is not permitted")) + )] RedelegateToSameVoteAccount, - // 15 /// Redelegated stake must be fully activated before deactivation. + #[cfg_attr( + feature = "codama", + codama(error(message = "Redelegated stake must be fully activated before deactivation")) + )] RedelegatedStakeMustFullyActivateBeforeDeactivationIsPermitted, /// Stake action is not permitted while the epoch rewards period is active. + #[cfg_attr( + feature = "codama", + codama(error( + message = "Stake action is not permitted while the epoch rewards period is active" + )) + )] EpochRewardsActive, } diff --git a/interface/src/instruction.rs b/interface/src/instruction.rs index 7bbb5033..b1993ac8 100644 --- a/interface/src/instruction.rs +++ b/interface/src/instruction.rs @@ -3,6 +3,8 @@ // Required to avoid warnings from uses of deprecated types during trait derivations. #![allow(deprecated)] +#[cfg(feature = "codama")] +use codama_macros::{codama, CodamaInstructions, CodamaType}; use { crate::state::{Authorized, Lockup, StakeAuthorize}, solana_clock::{Epoch, UnixTimestamp}, @@ -37,6 +39,7 @@ const STAKE_HISTORY_ID: Pubkey = feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] +#[cfg_attr(feature = "codama", derive(CodamaInstructions))] #[derive(Debug, PartialEq, Eq, Clone)] pub enum StakeInstruction { /// Initialize a stake with lockup and authorization information @@ -48,6 +51,12 @@ pub enum StakeInstruction { /// [`Authorized`] carries pubkeys that must sign staker transactions /// and withdrawer transactions; [`Lockup`] carries information about /// withdrawal restrictions. + #[cfg_attr( + feature = "codama", + codama(account(name = "stake", writable, docs = "Uninitialized stake account")), + codama(account(name = "rent_sysvar", docs = "Rent sysvar", default_value = sysvar("rent"))) + )] + // backwards compatibility with old IDL demands auto `arg0` and `arg1` names Initialize(Authorized, Lockup), /// Authorize a key to manage stake or withdrawal @@ -58,6 +67,19 @@ pub enum StakeInstruction { /// 2. `[SIGNER]` The stake or withdraw authority /// 3. Optional: `[SIGNER]` Lockup authority, if updating `StakeAuthorize::Withdrawer` before /// lockup expiration + #[cfg_attr( + feature = "codama", + codama(account(name = "stake", writable, docs = "Stake account to be updated")), + codama(account(name = "clock_sysvar", docs = "Clock sysvar", default_value = sysvar("clock"))), + codama(account(name = "authority", signer, docs = "The stake or withdraw authority")), + codama(account( + name = "lockup_authority", + optional, + signer, + docs = "Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration" + )) + )] + // backwards compatibility with old IDL demands auto `arg0` and `arg1` names Authorize(Pubkey, StakeAuthorize), /// Delegate a stake to a particular vote account @@ -72,6 +94,26 @@ pub enum StakeInstruction { /// /// The entire balance of the staking account is staked. `DelegateStake` /// can be called multiple times, but re-delegation is delayed by one epoch. + #[cfg_attr( + feature = "codama", + codama(account( + name = "stake", + writable, + docs = "Initialized stake account to be delegated" + )), + codama(account( + name = "vote", + docs = "Vote account to which this stake will be delegated" + )), + codama(account(name = "clock_sysvar", docs = "Clock sysvar", default_value = sysvar("clock"))), + codama(account( + name = "stake_history", + docs = "Stake history sysvar that carries stake warmup/cooldown history", + default_value = sysvar("stake_history") + )), + codama(account(name = "unused", docs = "Unused account, formerly the stake config")), + codama(account(name = "stake_authority", signer, docs = "Stake authority")) + )] DelegateStake, /// Split `u64` tokens and stake off a stake account into another stake account. @@ -80,7 +122,22 @@ pub enum StakeInstruction { /// 0. `[WRITE]` Stake account to be split; must be in the Initialized or Stake state /// 1. `[WRITE]` Uninitialized stake account that will take the split-off amount /// 2. `[SIGNER]` Stake authority - Split(u64), + #[cfg_attr( + feature = "codama", + codama(account( + name = "stake", + writable, + docs = "Stake account to be split; must be in the Initialized or Stake state" + )), + codama(account( + name = "split_stake", + writable, + docs = "Uninitialized stake account that will take the split-off amount" + )), + codama(account(name = "stake_authority", signer, docs = "Stake authority")) + )] + // backwards compatibility with old IDL demands old `args` name + Split(#[cfg_attr(feature = "codama", codama(name = "args"))] u64), /// Withdraw unstaked lamports from the stake account /// @@ -94,7 +151,30 @@ pub enum StakeInstruction { /// /// The `u64` is the portion of the stake account balance to be withdrawn, /// must be `<= StakeAccount.lamports - staked_lamports`. - Withdraw(u64), + #[cfg_attr( + feature = "codama", + codama(account( + name = "stake", + writable, + docs = "Stake account from which to withdraw" + )), + codama(account(name = "recipient", writable, docs = "Recipient account")), + codama(account(name = "clock_sysvar", docs = "Clock sysvar", default_value = sysvar("clock"))), + codama(account( + name = "stake_history", + docs = "Stake history sysvar that carries stake warmup/cooldown history", + default_value = sysvar("stake_history") + )), + codama(account(name = "withdraw_authority", signer, docs = "Withdraw authority")), + codama(account( + name = "lockup_authority", + optional, + signer, + docs = "Lockup authority, if before lockup expiration" + )) + )] + // backwards compatibility with old IDL demands old `args` name + Withdraw(#[cfg_attr(feature = "codama", codama(name = "args"))] u64), /// Deactivates the stake in the account /// @@ -102,6 +182,16 @@ pub enum StakeInstruction { /// 0. `[WRITE]` Delegated stake account /// 1. `[]` Clock sysvar /// 2. `[SIGNER]` Stake authority + #[cfg_attr( + feature = "codama", + codama(account( + name = "stake", + writable, + docs = "Delegated stake account to be deactivated" + )), + codama(account(name = "clock_sysvar", docs = "Clock sysvar", default_value = sysvar("clock"))), + codama(account(name = "stake_authority", signer, docs = "Stake authority")) + )] Deactivate, /// Set stake lockup @@ -112,6 +202,15 @@ pub enum StakeInstruction { /// # Account references /// 0. `[WRITE]` Initialized stake account /// 1. `[SIGNER]` Lockup authority or withdraw authority + #[cfg_attr( + feature = "codama", + codama(account(name = "stake", writable, docs = "Initialized stake account")), + codama(account( + name = "authority", + signer, + docs = "Lockup authority or withdraw authority" + )) + )] SetLockup(LockupArgs), /// Merge two stake accounts. @@ -138,6 +237,26 @@ pub enum StakeInstruction { /// 2. `[]` Clock sysvar /// 3. `[]` Stake history sysvar that carries stake warmup/cooldown history /// 4. `[SIGNER]` Stake authority + #[cfg_attr( + feature = "codama", + codama(account( + name = "destination_stake", + writable, + docs = "Destination stake account for the merge" + )), + codama(account( + name = "source_stake", + writable, + docs = "Source stake account for to merge. This account will be drained" + )), + codama(account(name = "clock_sysvar", docs = "Clock sysvar", default_value = sysvar("clock"))), + codama(account( + name = "stake_history", + docs = "Stake history sysvar that carries stake warmup/cooldown history", + default_value = sysvar("stake_history") + )), + codama(account(name = "stake_authority", signer, docs = "Stake authority")) + )] Merge, /// Authorize a key to manage stake or withdrawal with a derived key @@ -148,6 +267,22 @@ pub enum StakeInstruction { /// 2. `[]` Clock sysvar /// 3. Optional: `[SIGNER]` Lockup authority, if updating [`StakeAuthorize::Withdrawer`] /// before lockup expiration + #[cfg_attr( + feature = "codama", + codama(account(name = "stake", writable, docs = "Stake account to be updated")), + codama(account( + name = "base", + signer, + docs = "Base key of stake or withdraw authority" + )), + codama(account(name = "clock_sysvar", docs = "Clock sysvar", default_value = sysvar("clock"))), + codama(account( + name = "lockup_authority", + optional, + signer, + docs = "Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration" + )) + )] AuthorizeWithSeed(AuthorizeWithSeedArgs), /// Initialize a stake with authorization information @@ -160,6 +295,13 @@ pub enum StakeInstruction { /// 1. `[]` Rent sysvar /// 2. `[]` The stake authority /// 3. `[SIGNER]` The withdraw authority + #[cfg_attr( + feature = "codama", + codama(account(name = "stake", writable, docs = "Uninitialized stake account")), + codama(account(name = "rent_sysvar", docs = "Rent sysvar", default_value = sysvar("rent"))), + codama(account(name = "stake_authority", docs = "The stake authority")), + codama(account(name = "withdraw_authority", signer, docs = "The withdraw authority")) + )] InitializeChecked, /// Authorize a key to manage stake or withdrawal @@ -174,7 +316,26 @@ pub enum StakeInstruction { /// 3. `[SIGNER]` The new stake or withdraw authority /// 4. Optional: `[SIGNER]` Lockup authority, if updating [`StakeAuthorize::Withdrawer`] /// before lockup expiration - AuthorizeChecked(StakeAuthorize), + #[cfg_attr( + feature = "codama", + codama(account(name = "stake", writable, docs = "Stake account to be updated")), + codama(account(name = "clock_sysvar", docs = "Clock sysvar", default_value = sysvar("clock"))), + codama(account(name = "authority", signer, docs = "The stake or withdraw authority")), + codama(account( + name = "new_authority", + signer, + docs = "The new stake or withdraw authority" + )), + codama(account( + name = "lockup_authority", + optional, + signer, + docs = "Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration" + )) + )] + AuthorizeChecked( + #[cfg_attr(feature = "codama", codama(name = "stakeAuthorize"))] StakeAuthorize, + ), /// Authorize a key to manage stake or withdrawal with a derived key /// @@ -188,6 +349,27 @@ pub enum StakeInstruction { /// 3. `[SIGNER]` The new stake or withdraw authority /// 4. Optional: `[SIGNER]` Lockup authority, if updating [`StakeAuthorize::Withdrawer`] /// before lockup expiration + #[cfg_attr( + feature = "codama", + codama(account(name = "stake", writable, docs = "Stake account to be updated")), + codama(account( + name = "base", + signer, + docs = "Base key of stake or withdraw authority" + )), + codama(account(name = "clock_sysvar", docs = "Clock sysvar", default_value = sysvar("clock"))), + codama(account( + name = "new_authority", + signer, + docs = "The new stake or withdraw authority" + )), + codama(account( + name = "lockup_authority", + optional, + signer, + docs = "Lockup authority, if updating `StakeAuthorize::Withdrawer` before lockup expiration" + )) + )] AuthorizeCheckedWithSeed(AuthorizeCheckedWithSeedArgs), /// Set stake lockup @@ -202,6 +384,21 @@ pub enum StakeInstruction { /// 0. `[WRITE]` Initialized stake account /// 1. `[SIGNER]` Lockup authority or withdraw authority /// 2. Optional: `[SIGNER]` New lockup authority + #[cfg_attr( + feature = "codama", + codama(account(name = "stake", writable, docs = "Initialized stake account")), + codama(account( + name = "authority", + signer, + docs = "Lockup authority or withdraw authority" + )), + codama(account( + name = "new_authority", + optional, + signer, + docs = "New lockup authority" + )) + )] SetLockupChecked(LockupCheckedArgs), /// Get the minimum stake delegation, in lamports @@ -217,7 +414,7 @@ pub enum StakeInstruction { GetMinimumDelegation, /// Deactivate stake delegated to a vote account that has been delinquent for at least - /// [`crate::MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION`] epochs. + /// `MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION` epochs. /// /// No signer is required for this instruction as it is a common good to deactivate abandoned /// stake. @@ -226,7 +423,19 @@ pub enum StakeInstruction { /// 0. `[WRITE]` Delegated stake account /// 1. `[]` Delinquent vote account for the delegated stake account /// 2. `[]` Reference vote account that has voted at least once in the last - /// [`crate::MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION`] epochs + /// `MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION` epochs + #[cfg_attr( + feature = "codama", + codama(account(name = "stake", writable, docs = "Delegated stake account")), + codama(account( + name = "delinquent_vote", + docs = "Delinquent vote account for the delegated stake account" + )), + codama(account( + name = "reference_vote", + docs = "Reference vote account that has voted at least once in the last `MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION` epochs" + )) + )] DeactivateDelinquent, /// Redelegate activated stake to another vote account. @@ -250,6 +459,7 @@ pub enum StakeInstruction { /// 4. `[SIGNER]` Stake authority /// #[deprecated(since = "2.1.0", note = "Redelegate will not be enabled")] + // NOTE: No codama attributes - this instruction is disabled and excluded from IDL Redelegate, /// Move stake between accounts with the same authorities and lockups, using Staker authority. @@ -271,7 +481,18 @@ pub enum StakeInstruction { /// 2. `[SIGNER]` Stake authority /// /// The `u64` is the portion of the stake to move, which may be the entire delegation - MoveStake(u64), + #[cfg_attr( + feature = "codama", + codama(account(name = "sourceStake", writable, docs = "Active source stake account")), + codama(account( + name = "destinationStake", + writable, + docs = "Active or inactive destination stake account" + )), + codama(account(name = "stake_authority", signer, docs = "Stake authority")) + )] + // sadly named `args` to avoid breaking users of old IDL + MoveStake(#[cfg_attr(feature = "codama", codama(name = "args"))] u64), /// Move unstaked lamports between accounts with the same authorities and lockups, using Staker /// authority. @@ -286,35 +507,56 @@ pub enum StakeInstruction { /// 2. `[SIGNER]` Stake authority /// /// The `u64` is the portion of available lamports to move - MoveLamports(u64), + #[cfg_attr( + feature = "codama", + codama(account( + name = "source_stake", + writable, + docs = "Active or inactive source stake account" + )), + codama(account( + name = "destination_stake", + writable, + docs = "Mergeable destination stake account" + )), + codama(account(name = "stake_authority", signer, docs = "Stake authority")) + )] + // sadly named `args` to avoid breaking users of old IDL + MoveLamports(#[cfg_attr(feature = "codama", codama(name = "args"))] u64), } +#[cfg_attr(feature = "codama", derive(CodamaType))] +#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)] +#[cfg_attr(feature = "codama", codama(name = "lockupParams"))] #[cfg_attr( feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] -#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)] pub struct LockupArgs { pub unix_timestamp: Option, pub epoch: Option, pub custodian: Option, } +#[cfg_attr(feature = "codama", derive(CodamaType))] +#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)] +#[cfg_attr(feature = "codama", codama(name = "lockupCheckedParams"))] #[cfg_attr( feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] -#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)] pub struct LockupCheckedArgs { pub unix_timestamp: Option, pub epoch: Option, } +#[cfg_attr(feature = "codama", derive(CodamaType))] +#[derive(Debug, PartialEq, Eq, Clone)] +#[cfg_attr(feature = "codama", codama(name = "authorizeWithSeedParams"))] #[cfg_attr( feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] -#[derive(Debug, PartialEq, Eq, Clone)] pub struct AuthorizeWithSeedArgs { pub new_authorized_pubkey: Pubkey, pub stake_authorize: StakeAuthorize, @@ -322,11 +564,13 @@ pub struct AuthorizeWithSeedArgs { pub authority_owner: Pubkey, } +#[cfg_attr(feature = "codama", derive(CodamaType))] +#[derive(Debug, PartialEq, Eq, Clone)] +#[cfg_attr(feature = "codama", codama(name = "authorizeCheckedWithSeedParams"))] #[cfg_attr( feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] -#[derive(Debug, PartialEq, Eq, Clone)] pub struct AuthorizeCheckedWithSeedArgs { pub stake_authorize: StakeAuthorize, pub authority_seed: String, diff --git a/interface/src/lib.rs b/interface/src/lib.rs index d82a9532..edfd08b3 100644 --- a/interface/src/lib.rs +++ b/interface/src/lib.rs @@ -14,6 +14,9 @@ pub mod state; pub mod sysvar; pub mod tools; +#[cfg(feature = "codama")] +use codama_macros::codama; +#[cfg_attr(feature = "codama", codama(name = "stake"))] pub mod program { solana_pubkey::declare_id!("Stake11111111111111111111111111111111111111"); } diff --git a/interface/src/stake_flags.rs b/interface/src/stake_flags.rs index 790925d8..05ad9053 100644 --- a/interface/src/stake_flags.rs +++ b/interface/src/stake_flags.rs @@ -2,6 +2,8 @@ use borsh::{BorshDeserialize, BorshSchema, BorshSerialize}; /// Additional flags for stake state. +#[cfg_attr(feature = "codama", derive(codama_macros::CodamaType))] +#[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, Debug)] #[cfg_attr(feature = "frozen-abi", derive(solana_frozen_abi_macro::AbiExample))] #[cfg_attr( feature = "borsh", @@ -12,7 +14,6 @@ use borsh::{BorshDeserialize, BorshSchema, BorshSerialize}; feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] -#[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, Debug)] pub struct StakeFlags { bits: u8, } diff --git a/interface/src/state.rs b/interface/src/state.rs index f473eac8..13ec0b34 100644 --- a/interface/src/state.rs +++ b/interface/src/state.rs @@ -6,6 +6,8 @@ #[cfg(feature = "borsh")] use borsh::{io, BorshDeserialize, BorshSchema, BorshSerialize}; +#[cfg(feature = "codama")] +use codama_macros::{codama, CodamaType}; use { crate::{ error::StakeError, @@ -79,17 +81,19 @@ macro_rules! impl_borsh_stake_state { } }; } +#[cfg_attr(feature = "codama", derive(CodamaType))] +#[derive(Debug, Default, PartialEq, Clone, Copy)] #[cfg_attr(feature = "frozen-abi", derive(solana_frozen_abi_macro::AbiExample))] #[cfg_attr( feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] -#[derive(Debug, Default, PartialEq, Clone, Copy)] #[allow(clippy::large_enum_variant)] #[deprecated( since = "1.17.0", note = "Please use `StakeStateV2` instead, and match the third `StakeFlags` field when matching `StakeStateV2::Stake` to resolve any breakage. For example, `if let StakeState::Stake(meta, stake)` becomes `if let StakeStateV2::Stake(meta, stake, _stake_flags)`." )] +#[cfg_attr(feature = "codama", codama(enum_discriminator(size = number(u32))))] pub enum StakeState { #[default] Uninitialized, @@ -140,13 +144,15 @@ impl StakeState { } } +#[cfg_attr(feature = "codama", derive(CodamaType))] +#[derive(Debug, Default, PartialEq, Clone, Copy)] #[cfg_attr(feature = "frozen-abi", derive(solana_frozen_abi_macro::AbiExample))] #[cfg_attr( feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] -#[derive(Debug, Default, PartialEq, Clone, Copy)] #[allow(clippy::large_enum_variant)] +#[cfg_attr(feature = "codama", codama(enum_discriminator(size = number(u32))))] pub enum StakeStateV2 { #[default] Uninitialized, @@ -259,17 +265,21 @@ impl StakeStateV2 { } } +#[cfg_attr(feature = "codama", derive(CodamaType))] +#[derive(Debug, PartialEq, Eq, Clone, Copy)] #[cfg_attr(feature = "frozen-abi", derive(solana_frozen_abi_macro::AbiExample))] #[cfg_attr( feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] -#[derive(Debug, PartialEq, Eq, Clone, Copy)] +#[cfg_attr(feature = "codama", codama(enum_discriminator(size = number(u32))))] pub enum StakeAuthorize { Staker, Withdrawer, } +#[cfg_attr(feature = "codama", derive(CodamaType))] +#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)] #[cfg_attr(feature = "frozen-abi", derive(solana_frozen_abi_macro::AbiExample))] #[cfg_attr( feature = "borsh", @@ -280,7 +290,6 @@ pub enum StakeAuthorize { feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] -#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)] pub struct Lockup { /// `UnixTimestamp` at which this stake will allow withdrawal, unless the /// transaction is signed by the custodian @@ -301,6 +310,8 @@ impl Lockup { } } +#[cfg_attr(feature = "codama", derive(CodamaType))] +#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)] #[cfg_attr(feature = "frozen-abi", derive(solana_frozen_abi_macro::AbiExample))] #[cfg_attr( feature = "borsh", @@ -311,7 +322,6 @@ impl Lockup { feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] -#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)] pub struct Authorized { pub staker: Pubkey, pub withdrawer: Pubkey, @@ -383,6 +393,8 @@ impl Authorized { } } +#[cfg_attr(feature = "codama", derive(CodamaType))] +#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)] #[cfg_attr(feature = "frozen-abi", derive(solana_frozen_abi_macro::AbiExample))] #[cfg_attr( feature = "borsh", @@ -393,7 +405,6 @@ impl Authorized { feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] -#[derive(Default, Debug, PartialEq, Eq, Clone, Copy)] pub struct Meta { pub rent_exempt_reserve: u64, pub authorized: Authorized, @@ -437,6 +448,8 @@ impl Meta { } } +#[cfg_attr(feature = "codama", derive(CodamaType))] +#[derive(Debug, PartialEq, Clone, Copy)] #[cfg_attr(feature = "frozen-abi", derive(solana_frozen_abi_macro::AbiExample))] #[cfg_attr( feature = "borsh", @@ -447,7 +460,6 @@ impl Meta { feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] -#[derive(Debug, PartialEq, Clone, Copy)] pub struct Delegation { /// to whom the stake is delegated pub voter_pubkey: Pubkey, @@ -676,6 +688,8 @@ impl Delegation { } } +#[cfg_attr(feature = "codama", derive(CodamaType))] +#[derive(Debug, Default, PartialEq, Clone, Copy)] #[cfg_attr(feature = "frozen-abi", derive(solana_frozen_abi_macro::AbiExample))] #[cfg_attr( feature = "borsh", @@ -686,7 +700,6 @@ impl Delegation { feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] -#[derive(Debug, Default, PartialEq, Clone, Copy)] pub struct Stake { pub delegation: Delegation, /// credits observed is credits from vote account state when delegated or redeemed diff --git a/package.json b/package.json index ac65323b..790cc4dd 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,8 @@ "generate:clients": "tsx ./scripts/generate-clients.mts && (cd clients/js && pnpm format:fix)" }, "devDependencies": { - "@codama/nodes-from-anchor": "^1.3.7", "@codama/renderers-js": "^1.4", - "@codama/renderers-rust": "~1.0", + "@codama/renderers-rust": "^1.2.9", "@iarna/toml": "^2.2.5", "codama": "^1.5", "tsx": "^4.21.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 75dd91c7..e1fec7e5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,15 +8,12 @@ importers: .: devDependencies: - '@codama/nodes-from-anchor': - specifier: ^1.3.7 - version: 1.3.7(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) '@codama/renderers-js': specifier: ^1.4 version: 1.4.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) '@codama/renderers-rust': - specifier: ~1.0 - version: 1.0.16(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + specifier: ^1.2.9 + version: 1.2.9(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) '@iarna/toml': specifier: ^2.2.5 version: 2.2.5 @@ -39,61 +36,59 @@ packages: resolution: {integrity: sha512-0uLecW/RZC2c1wx3j/eiRAYvilvNY+2DoyEYu/hV0OfM1/uIgIyuy5U+wolV+LY4wLFYdApjYdy+5D32lngCHg==} hasBin: true - '@codama/errors@1.2.8': - resolution: {integrity: sha512-TVPf7oJpbHtxdu52ruftJX+DlTNWi7D65tasysqs7mfRKoiZKzmkatr5hqidBz/M9WzCddUeFAHL9ZiW6g9Ccg==} - hasBin: true - '@codama/errors@1.3.7': resolution: {integrity: sha512-96BF8agDVc2vAgL4qw1lZZfuJ7XBefdzTBk2VOUnOhdMQiLb0QhJCC4BH88OcL+rZXQdet4pk7Qwarj1I1GFKg==} hasBin: true + '@codama/errors@1.4.4': + resolution: {integrity: sha512-XC86H5X+zGTi0cSRKLc+wFkeXNsvnh+ttOgVnVHIljmXOJWbUt9wXhKding3UftipLWwlHPuoswERJ0vS0mO2A==} + hasBin: true + '@codama/errors@1.5.0': resolution: {integrity: sha512-i4cS+S7JaZXhofQHFY3cwzt8rqxUVPNaeJND5VOyKUbtcOi933YXJXk52gDG4mc+CpGqHJijsJjfSpr1lJGxzg==} hasBin: true - '@codama/node-types@1.2.8': - resolution: {integrity: sha512-PEvPLMN3QGJvkwsQ7R9DmAtdazQXN0RD9WYlmHyeiR4nathV0qy9nZGFDoRh5nbNfPkbeLTgL5o3zAoeeRP6GQ==} - '@codama/node-types@1.3.7': resolution: {integrity: sha512-L9UTFfoeki5t+BYJAa4OMsqBPpbMbx8YJQar+55mYcjwGlJsKJW7mRfLYvwEFkCUYyLdNva40OVmTf88jccZCA==} + '@codama/node-types@1.4.4': + resolution: {integrity: sha512-uUeIz34Id/TTAMi4k5OVl9FByM/PawnlNIIVqgpooH9AS0UlniICZ+KJ/mdHZidJs/AGo6bSRoOPS1BLtMajyw==} + '@codama/node-types@1.5.0': resolution: {integrity: sha512-Ebz2vOUukmNaFXWdkni1ZihXkAIUnPYtqIMXYxKXOxjMP+TGz2q0lGtRo7sqw1pc2ksFBIkfBp5pZsl5p6gwXA==} - '@codama/nodes-from-anchor@1.3.7': - resolution: {integrity: sha512-MJbTVfyCAmRilJ6wDqk8dT2kMU3nvUnImaiLLOagAG9aKlKeBcjDvqNp0XM6qhb49jogXgfK7x1q9ERaQQnacQ==} - - '@codama/nodes@1.2.8': - resolution: {integrity: sha512-tCi7KErG2ChQr5n3Nj3dwciFmUo3O8RQ+S4Qv23w1zvYLaGwhEvdg3KRtgCGEI0wr9uvm2QtTBM670kdLntZiQ==} - '@codama/nodes@1.3.7': resolution: {integrity: sha512-3OV6SIBcqsIDARyzZVGdfnffNlnKSYcb0aGp/9Liz5/EID0oBTIyuh/Cmj5Ww6RX4WPb+GNAxABAGW94zbcfQg==} + '@codama/nodes@1.4.4': + resolution: {integrity: sha512-JzlY5qLk3rhsnu0nerC/Vkc9/2HjdsLtEpBtST0dxC1j9kpfHvIc2uyIj+5hlB1YIBRJIDNo+UOHGla8hidkaA==} + '@codama/nodes@1.5.0': resolution: {integrity: sha512-yg+xmorWiMNjS3n19CGIt/FZ/ZCuDIu+HEY45bq6gHu1MN3RtJZY+Q3v0ErnBPA60D8mNWkvkKoeSZXfzcAvfw==} - '@codama/renderers-core@1.0.10': - resolution: {integrity: sha512-7NwoyP2j1cZKgHCrd1RRn891gtxpZeiXNSP3aCFdVsRPW8dDNUL1sJ1SNOF9ILHfNP77clCBtL3eoZIFdeNQAg==} - '@codama/renderers-core@1.2.2': resolution: {integrity: sha512-dPyHgn5L45G+tWP17ITvOlpX3+s2FcJHMjAhFZlmUHAJpH/wl+UsUwuWg698iSb56Er2jUwqX7srw5iZf7XHjQ==} + '@codama/renderers-core@1.3.4': + resolution: {integrity: sha512-+qEPsvpCjUElohgJTcVNsjy6u1LjoCcwo72NbcffLF9QU5mUjNwL8EhFouEq2K60H/QKmNaiVKLQfJcQ/xCT9A==} + '@codama/renderers-js@1.4.3': resolution: {integrity: sha512-FC/wba6IZayKeWk710XP0OJN50kf9B6cVQGo6uXb8M8hMw9qjSJLDPwpou57Y0V7tja3kjTFPBb3I9zHheeDtQ==} engines: {node: '>=20.18.0'} - '@codama/renderers-rust@1.0.16': - resolution: {integrity: sha512-pFHwHN6X4Yuk26Yfh+VT9Ps1i/QEjuK3EoT8BpsCTATOk6ntJNqyD5aQngG2lE4KWx3uQrCYYbQEAN4vG6v+EA==} + '@codama/renderers-rust@1.2.9': + resolution: {integrity: sha512-6sc/g8LYHEa3MFqakEBRJito/1liv1jE1b6P1gGRz7z84YiGscPKh0pbcELlLPxyLraNTBYSA6V9EXrj2LLvIA==} + engines: {node: '>=20.18.0'} '@codama/validators@1.5.0': resolution: {integrity: sha512-p3ufDxnCH1jiuHGzcBv4/d+ctzUcKD2K3gX/W8169tC41o9DggjlEpNy1Z6YAAhVb3wHnmXVGA2qmp32rWSfWw==} - '@codama/visitors-core@1.2.8': - resolution: {integrity: sha512-sYmZT2Z6Goacgr/HrAhjLSGtu2Udcal10tEfYN8ZJBXs34PGPu0oWOC8kFx7CxvmAvt/6mw8NhKIPtg/UaIKHw==} - '@codama/visitors-core@1.3.7': resolution: {integrity: sha512-B1JnzhRDJiLxewha/F3YzeEp8Zrtd7eKiGNJFJHSPufAnIVm2lQUDaKS+OrAOHnSRmRKIAVdzfpFpdz6EM0N6Q==} + '@codama/visitors-core@1.4.4': + resolution: {integrity: sha512-vk/4tczViAUHa7c8PF7FxN+JWbuTcDB0pIdrDbbO6eBPKDPQGZCUCEp6rXIYBVxfO129jWrNf2+CuyYre/c/vA==} + '@codama/visitors-core@1.5.0': resolution: {integrity: sha512-3PIAlBX0a06hIxzyPtQMfQcqWGFBgfbwysSwcXBbvHUYbemwhD6xwlBKJuqTwm9DyFj3faStp5fpvcp03Rjxtw==} @@ -259,16 +254,6 @@ packages: '@iarna/toml@2.2.5': resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==} - '@noble/hashes@2.0.1': - resolution: {integrity: sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw==} - engines: {node: '>= 20.19.0'} - - '@solana/codecs-core@2.0.0-rc.4': - resolution: {integrity: sha512-JIrTSps032mSE3wBxW3bXOqWfoy4CMy1CX/XeVCijyh5kLVxZTSDIdRTYdePdL1yzaOZF1Xysvt1DhOUgBdM+A==} - engines: {node: '>=20.18.0'} - peerDependencies: - typescript: '>=5' - '@solana/codecs-core@4.0.0': resolution: {integrity: sha512-28kNUsyIlhU3MO3/7ZLDqeJf2YAm32B4tnTjl5A9HrbBqsTZ+upT/RzxZGP1MMm7jnPuIKCMwmTpsyqyR6IUpw==} engines: {node: '>=20.18.0'} @@ -281,18 +266,6 @@ packages: peerDependencies: typescript: '>=5.3.3' - '@solana/codecs-data-structures@5.0.0': - resolution: {integrity: sha512-y503Pqmv0LHcfcf0vQJGaxDvydQJbyCo8nK3nxn56EhFj5lBQ1NWb3WvTd83epigwuZurW2MhJARrpikfhQglQ==} - engines: {node: '>=20.18.0'} - peerDependencies: - typescript: '>=5.3.3' - - '@solana/codecs-numbers@2.0.0-rc.4': - resolution: {integrity: sha512-ZJR7TaUO65+3Hzo3YOOUCS0wlzh17IW+j0MZC2LCk1R0woaypRpHKj4iSMYeQOZkMxsd9QT3WNvjFrPC2qA6Sw==} - engines: {node: '>=20.18.0'} - peerDependencies: - typescript: '>=5' - '@solana/codecs-numbers@4.0.0': resolution: {integrity: sha512-z9zpjtcwzqT9rbkKVZpkWB5/0V7+6YRKs6BccHkGJlaDx8Pe/+XOvPi2rEdXPqrPd9QWb5Xp1iBfcgaDMyiOiA==} engines: {node: '>=20.18.0'} @@ -305,13 +278,6 @@ packages: peerDependencies: typescript: '>=5.3.3' - '@solana/codecs-strings@2.0.0-rc.4': - resolution: {integrity: sha512-LGfK2RL0BKjYYUfzu2FG/gTgCsYOMz9FKVs2ntji6WneZygPxJTV5W98K3J8Rl0JewpCSCFQH3xjLSHBJUS0fA==} - engines: {node: '>=20.18.0'} - peerDependencies: - fastestsmallesttextencoderdecoder: ^1.0.22 - typescript: '>=5' - '@solana/codecs-strings@4.0.0': resolution: {integrity: sha512-XvyD+sQ1zyA0amfxbpoFZsucLoe+yASQtDiLUGMDg5TZ82IHE3B7n82jE8d8cTAqi0HgqQiwU13snPhvg1O0Ow==} engines: {node: '>=20.18.0'} @@ -326,19 +292,6 @@ packages: fastestsmallesttextencoderdecoder: ^1.0.22 typescript: '>=5.3.3' - '@solana/codecs@5.0.0': - resolution: {integrity: sha512-KOw0gFUSBxIMDWLJ3AkVFkEci91dw0Rpx3C6y83Our7fSW+SEP8vRZklCElieYR85LHVB1QIEhoeHR7rc+Ifkw==} - engines: {node: '>=20.18.0'} - peerDependencies: - typescript: '>=5.3.3' - - '@solana/errors@2.0.0-rc.4': - resolution: {integrity: sha512-0PPaMyB81keEHG/1pnyEuiBVKctbXO641M2w3CIOrYT/wzjunfF0FTxsqq9wYJeYo0AyiefCKGgSPs6wiY2PpQ==} - engines: {node: '>=20.18.0'} - hasBin: true - peerDependencies: - typescript: '>=5' - '@solana/errors@4.0.0': resolution: {integrity: sha512-3YEtvcMvtcnTl4HahqLt0VnaGVf7vVWOnt6/uPky5e0qV6BlxDSbGkbBzttNjxLXHognV0AQi3pjvrtfUnZmbg==} engines: {node: '>=20.18.0'} @@ -353,12 +306,6 @@ packages: peerDependencies: typescript: '>=5.3.3' - '@solana/options@5.0.0': - resolution: {integrity: sha512-ezHVBFb9FXVSn8LUVRD2tLb6fejU0x8KtGEYyCYh0J0pQuXSITV0IQCjcEopvu/ZxWdXOJyzjvmymnhz90on5A==} - engines: {node: '>=20.18.0'} - peerDependencies: - typescript: '>=5.3.3' - a-sync-waterfall@1.0.1: resolution: {integrity: sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA==} @@ -377,18 +324,10 @@ packages: resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} engines: {node: '>= 0.4'} - call-bound@1.0.3: - resolution: {integrity: sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==} - engines: {node: '>= 0.4'} - call-bound@1.0.4: resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} engines: {node: '>= 0.4'} - chalk@5.4.1: - resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - chalk@5.6.2: resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} @@ -397,14 +336,6 @@ packages: resolution: {integrity: sha512-hhfSzrOiDX3bV7QmJneEBsBk3ln4gIcMJs6P8BlEJ3EFI+P0QZaTT5W61o8Tq0/79hTZeyj0gP65HZ/LYJil+w==} hasBin: true - commander@12.1.0: - resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} - engines: {node: '>=18'} - - commander@13.1.0: - resolution: {integrity: sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==} - engines: {node: '>=18'} - commander@14.0.1: resolution: {integrity: sha512-2JkV3gUZUVrbNA+1sjBOYLsMZ5cEEl8GTFP2a4AVz5hvasAMCQ1D2l2le/cX+pV4N6ZU17zjUahLpIXRrnWL8A==} engines: {node: '>=20'} @@ -486,10 +417,6 @@ packages: isarray@2.0.5: resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} - json-stable-stringify@1.2.1: - resolution: {integrity: sha512-Lp6HbbBgosLmJbjx0pBLbgvx68FaFU1sdkmBuckmhhJ88kL13OA51CDtR2yJB50eCNMH9wRqtQNNiAqQH4YXnA==} - engines: {node: '>= 0.4'} - json-stable-stringify@1.3.0: resolution: {integrity: sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==} engines: {node: '>= 0.4'} @@ -567,68 +494,57 @@ snapshots: picocolors: 1.1.1 prompts: 2.4.2 - '@codama/errors@1.2.8': - dependencies: - '@codama/node-types': 1.2.8 - chalk: 5.4.1 - commander: 13.1.0 - '@codama/errors@1.3.7': dependencies: '@codama/node-types': 1.3.7 commander: 14.0.1 picocolors: 1.1.1 + '@codama/errors@1.4.4': + dependencies: + '@codama/node-types': 1.4.4 + commander: 14.0.2 + picocolors: 1.1.1 + '@codama/errors@1.5.0': dependencies: '@codama/node-types': 1.5.0 commander: 14.0.2 picocolors: 1.1.1 - '@codama/node-types@1.2.8': {} - '@codama/node-types@1.3.7': {} - '@codama/node-types@1.5.0': {} - - '@codama/nodes-from-anchor@1.3.7(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': - dependencies: - '@codama/errors': 1.5.0 - '@codama/nodes': 1.5.0 - '@codama/visitors': 1.5.0 - '@noble/hashes': 2.0.1 - '@solana/codecs': 5.0.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) - transitivePeerDependencies: - - fastestsmallesttextencoderdecoder - - typescript + '@codama/node-types@1.4.4': {} - '@codama/nodes@1.2.8': - dependencies: - '@codama/errors': 1.2.8 - '@codama/node-types': 1.2.8 + '@codama/node-types@1.5.0': {} '@codama/nodes@1.3.7': dependencies: '@codama/errors': 1.3.7 '@codama/node-types': 1.3.7 + '@codama/nodes@1.4.4': + dependencies: + '@codama/errors': 1.4.4 + '@codama/node-types': 1.4.4 + '@codama/nodes@1.5.0': dependencies: '@codama/errors': 1.5.0 '@codama/node-types': 1.5.0 - '@codama/renderers-core@1.0.10': - dependencies: - '@codama/errors': 1.2.8 - '@codama/nodes': 1.2.8 - '@codama/visitors-core': 1.2.8 - '@codama/renderers-core@1.2.2': dependencies: '@codama/errors': 1.3.7 '@codama/nodes': 1.3.7 '@codama/visitors-core': 1.3.7 + '@codama/renderers-core@1.3.4': + dependencies: + '@codama/errors': 1.4.4 + '@codama/nodes': 1.4.4 + '@codama/visitors-core': 1.4.4 + '@codama/renderers-js@1.4.3(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: '@codama/errors': 1.3.7 @@ -641,13 +557,13 @@ snapshots: - fastestsmallesttextencoderdecoder - typescript - '@codama/renderers-rust@1.0.16(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + '@codama/renderers-rust@1.2.9(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: - '@codama/errors': 1.2.8 - '@codama/nodes': 1.2.8 - '@codama/renderers-core': 1.0.10 - '@codama/visitors-core': 1.2.8 - '@solana/codecs-strings': 2.0.0-rc.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@codama/errors': 1.4.4 + '@codama/nodes': 1.4.4 + '@codama/renderers-core': 1.3.4 + '@codama/visitors-core': 1.4.4 + '@solana/codecs-strings': 5.0.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) nunjucks: 3.2.4 transitivePeerDependencies: - chokidar @@ -660,18 +576,18 @@ snapshots: '@codama/nodes': 1.5.0 '@codama/visitors-core': 1.5.0 - '@codama/visitors-core@1.2.8': - dependencies: - '@codama/errors': 1.2.8 - '@codama/nodes': 1.2.8 - json-stable-stringify: 1.2.1 - '@codama/visitors-core@1.3.7': dependencies: '@codama/errors': 1.3.7 '@codama/nodes': 1.3.7 json-stable-stringify: 1.3.0 + '@codama/visitors-core@1.4.4': + dependencies: + '@codama/errors': 1.4.4 + '@codama/nodes': 1.4.4 + json-stable-stringify: 1.3.0 + '@codama/visitors-core@1.5.0': dependencies: '@codama/errors': 1.5.0 @@ -764,13 +680,6 @@ snapshots: '@iarna/toml@2.2.5': {} - '@noble/hashes@2.0.1': {} - - '@solana/codecs-core@2.0.0-rc.4(typescript@5.9.3)': - dependencies: - '@solana/errors': 2.0.0-rc.4(typescript@5.9.3) - typescript: 5.9.3 - '@solana/codecs-core@4.0.0(typescript@5.9.3)': dependencies: '@solana/errors': 4.0.0(typescript@5.9.3) @@ -781,19 +690,6 @@ snapshots: '@solana/errors': 5.0.0(typescript@5.9.3) typescript: 5.9.3 - '@solana/codecs-data-structures@5.0.0(typescript@5.9.3)': - dependencies: - '@solana/codecs-core': 5.0.0(typescript@5.9.3) - '@solana/codecs-numbers': 5.0.0(typescript@5.9.3) - '@solana/errors': 5.0.0(typescript@5.9.3) - typescript: 5.9.3 - - '@solana/codecs-numbers@2.0.0-rc.4(typescript@5.9.3)': - dependencies: - '@solana/codecs-core': 2.0.0-rc.4(typescript@5.9.3) - '@solana/errors': 2.0.0-rc.4(typescript@5.9.3) - typescript: 5.9.3 - '@solana/codecs-numbers@4.0.0(typescript@5.9.3)': dependencies: '@solana/codecs-core': 4.0.0(typescript@5.9.3) @@ -806,14 +702,6 @@ snapshots: '@solana/errors': 5.0.0(typescript@5.9.3) typescript: 5.9.3 - '@solana/codecs-strings@2.0.0-rc.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': - dependencies: - '@solana/codecs-core': 2.0.0-rc.4(typescript@5.9.3) - '@solana/codecs-numbers': 2.0.0-rc.4(typescript@5.9.3) - '@solana/errors': 2.0.0-rc.4(typescript@5.9.3) - fastestsmallesttextencoderdecoder: 1.0.22 - typescript: 5.9.3 - '@solana/codecs-strings@4.0.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': dependencies: '@solana/codecs-core': 4.0.0(typescript@5.9.3) @@ -830,23 +718,6 @@ snapshots: fastestsmallesttextencoderdecoder: 1.0.22 typescript: 5.9.3 - '@solana/codecs@5.0.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': - dependencies: - '@solana/codecs-core': 5.0.0(typescript@5.9.3) - '@solana/codecs-data-structures': 5.0.0(typescript@5.9.3) - '@solana/codecs-numbers': 5.0.0(typescript@5.9.3) - '@solana/codecs-strings': 5.0.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) - '@solana/options': 5.0.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) - typescript: 5.9.3 - transitivePeerDependencies: - - fastestsmallesttextencoderdecoder - - '@solana/errors@2.0.0-rc.4(typescript@5.9.3)': - dependencies: - chalk: 5.6.2 - commander: 12.1.0 - typescript: 5.9.3 - '@solana/errors@4.0.0(typescript@5.9.3)': dependencies: chalk: 5.6.2 @@ -859,17 +730,6 @@ snapshots: commander: 14.0.1 typescript: 5.9.3 - '@solana/options@5.0.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': - dependencies: - '@solana/codecs-core': 5.0.0(typescript@5.9.3) - '@solana/codecs-data-structures': 5.0.0(typescript@5.9.3) - '@solana/codecs-numbers': 5.0.0(typescript@5.9.3) - '@solana/codecs-strings': 5.0.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) - '@solana/errors': 5.0.0(typescript@5.9.3) - typescript: 5.9.3 - transitivePeerDependencies: - - fastestsmallesttextencoderdecoder - a-sync-waterfall@1.0.1: {} asap@2.0.6: {} @@ -891,18 +751,11 @@ snapshots: get-intrinsic: 1.2.7 set-function-length: 1.2.2 - call-bound@1.0.3: - dependencies: - call-bind-apply-helpers: 1.0.1 - get-intrinsic: 1.2.7 - call-bound@1.0.4: dependencies: call-bind-apply-helpers: 1.0.2 get-intrinsic: 1.3.0 - chalk@5.4.1: {} - chalk@5.6.2: {} codama@1.5.0: @@ -913,10 +766,6 @@ snapshots: '@codama/validators': 1.5.0 '@codama/visitors': 1.5.0 - commander@12.1.0: {} - - commander@13.1.0: {} - commander@14.0.1: {} commander@14.0.2: {} @@ -1028,14 +877,6 @@ snapshots: isarray@2.0.5: {} - json-stable-stringify@1.2.1: - dependencies: - call-bind: 1.0.8 - call-bound: 1.0.3 - isarray: 2.0.5 - jsonify: 0.0.1 - object-keys: 1.1.1 - json-stable-stringify@1.3.0: dependencies: call-bind: 1.0.8 diff --git a/program/idl.json b/program/idl.json deleted file mode 100644 index ce6876e9..00000000 --- a/program/idl.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "version": "1.17.13", - "name": "stake_program", - "instructions": [ - { - "name": "Initialize", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "desc": "The stake account to initialize" - }, - { - "name": "rent", - "isMut": false, - "isSigner": false, - "desc": "Rent sysvar" - } - ], - "args": [ - { - "name": "authorized", - "type": { - "defined": "Authorized" - } - }, - { - "name": "lockup", - "type": { - "defined": "Lockup" - } - } - ] - }, - { - "name": "Authorize", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "desc": "The stake account to be updated" - }, - { - "name": "clock", - "isMut": false, - "isSigner": false, - "desc": "Clock sysvar" - }, - { - "name": "authority", - "isMut": false, - "isSigner": true, - "desc": "stake's current stake or withdraw authority to change away from. If stake Lockup is active, the signing lockup authority must follow if updating withdrawer" - } - ], - "args": [ - { - "name": "newAuthority", - "type": "publicKey" - }, - { - "name": "stakeAuthorize", - "type": { - "defined": "StakeAuthorize" - } - } - ] - }, - { - "name": "DelegateStake", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "desc": "The stake account to be delegated" - }, - { - "name": "vote", - "isMut": false, - "isSigner": false, - "desc": "Vote account to which stake will be delegated" - }, - { - "name": "clock", - "isMut": false, - "isSigner": false, - "desc": "Clock sysvar" - }, - { - "name": "stakeHistory", - "isMut": false, - "isSigner": false, - "desc": "Stake history sysvar" - }, - { - "name": "stakeConfig", - "isMut": false, - "isSigner": false, - "desc": "Stake config native program" - }, - { - "name": "stakeAuthority", - "isMut": false, - "isSigner": true, - "desc": "stake's stake authority" - } - ] - }, - { - "name": "Split", - "accounts": [ - { - "name": "from", - "isMut": true, - "isSigner": false, - "desc": "The stake account to split. Must be in the Initialized or Stake state" - }, - { - "name": "to", - "isMut": true, - "isSigner": false, - "desc": "The uninitialized stake account to split to. Must be rent-exempt starting from solana 1.17." - }, - { - "name": "stakeAuthority", - "isMut": false, - "isSigner": true, - "desc": "from's stake authority" - } - ], - "args": [{ "name": "lamports", "type": "u64" }] - }, - { - "name": "Withdraw", - "accounts": [ - { - "name": "from", - "isMut": true, - "isSigner": false, - "desc": "The stake account to withdraw from" - }, - { - "name": "to", - "isMut": true, - "isSigner": false, - "desc": "Recipient account" - }, - { - "name": "clock", - "isMut": false, - "isSigner": false, - "desc": "Clock sysvar" - }, - { - "name": "stakeHistory", - "isMut": false, - "isSigner": false, - "desc": "Stake history sysvar" - }, - { - "name": "withdrawAuthority", - "isMut": false, - "isSigner": true, - "desc": "from's withdraw authority. If stake Lockup is active, the signing lockup authority must follow." - } - ], - "args": [{ "name": "lamports", "type": "u64" }] - }, - { - "name": "Deactivate", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "desc": "The stake account to deactivate" - }, - { - "name": "clock", - "isMut": false, - "isSigner": false, - "desc": "Clock sysvar" - }, - { - "name": "stakeAuthority", - "isMut": false, - "isSigner": true, - "desc": "stake's stake authority" - } - ] - }, - { - "name": "SetLockup", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "desc": "The stake account to set the lockup of" - }, - { - "name": "authority", - "isMut": false, - "isSigner": true, - "desc": "stake's withdraw authority or lockup authority if lockup is active" - } - ], - "args": [ - { - "name": "unixTimestamp", - "type": { "option": "i64" } - }, - { - "name": "epoch", - "type": { "option": "u64" } - }, - { - "name": "custodian", - "type": { "option": "publicKey" } - } - ] - }, - { - "name": "Merge", - "accounts": [ - { - "name": "to", - "isMut": true, - "isSigner": false, - "desc": "The destination stake account to merge into" - }, - { - "name": "from", - "isMut": true, - "isSigner": false, - "desc": "The stake account to merge from. Must have exact same lockup and authority as to. This account will be drained." - }, - { - "name": "clock", - "isMut": false, - "isSigner": false, - "desc": "Clock sysvar" - }, - { - "name": "stakeHistory", - "isMut": false, - "isSigner": false, - "desc": "Stake history sysvar" - }, - { - "name": "stakeAuthority", - "isMut": false, - "isSigner": true, - "desc": "Both from and to's stake authority" - } - ] - }, - { - "name": "AuthorizeWithSeed", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "desc": "The stake account to be updated, with the authority to be updated being an account created with Pubkey::create_with_seed()" - }, - { - "name": "authorityBase", - "isMut": false, - "isSigner": true, - "desc": "Base account of stake's authority to be updated" - }, - { - "name": "clock", - "isMut": false, - "isSigner": false, - "desc": "Clock sysvar. If stake Lockup is active, the signing lockup authority must follow if updating withdrawer." - } - ], - "args": [ - { - "name": "newAuthority", - "type": "publicKey" - }, - { - "name": "stakeAuthorize", - "type": { "defined": "StakeAuthorize" } - }, - { - "name": "authoritySeed", - "type": "string" - }, - { - "name": "authorityOwner", - "type": "publicKey" - } - ] - }, - { - "name": "InitializeChecked", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "desc": "The stake account to initialize" - }, - { - "name": "rent", - "isMut": false, - "isSigner": false, - "desc": "Rent sysvar" - }, - { - "name": "stakeAuthority", - "isMut": false, - "isSigner": false, - "desc": "stake's new stake authority" - }, - { - "name": "withdrawAuthority", - "isMut": false, - "isSigner": true, - "desc": "stake's new withdraw authority" - } - ] - }, - { - "name": "AuthorizeChecked", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "desc": "The stake account to be updated" - }, - { - "name": "clock", - "isMut": false, - "isSigner": false, - "desc": "Clock sysvar" - }, - { - "name": "authority", - "isMut": false, - "isSigner": true, - "desc": "stake's current stake or withdraw authority to change away from" - }, - { - "name": "newAuthority", - "isMut": false, - "isSigner": true, - "desc": "stake's new stake or withdraw authority to change to. If stake Lockup is active, the signing lockup authority must follow if updating withdrawer." - } - ], - "args": [ - { "name": "stakeAuthorize", "type": { "defined": "StakeAuthorize" } } - ] - }, - { - "name": "AuthorizeCheckedWithSeed", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "desc": "The stake account to be updated" - }, - { - "name": "authorityBase", - "isMut": false, - "isSigner": true, - "desc": "Base account of stake's authority to be updated" - }, - { - "name": "clock", - "isMut": false, - "isSigner": false, - "desc": "Clock sysvar" - }, - { - "name": "newAuthority", - "isMut": false, - "isSigner": true, - "desc": "stake's new stake or withdraw authority to change to. If stake Lockup is active, the signing lockup authority must follow if updating withdrawer." - } - ], - "args": [ - { "name": "stakeAuthorize", "type": { "defined": "StakeAuthorize" } }, - { "name": "authoritySeed", "type": "string" }, - { "name": "authorityOwner", "type": "publicKey" } - ] - }, - { - "name": "SetLockupChecked", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "desc": "The stake account to set the lockup of" - }, - { - "name": "authority", - "isMut": false, - "isSigner": true, - "desc": "stake's withdraw authority or lockup authority if lockup is active. If setting a new lockup authority, the signing new lockup authority must follow." - } - ], - "args": [ - { "name": "unixTimestamp", "type": { "option": "i64" } }, - { "name": "epoch", "type": { "option": "u64" } } - ] - }, - { - "name": "GetMinimumDelegation" - }, - { - "name": "DeactivateDelinquent", - "accounts": [ - { - "name": "stake", - "isMut": true, - "isSigner": false, - "desc": "The delinquent stake account to deactivate" - }, - { - "name": "vote", - "isMut": false, - "isSigner": false, - "desc": "stake's delinquent vote account" - }, - { - "name": "referenceVote", - "isMut": false, - "isSigner": false, - "desc": "Reference vote account that has voted at least once in the last MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION epochs" - } - ] - } - ], - "types": [ - { - "name": "Authorized", - "type": { - "kind": "struct", - "fields": [ - { - "name": "staker", - "type": "publicKey" - }, - { - "name": "withdrawer", - "type": "publicKey" - } - ] - } - }, - { - "name": "Lockup", - "type": { - "kind": "struct", - "fields": [ - { - "name": "unixTimestamp", - "type": "i64" - }, - { - "name": "epoch", - "type": "u64" - }, - { - "name": "custodian", - "type": "publicKey" - } - ] - } - }, - { - "name": "StakeAuthorize", - "type": { - "kind": "enum", - "variants": [ - { - "name": "Staker" - }, - { - "name": "Withdrawer" - } - ] - } - } - ], - "metadata": { - "origin": "anchor", - "address": "Stake11111111111111111111111111111111111111" - } - } - \ No newline at end of file diff --git a/program/tests/stake_instruction.rs b/program/tests/stake_instruction.rs index 58df8118..df5136ef 100644 --- a/program/tests/stake_instruction.rs +++ b/program/tests/stake_instruction.rs @@ -1037,6 +1037,7 @@ fn test_stake_checked_instructions() { } #[test] +#[allow(deprecated)] // TODO: remove need for this fn test_stake_initialize() { let mollusk = mollusk_bpf(); @@ -2207,6 +2208,7 @@ fn test_redelegate_consider_balance_changes() { } #[test] +#[allow(deprecated)] // TODO: remove need for this fn test_split() { let mollusk = mollusk_bpf(); diff --git a/rust-toolchain.toml b/rust-toolchain.toml index cf6d0f55..ff100edc 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.86.0" +channel = "1.90.0" diff --git a/scripts/generate-clients.mts b/scripts/generate-clients.mts index 03fb7c28..15714949 100644 --- a/scripts/generate-clients.mts +++ b/scripts/generate-clients.mts @@ -1,16 +1,15 @@ #!/usr/bin/env zx import 'zx/globals'; import * as c from 'codama'; -import { rootNodeFromAnchor } from '@codama/nodes-from-anchor'; import { renderVisitor as renderJavaScriptVisitor } from '@codama/renderers-js'; import { renderVisitor as renderRustVisitor } from '@codama/renderers-rust'; import { getToolchainArgument, workingDirectory } from './utils.mts'; -// Instanciate Codama from the IDL. +// Load the auto-generated IDL from Codama macros const idl = JSON.parse( fs.readFileSync(path.join(workingDirectory, 'interface', 'idl.json'), 'utf-8') ); -const codama = c.createFromRoot(rootNodeFromAnchor(idl)); +const codama = c.createFromRoot(idl); // Rename the program. codama.update( @@ -26,18 +25,60 @@ codama.update( }) ); -// Add missing types from the IDL. +// Rename instruction argument types to avoid collisions with encoder arg types +codama.update( + c.updateDefinedTypesVisitor({ + lockupArgs: { name: 'lockupParams' }, + lockupCheckedArgs: { name: 'lockupCheckedParams' }, + authorizeWithSeedArgs: { name: 'authorizeWithSeedParams' }, + authorizeCheckedWithSeedArgs: { name: 'authorizeCheckedWithSeedParams' }, + }) +); + +// Unwrap defined type links used only as instruction args, then flatten them +codama.update(c.unwrapInstructionArgsDefinedTypesVisitor()); +codama.update(c.flattenInstructionDataArgumentsVisitor()); + +// Add type aliases for semantic external types codama.update( c.bottomUpTransformerVisitor([ { - select: '[programNode]stake', + select: '[programNode]', + transform: (node) => { + c.assertIsNode(node, 'programNode'); + return { + ...node, + definedTypes: [ + // Add Epoch type alias + c.definedTypeNode({ + name: 'epoch', + type: c.numberTypeNode('u64'), + }), + // Add UnixTimestamp type alias + c.definedTypeNode({ + name: 'unixTimestamp', + type: c.numberTypeNode('i64'), + }), + ...node.definedTypes, + ], + }; + }, + }, + ]) +); + +// Apply transformations to the IDL +codama.update( + c.bottomUpTransformerVisitor([ + { + select: '[programNode]', transform: (node) => { c.assertIsNode(node, 'programNode'); return { ...node, accounts: [ ...node.accounts, - // stake account + // Stake account wrapper for client convenience c.accountNode({ name: 'stakeStateAccount', data: c.structTypeNode([ @@ -48,125 +89,9 @@ codama.update( ]), }), ], - errors: [ - c.errorNode({ - code: 0, - name: 'NoCreditsToRedeem', - message: 'Not enough credits to redeem', - }), - c.errorNode({ - code: 1, - name: 'LockupInForce', - message: 'Lockup has not yet expired', - }), - c.errorNode({ - code: 2, - name: 'AlreadyDeactivated', - message: 'Stake already deactivated', - }), - c.errorNode({ - code: 3, - name: 'TooSoonToRedelegate', - message: 'One re-delegation permitted per epoch', - }), - c.errorNode({ - code: 4, - name: 'InsufficientStake', - message: 'Split amount is more than is staked', - }), - c.errorNode({ - code: 5, - name: 'MergeTransientStake', - message: 'Stake account with transient stake cannot be merged', - }), - c.errorNode({ - code: 6, - name: 'MergeMismatch', - message: - 'Stake account merge failed due to different authority, lockups or state', - }), - c.errorNode({ - code: 7, - name: 'CustodianMissing', - message: 'Custodian address not present', - }), - c.errorNode({ - code: 8, - name: 'CustodianSignatureMissing', - message: 'Custodian signature not present', - }), - c.errorNode({ - code: 9, - name: 'InsufficientReferenceVotes', - message: - 'Insufficient voting activity in the reference vote account', - }), - c.errorNode({ - code: 10, - name: 'VoteAddressMismatch', - message: - 'Stake account is not delegated to the provided vote account', - }), - c.errorNode({ - code: 11, - name: 'MinimumDelinquentEpochsForDeactivationNotMet', - message: - 'Stake account has not been delinquent for the minimum epochs required for deactivation', - }), - c.errorNode({ - code: 12, - name: 'InsufficientDelegation', - message: 'Delegation amount is less than the minimum', - }), - c.errorNode({ - code: 13, - name: 'RedelegateTransientOrInactiveStake', - message: - 'Stake account with transient or inactive stake cannot be redelegated', - }), - c.errorNode({ - code: 14, - name: 'RedelegateToSameVoteAccount', - message: - 'Stake redelegation to the same vote account is not permitted', - }), - c.errorNode({ - code: 15, - name: 'RedelegatedStakeMustFullyActivateBeforeDeactivationIsPermitted', - message: - 'Redelegated stake must be fully activated before deactivation', - }), - c.errorNode({ - code: 16, - name: 'EpochRewardsActive', - message: - 'Stake action is not permitted while the epoch rewards period is active', - }), - ], }; }, }, - { - // Epoch -> u64 - select: '[definedTypeLinkNode]epoch', - transform: () => { - return c.numberTypeNode('u64'); - }, - }, - { - // UnixTimestamp -> i64 - select: '[definedTypeLinkNode]unixTimestamp', - transform: () => { - return c.numberTypeNode('i64'); - }, - }, - { - // [definedType]f64 -> [numberType]f64 - select: '[definedTypeLinkNode]f64', - transform: () => { - return c.numberTypeNode('f64'); - }, - }, { // enum discriminator -> u32 select: '[definedTypeNode]stakeState.[enumTypeNode]', @@ -194,7 +119,15 @@ codama.update( select: '[instructionNode]', transform: (node) => { c.assertIsNode(node, 'instructionNode'); - return { ...node, optionalAccountStrategy: 'omitted' }; + return { + ...node, + optionalAccountStrategy: 'omitted', + arguments: node.arguments.map((arg) => + arg.name === 'discriminator' + ? { ...arg, type: c.numberTypeNode('u32') } + : arg + ), + }; }, }, ]) @@ -240,3 +173,4 @@ codama.accept( }, }) ); + diff --git a/scripts/solana.dic b/scripts/solana.dic index 7c3905d1..6c0dd4f2 100644 --- a/scripts/solana.dic +++ b/scripts/solana.dic @@ -7,6 +7,7 @@ cooldown deallocated entrypoint fn +IDL lamports mergeable pubkey From a76c20abc27cbd0e95c34f5c9513e4356b3965ba Mon Sep 17 00:00:00 2001 From: rustopian <96253492+rustopian@users.noreply.github.com> Date: Fri, 12 Dec 2025 16:31:40 +0400 Subject: [PATCH 2/3] collapse more attrs --- interface/src/instruction.rs | 24 ++++++++++++++++-------- interface/src/state.rs | 21 +++++++++++++++------ 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/interface/src/instruction.rs b/interface/src/instruction.rs index b1993ac8..373212c1 100644 --- a/interface/src/instruction.rs +++ b/interface/src/instruction.rs @@ -525,9 +525,8 @@ pub enum StakeInstruction { MoveLamports(#[cfg_attr(feature = "codama", codama(name = "args"))] u64), } -#[cfg_attr(feature = "codama", derive(CodamaType))] +#[cfg_attr(feature = "codama", derive(CodamaType), codama(name = "lockupParams"))] #[derive(Default, Debug, PartialEq, Eq, Clone, Copy)] -#[cfg_attr(feature = "codama", codama(name = "lockupParams"))] #[cfg_attr( feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) @@ -538,9 +537,12 @@ pub struct LockupArgs { pub custodian: Option, } -#[cfg_attr(feature = "codama", derive(CodamaType))] +#[cfg_attr( + feature = "codama", + derive(CodamaType), + codama(name = "lockupCheckedParams") +)] #[derive(Default, Debug, PartialEq, Eq, Clone, Copy)] -#[cfg_attr(feature = "codama", codama(name = "lockupCheckedParams"))] #[cfg_attr( feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) @@ -550,9 +552,12 @@ pub struct LockupCheckedArgs { pub epoch: Option, } -#[cfg_attr(feature = "codama", derive(CodamaType))] +#[cfg_attr( + feature = "codama", + derive(CodamaType), + codama(name = "authorizeWithSeedParams") +)] #[derive(Debug, PartialEq, Eq, Clone)] -#[cfg_attr(feature = "codama", codama(name = "authorizeWithSeedParams"))] #[cfg_attr( feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) @@ -564,9 +569,12 @@ pub struct AuthorizeWithSeedArgs { pub authority_owner: Pubkey, } -#[cfg_attr(feature = "codama", derive(CodamaType))] +#[cfg_attr( + feature = "codama", + derive(CodamaType), + codama(name = "authorizeCheckedWithSeedParams") +)] #[derive(Debug, PartialEq, Eq, Clone)] -#[cfg_attr(feature = "codama", codama(name = "authorizeCheckedWithSeedParams"))] #[cfg_attr( feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) diff --git a/interface/src/state.rs b/interface/src/state.rs index 13ec0b34..6b8e827b 100644 --- a/interface/src/state.rs +++ b/interface/src/state.rs @@ -81,7 +81,11 @@ macro_rules! impl_borsh_stake_state { } }; } -#[cfg_attr(feature = "codama", derive(CodamaType))] +#[cfg_attr( + feature = "codama", + derive(CodamaType), + codama(enum_discriminator(size = number(u32))) +)] #[derive(Debug, Default, PartialEq, Clone, Copy)] #[cfg_attr(feature = "frozen-abi", derive(solana_frozen_abi_macro::AbiExample))] #[cfg_attr( @@ -93,7 +97,6 @@ macro_rules! impl_borsh_stake_state { since = "1.17.0", note = "Please use `StakeStateV2` instead, and match the third `StakeFlags` field when matching `StakeStateV2::Stake` to resolve any breakage. For example, `if let StakeState::Stake(meta, stake)` becomes `if let StakeStateV2::Stake(meta, stake, _stake_flags)`." )] -#[cfg_attr(feature = "codama", codama(enum_discriminator(size = number(u32))))] pub enum StakeState { #[default] Uninitialized, @@ -144,7 +147,11 @@ impl StakeState { } } -#[cfg_attr(feature = "codama", derive(CodamaType))] +#[cfg_attr( + feature = "codama", + derive(CodamaType), + codama(enum_discriminator(size = number(u32))) +)] #[derive(Debug, Default, PartialEq, Clone, Copy)] #[cfg_attr(feature = "frozen-abi", derive(solana_frozen_abi_macro::AbiExample))] #[cfg_attr( @@ -152,7 +159,6 @@ impl StakeState { derive(serde_derive::Deserialize, serde_derive::Serialize) )] #[allow(clippy::large_enum_variant)] -#[cfg_attr(feature = "codama", codama(enum_discriminator(size = number(u32))))] pub enum StakeStateV2 { #[default] Uninitialized, @@ -265,14 +271,17 @@ impl StakeStateV2 { } } -#[cfg_attr(feature = "codama", derive(CodamaType))] +#[cfg_attr( + feature = "codama", + derive(CodamaType), + codama(enum_discriminator(size = number(u32))) +)] #[derive(Debug, PartialEq, Eq, Clone, Copy)] #[cfg_attr(feature = "frozen-abi", derive(solana_frozen_abi_macro::AbiExample))] #[cfg_attr( feature = "serde", derive(serde_derive::Deserialize, serde_derive::Serialize) )] -#[cfg_attr(feature = "codama", codama(enum_discriminator(size = number(u32))))] pub enum StakeAuthorize { Staker, Withdrawer, From e3f1a65a27c84c6e7b7fdd682d80e8f4efbc57bd Mon Sep 17 00:00:00 2001 From: Peter Keay <96253492+rustopian@users.noreply.github.com> Date: Fri, 12 Dec 2025 20:59:21 +0400 Subject: [PATCH 3/3] use newly published codama --- interface/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/Cargo.toml b/interface/Cargo.toml index 2a534a0e..9f8f0a2a 100644 --- a/interface/Cargo.toml +++ b/interface/Cargo.toml @@ -18,8 +18,8 @@ program-id = "Stake11111111111111111111111111111111111111" [dependencies] borsh = { version = "1.5.7", features = ["derive", "unstable__schema"], optional = true } -codama = { version = "0.7.0", optional = true, git = "https://github.com/rustopian/codama-rs.git", branch = "multiple-attributes" } -codama-macros = { version = "0.7.0", optional = true, git = "https://github.com/rustopian/codama-rs.git", branch = "multiple-attributes" } +codama = { version = "0.7.1", optional = true } +codama-macros = { version = "0.7.1", optional = true } num-traits = "0.2" serde = { version = "1.0.210", optional = true } serde_derive = { version = "1.0.210", optional = true }