From 158fa1dea64ceb45434ad5ba4b062482b5433078 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 2 Dec 2020 18:37:53 -0800 Subject: [PATCH] Upgrade to Solana v1.4.14 --- Cargo.lock | 151 +++++++++--------- associated-token-account/program/Cargo.toml | 6 +- .../program/src/processor.rs | 14 +- ci/solana-version.sh | 2 +- .../rust/cross-program-invocation/Cargo.toml | 6 +- examples/rust/custom-heap/Cargo.toml | 6 +- examples/rust/logging/Cargo.toml | 6 +- examples/rust/logging/src/processor.rs | 13 +- examples/rust/sysvar/Cargo.toml | 6 +- examples/rust/sysvar/src/processor.rs | 4 +- examples/rust/transfer-lamports/Cargo.toml | 6 +- feature-proposal/cli/Cargo.toml | 10 +- feature-proposal/program/Cargo.toml | 6 +- feature-proposal/program/src/instruction.rs | 6 +- feature-proposal/program/src/processor.rs | 54 +++---- feature-proposal/program/src/state.rs | 6 +- memo/program/Cargo.toml | 2 +- shared-memory/program/Cargo.toml | 6 +- stake-pool/cli/Cargo.toml | 14 +- stake-pool/program/Cargo.toml | 6 +- stake-pool/program/src/processor.rs | 42 ++--- themis/client_ristretto/Cargo.toml | 14 +- themis/program_ristretto/Cargo.toml | 2 +- token-lending/program/Cargo.toml | 2 +- token-lending/program/src/processor.rs | 4 +- token-swap/program/Cargo.toml | 4 +- token-swap/program/fuzz/Cargo.toml | 2 +- token-swap/program/src/processor.rs | 62 ++++--- token/cli/Cargo.toml | 16 +- token/perf-monitor/Cargo.toml | 6 +- token/program-v3/Cargo.toml | 4 +- token/program-v3/src/processor.rs | 72 ++++----- token/program/Cargo.toml | 4 +- token/program/src/processor.rs | 74 +++++---- utils/test-client/Cargo.toml | 2 +- 35 files changed, 319 insertions(+), 321 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fd2c01d3..e6ce3c0f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -706,19 +706,6 @@ dependencies = [ "syn 1.0.48", ] -[[package]] -name = "curve25519-dalek" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d85653f070353a16313d0046f173f70d1aadd5b42600a14de626f0dfb3473a5" -dependencies = [ - "byteorder", - "digest 0.8.1", - "rand_core", - "subtle 2.2.3", - "zeroize", -] - [[package]] name = "curve25519-dalek" version = "2.1.0" @@ -733,6 +720,19 @@ dependencies = [ "zeroize", ] +[[package]] +name = "curve25519-dalek" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d85653f070353a16313d0046f173f70d1aadd5b42600a14de626f0dfb3473a5" +dependencies = [ + "byteorder", + "digest 0.8.1", + "rand_core", + "subtle 2.2.3", + "zeroize", +] + [[package]] name = "curve25519-dalek" version = "3.0.0" @@ -1197,9 +1197,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "goblin" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d20fd25aa456527ce4f544271ae4fea65d2eda4a6561ea56f39fb3ee4f7e3884" +checksum = "c69552f48b18aa6102ce0c82dd9bc9d3f8af5fc0a5797069b1b466b90570e39c" dependencies = [ "log", "plain", @@ -2804,9 +2804,9 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "137e32e093b5482dd2664a5af9a292724b2c8910cb0a0edd1b4005ed5bfd4e18" +checksum = "29fa579ccae25e66c5b9f3e058b16b19efc823e653ee491bbcda1f06a440de7a" dependencies = [ "Inflector", "base64 0.12.3", @@ -2823,13 +2823,14 @@ dependencies = [ "solana-vote-program", "spl-token 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", + "zstd", ] [[package]] name = "solana-banks-client" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ba5c942e192cf6a9ca0bef173108820449f6c5bec3524611efe0daf93b5ad8" +checksum = "3b5fb0f421a17f49e9393bd7a623825274ad8b84ce7d721f3683398a36dac4f3" dependencies = [ "async-trait", "bincode", @@ -2843,9 +2844,9 @@ dependencies = [ [[package]] name = "solana-banks-interface" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325add0d2ec59f38ee2206e1eb1113763385287ca1a648bdea58bd9f4c156725" +checksum = "73061a730fe80e29591735f1293b98ad9e1991bfad4adcc39ed32185ba5a996b" dependencies = [ "serde", "solana-sdk", @@ -2854,9 +2855,9 @@ dependencies = [ [[package]] name = "solana-banks-server" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8659d12b8349d5c1c5a1b5e8c50af80a71ed7dd69ef4bb2107b45625636381" +checksum = "674876a417bea9579735ae03b8c929fb1a8297d923defbea9db48fa4da1d205f" dependencies = [ "bincode", "futures 0.3.5", @@ -2872,9 +2873,9 @@ dependencies = [ [[package]] name = "solana-bpf-loader-program" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9c406a6d27ab1605dd03aca179cf4936cd2de784ddd49ecb9feb6585d3fda13" +checksum = "28cb2d5cd3e172ae96a68b1724bed3fd99b8498b5df0f536505bec9c27855ab4" dependencies = [ "bincode", "byteorder", @@ -2889,9 +2890,9 @@ dependencies = [ [[package]] name = "solana-clap-utils" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4445f596921605c1fd9257511a3f4f27b0ed5c722278284d235dae9284455f05" +checksum = "90e908b0267c02e3898fb5769109dddbc936f14aadcedd3d5925d1a4d9b120f9" dependencies = [ "chrono", "clap", @@ -2905,9 +2906,9 @@ dependencies = [ [[package]] name = "solana-cli-config" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eec69c2685c10bd288b07c483ee02e5f01853dfc5db61a0188ffac99a74cb58" +checksum = "0f0f69ef61a624038c6c2e0109f08c827633a04a4d21272e1e02e3bd70961008" dependencies = [ "dirs-next", "lazy_static", @@ -2919,9 +2920,9 @@ dependencies = [ [[package]] name = "solana-cli-output" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d811a000fb921a917ac77b84006b25d586bf10f3b2995ebdcbbed335da05fe95" +checksum = "c93f03b53bc82731864c85db03148f0c364dd063c62efbbc4ca00fce6af0eb00" dependencies = [ "Inflector", "chrono", @@ -2942,9 +2943,9 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a387d9d4b4e665b97e5a74486faee9a7c76873a1c87ffe420cb795b66fbeec9e" +checksum = "7253ee3b369812df3c30c9076ac2d5f042e09d7cb9c04e2928ebf5df26ad4ab2" dependencies = [ "base64 0.13.0", "bincode", @@ -2973,9 +2974,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7f8350f954d78dc30a5dc02c4f495c75eb7d3b32494c5499692457164bbbaa" +checksum = "3c5c599f4049337d8c89c08811b3044203d083038e4e4be724843088211f3158" dependencies = [ "bincode", "chrono", @@ -2987,9 +2988,9 @@ dependencies = [ [[package]] name = "solana-crate-features" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faed9cc0dc45b8e787add4a0e260c95006996b3da99d0bbde4f0bfdc2e1950bc" +checksum = "dc73ada8cddc62edf58dc09ef3cf4551259d0ca1c7ece5f102757279ec2afa95" dependencies = [ "backtrace", "bytes 0.4.12", @@ -3011,9 +3012,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.4.13" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4045fd99e316de4adbb56e00fd77d33f967c2abdc2e7b55135fb6c62aeec66bf" +checksum = "9e5ab6ad3dda6a3d95d19603eeedc65689d8125eafb3e23c6a1e01ab8a6ba60c" dependencies = [ "bs58 0.3.1", "bv", @@ -3031,9 +3032,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.4.13" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd60ef025b6f0c6313eb6881a5404e7762a5ec2f5c7ed9619f7822497a75893" +checksum = "ffaa09aa938a67501479ed8a785071c6993f72c34e43f680db3ea7a2dadad9e7" dependencies = [ "lazy_static", "proc-macro2 1.0.24", @@ -3044,9 +3045,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.4.13" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e7a3dea8ebbc7f9dbf14769de133698f4c8e5b6f5ef9f64413448fabf99b3b8" +checksum = "0d949157d0b23eaf5758b427d90741d2a90751c4e3dfee028f5726ab8b36e769" dependencies = [ "env_logger", "lazy_static", @@ -3055,9 +3056,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190b2cc0c99ec85fb0ac5ea4ff296585cba68e316bc6411f181cdfaaa24fff7b" +checksum = "76c197e92932f6498371df4a52e972403b0a3dfd3eac101b2844774b43292d89" dependencies = [ "jemalloc-ctl", "jemallocator", @@ -3068,9 +3069,9 @@ dependencies = [ [[package]] name = "solana-metrics" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58d0f55a658d4799c2fb2e5d18aa240ce087602148cb74c9cb6b837cd56aa7aa" +checksum = "1ed2f570bd9d87a991c58800bd94149c34243f14c6b3dfc39fbca602e13db70a" dependencies = [ "env_logger", "gethostname", @@ -3082,9 +3083,9 @@ dependencies = [ [[package]] name = "solana-net-utils" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99f1a3fcc4bb4a90d4f1f32604b107bd23ca463bcc18a9f54e3fe9866ce9c51" +checksum = "fea0a40ca7c0f5be26d1a203ac1ef44920f7c845ffdcf922e2aa597662e13958" dependencies = [ "bincode", "bytes 0.4.12", @@ -3104,9 +3105,9 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.4.13" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cda72e46a55252daf389774c7bf20fa5fa33007ccfae0539232941d4dbd3c4" +checksum = "8e9c6cb16e8aa986bc0d2af8ec50628f7451bef9dac89924adf48302bd4fc755" dependencies = [ "bincode", "bs58 0.3.1", @@ -3134,9 +3135,9 @@ dependencies = [ [[package]] name = "solana-program-test" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b6f84d470eee6dcf70cba3257aad3cd80621609266e32c49a014c5e6605598" +checksum = "893a7bb914b4d028ff84faeab7a6be154b516009b90d107e92f4014bc07bd38d" dependencies = [ "async-trait", "base64 0.12.3", @@ -3155,9 +3156,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70700e700a22a64416cec6a478301a6910402ad4210d1d27bd0a30daf710345e" +checksum = "de7367bfa559a08c2023d62f780ae01fddf865b974d7fd449bbeb1399641764d" dependencies = [ "lazy_static", "num_cpus", @@ -3165,9 +3166,9 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "031e5008cd0f2aeb2e62bb3c7cb242a28978181a2ea8acb0d83cbf0a41274ed0" +checksum = "1fde6cc84dfcc15c34eedba0675ca51cbaa8b83ca70233c5751459af869568e1" dependencies = [ "base32", "console 0.11.3", @@ -3185,9 +3186,9 @@ dependencies = [ [[package]] name = "solana-runtime" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fe657bcb036c1cba3246d4c2d51a4753ca198e5a0260fb055a357d36e333b0" +checksum = "4d1364382b1ea6dd516c53455c817eaa5cd47bf7565cd00953586002731dd8fd" dependencies = [ "bincode", "blake3", @@ -3236,9 +3237,9 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145658ea93517dadd44cd77a5ecbdaa268500dab8c3febb7c1713c3ebaf56061" +checksum = "85c38a02d501422070cd6a4d561b4ab1408e311c5a0b5af3a7bb01246da14f66" dependencies = [ "assert_matches", "bincode", @@ -3280,9 +3281,9 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.4.13" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ccc308a3cd4793dfc02fdccedd60a5aaba2b4909ae9bce36994dafaf90278a2" +checksum = "475a680cd175f2e256452e007c6f8622d3a1ab97ab36d26303b35576e24f340c" dependencies = [ "bs58 0.3.1", "proc-macro2 1.0.24", @@ -3293,9 +3294,9 @@ dependencies = [ [[package]] name = "solana-secp256k1-program" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e424be696ffbc0c853ddcdfb51b5ab46dc8b127484f4c48303713c2939205215" +checksum = "64f76265997062d8cb18b8055ab200294087ee0bb2de3cf65864eb964f39b2c8" dependencies = [ "bincode", "digest 0.9.0", @@ -3308,9 +3309,9 @@ dependencies = [ [[package]] name = "solana-stake-program" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4515972df84b7c9db557653e9172c3c32abcc7daaadbdfdf822ecd2ccdf3e138" +checksum = "9fcb16ef12c9ed669308074bcc0549d5b36f29597fb701530f108088d438b3cd" dependencies = [ "bincode", "log", @@ -3330,9 +3331,9 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd63aa417f747418c8bb52f9a11bb28f58f442298b5efc2522d93c983f43fce9" +checksum = "a2f69cb54e6854d4799529c22c21c1d53abaf2ebfc7b2c2fe1ce84b2afb9c620" dependencies = [ "Inflector", "base64 0.12.3", @@ -3354,9 +3355,9 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fdbba54e5393b98f28f772fa6d6af30c123210c7fcb5166bdea801f1bf335a4" +checksum = "d6995a2a6734a108b4a80497a391e86c8d234d94b02ceec0cebc9ba132874502" dependencies = [ "log", "rustc_version", @@ -3370,9 +3371,9 @@ dependencies = [ [[package]] name = "solana-vote-program" -version = "1.4.9" +version = "1.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6cff1aee73efe45996605b06f0abea0d8ec5c108876fbba2370a48b9960e5d6" +checksum = "6b42b3fd7b76dd8c98eb13f92677b1803d0bc1ac06af45e10f1aee46b8c19a8a" dependencies = [ "bincode", "log", @@ -3391,9 +3392,9 @@ dependencies = [ [[package]] name = "solana_rbpf" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a95dbe2b00920ac4e1524b7442cf5319f01e8fa5742930ac60148882fd7738b" +checksum = "6b54ad0656df5f2c8acdd030ce769aaf49ee32995e569225bfb5121688863a09" dependencies = [ "byteorder", "combine", diff --git a/associated-token-account/program/Cargo.toml b/associated-token-account/program/Cargo.toml index 03215599..c31e03d7 100644 --- a/associated-token-account/program/Cargo.toml +++ b/associated-token-account/program/Cargo.toml @@ -12,12 +12,12 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.4.13" +solana-program = "1.4.14" spl-token = { version = "3.0", path = "../../token/program", features = ["no-entrypoint"] } [dev-dependencies] -solana-program-test = "1.4.9" -solana-sdk = "1.4.9" +solana-program-test = "1.4.14" +solana-sdk = "1.4.14" tokio = { version = "0.3", features = ["macros"]} [lib] diff --git a/associated-token-account/program/src/processor.rs b/associated-token-account/program/src/processor.rs index 68c54250..2bae6466 100644 --- a/associated-token-account/program/src/processor.rs +++ b/associated-token-account/program/src/processor.rs @@ -4,7 +4,7 @@ use crate::*; use solana_program::{ account_info::{next_account_info, AccountInfo}, entrypoint::ProgramResult, - info, + msg, program::{invoke, invoke_signed}, program_error::ProgramError, pubkey::Pubkey, @@ -35,7 +35,7 @@ pub fn process_instruction( program_id, ); if associated_token_address != *associated_token_account_info.key { - info!("Error: Associated address does not match seed derivation"); + msg!("Error: Associated address does not match seed derivation"); return Err(ProgramError::InvalidSeeds); } @@ -54,10 +54,10 @@ pub fn process_instruction( .saturating_sub(associated_token_account_info.lamports()); if required_lamports > 0 { - info!(&format!( + msg!( "Transfer {} lamports to the associated token account", required_lamports - )); + ); invoke( &system_instruction::transfer( &funder_info.key, @@ -72,7 +72,7 @@ pub fn process_instruction( )?; } - info!("Allocate space for the associated token account"); + msg!("Allocate space for the associated token account"); invoke_signed( &system_instruction::allocate( associated_token_account_info.key, @@ -85,7 +85,7 @@ pub fn process_instruction( &[&associated_token_account_signer_seeds], )?; - info!("Assign the associated token account to the SPL Token program"); + msg!("Assign the associated token account to the SPL Token program"); invoke_signed( &system_instruction::assign(associated_token_account_info.key, &spl_token::id()), &[ @@ -95,7 +95,7 @@ pub fn process_instruction( &[&associated_token_account_signer_seeds], )?; - info!("Initialize the associated token account"); + msg!("Initialize the associated token account"); invoke( &spl_token::instruction::initialize_account( &spl_token::id(), diff --git a/ci/solana-version.sh b/ci/solana-version.sh index ceb54609..e37d417e 100755 --- a/ci/solana-version.sh +++ b/ci/solana-version.sh @@ -14,7 +14,7 @@ if [[ -n $SOLANA_VERSION ]]; then solana_version="$SOLANA_VERSION" else - solana_version=v1.4.9 + solana_version=v1.4.14 fi export solana_version="$solana_version" diff --git a/examples/rust/cross-program-invocation/Cargo.toml b/examples/rust/cross-program-invocation/Cargo.toml index 620d3c00..269c5f66 100644 --- a/examples/rust/cross-program-invocation/Cargo.toml +++ b/examples/rust/cross-program-invocation/Cargo.toml @@ -13,11 +13,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.4.13" +solana-program = "1.4.14" [dev-dependencies] -solana-program-test = "1.4.9" -solana-sdk = "1.4.9" +solana-program-test = "1.4.14" +solana-sdk = "1.4.14" tokio = { version = "0.3", features = ["macros"]} [lib] diff --git a/examples/rust/custom-heap/Cargo.toml b/examples/rust/custom-heap/Cargo.toml index dc742008..5d8b9136 100644 --- a/examples/rust/custom-heap/Cargo.toml +++ b/examples/rust/custom-heap/Cargo.toml @@ -15,11 +15,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.4.13" +solana-program = "1.4.14" [dev-dependencies] -solana-program-test = "1.4.9" -solana-sdk = "1.4.9" +solana-program-test = "1.4.14" +solana-sdk = "1.4.14" tokio = { version = "0.3", features = ["macros"]} [lib] diff --git a/examples/rust/logging/Cargo.toml b/examples/rust/logging/Cargo.toml index 60bef9f4..8ea059ec 100644 --- a/examples/rust/logging/Cargo.toml +++ b/examples/rust/logging/Cargo.toml @@ -13,11 +13,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.4.13" +solana-program = "1.4.14" [dev-dependencies] -solana-program-test = "1.4.9" -solana-sdk = "1.4.9" +solana-program-test = "1.4.14" +solana-sdk = "1.4.14" tokio = { version = "0.3", features = ["macros"]} [lib] diff --git a/examples/rust/logging/src/processor.rs b/examples/rust/logging/src/processor.rs index 7a329ebc..a4be8713 100644 --- a/examples/rust/logging/src/processor.rs +++ b/examples/rust/logging/src/processor.rs @@ -3,8 +3,8 @@ use solana_program::{ account_info::AccountInfo, entrypoint::ProgramResult, - info, log::{sol_log_compute_units, sol_log_params, sol_log_slice}, + msg, pubkey::Pubkey, }; @@ -15,19 +15,22 @@ pub fn process_instruction( instruction_data: &[u8], ) -> ProgramResult { // Log a string - info!("static string"); + msg!("static string"); // Log 5 numbers as u64s in hexadecimal format - info!( + msg!( instruction_data[0], - instruction_data[1], instruction_data[2], instruction_data[3], instruction_data[4] + instruction_data[1], + instruction_data[2], + instruction_data[3], + instruction_data[4] ); // Log a slice sol_log_slice(instruction_data); // Log a formatted message, use with caution can be expensive - info!(&format!("formatted {}: {:?}", "message", instruction_data)); + msg!("formatted {}: {:?}", "message", instruction_data); // Log a public key program_id.log(); diff --git a/examples/rust/sysvar/Cargo.toml b/examples/rust/sysvar/Cargo.toml index 0a14539e..75f0aba4 100644 --- a/examples/rust/sysvar/Cargo.toml +++ b/examples/rust/sysvar/Cargo.toml @@ -13,11 +13,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.4.13" +solana-program = "1.4.14" [dev-dependencies] -solana-program-test = "1.4.9" -solana-sdk = "1.4.9" +solana-program-test = "1.4.14" +solana-sdk = "1.4.14" tokio = { version = "0.3", features = ["macros"]} [lib] diff --git a/examples/rust/sysvar/src/processor.rs b/examples/rust/sysvar/src/processor.rs index bb268831..7e358255 100644 --- a/examples/rust/sysvar/src/processor.rs +++ b/examples/rust/sysvar/src/processor.rs @@ -3,7 +3,7 @@ use solana_program::{ account_info::{next_account_info, AccountInfo}, entrypoint::ProgramResult, - info, + msg, pubkey::Pubkey, sysvar::{clock::Clock, Sysvar}, }; @@ -25,7 +25,7 @@ pub fn process_instruction( let clock = Clock::from_account_info(&clock_sysvar_info)?; // Note: `format!` can be very expensive, use cautiously - info!(&format!("{:?}", clock)); + msg!("{:?}", clock); Ok(()) } diff --git a/examples/rust/transfer-lamports/Cargo.toml b/examples/rust/transfer-lamports/Cargo.toml index a4c65753..def5b8e8 100644 --- a/examples/rust/transfer-lamports/Cargo.toml +++ b/examples/rust/transfer-lamports/Cargo.toml @@ -12,11 +12,11 @@ no-entrypoint = [] test-bpf = [] [dependencies] -solana-program = "1.4.13" +solana-program = "1.4.14" [dev-dependencies] -solana-program-test = "1.4.9" -solana-sdk = "1.4.9" +solana-program-test = "1.4.14" +solana-sdk = "1.4.14" tokio = { version = "0.3", features = ["macros"]} [lib] diff --git a/feature-proposal/cli/Cargo.toml b/feature-proposal/cli/Cargo.toml index f7354bb6..93dcca70 100644 --- a/feature-proposal/cli/Cargo.toml +++ b/feature-proposal/cli/Cargo.toml @@ -10,11 +10,11 @@ edition = "2018" [dependencies] chrono = "0.4.19" clap = "2.33.3" -solana-clap-utils = "1.4.8" -solana-cli-config = "1.4.8" -solana-client = "1.4.8" -solana-logger = "1.4.8" -solana-sdk = "1.4.8" +solana-clap-utils = "1.4.14" +solana-cli-config = "1.4.14" +solana-client = "1.4.14" +solana-logger = "1.4.14" +solana-sdk = "1.4.14" spl-feature-proposal = { version = "1.0", path = "../program", features = ["no-entrypoint"] } [[bin]] diff --git a/feature-proposal/program/Cargo.toml b/feature-proposal/program/Cargo.toml index 40dc5037..f239142d 100644 --- a/feature-proposal/program/Cargo.toml +++ b/feature-proposal/program/Cargo.toml @@ -14,14 +14,14 @@ test-bpf = [] [dependencies] borsh = "0.7.1" borsh-derive = "0.7.1" -solana-program = "1.4.13" +solana-program = "1.4.14" spl-token = { version = "3.0", path = "../../token/program", features = ["no-entrypoint"] } [dev-dependencies] futures = "0.3" -solana-program-test = "1.4.9" -solana-sdk = "1.4.9" +solana-program-test = "1.4.14" +solana-sdk = "1.4.14" tokio = { version = "0.3", features = ["macros"]} [lib] diff --git a/feature-proposal/program/src/instruction.rs b/feature-proposal/program/src/instruction.rs index 7896ebaa..82302488 100644 --- a/feature-proposal/program/src/instruction.rs +++ b/feature-proposal/program/src/instruction.rs @@ -3,8 +3,8 @@ use crate::{state::AcceptanceCriteria, *}; use borsh::{BorshDeserialize, BorshSchema, BorshSerialize}; use solana_program::{ - info, instruction::{AccountMeta, Instruction}, + msg, program_error::ProgramError, program_pack::{Pack, Sealed}, pubkey::Pubkey, @@ -86,10 +86,10 @@ impl Pack for FeatureProposalInstruction { fn unpack_from_slice(src: &[u8]) -> Result { let mut mut_src: &[u8] = src; Self::deserialize(&mut mut_src).map_err(|err| { - info!(&format!( + msg!( "Error: failed to deserialize feature proposal instruction: {}", err - )); + ); ProgramError::InvalidInstructionData }) } diff --git a/feature-proposal/program/src/processor.rs b/feature-proposal/program/src/processor.rs index 88c59064..14d00bbf 100644 --- a/feature-proposal/program/src/processor.rs +++ b/feature-proposal/program/src/processor.rs @@ -6,7 +6,7 @@ use solana_program::{ clock::Clock, entrypoint::ProgramResult, feature::{self, Feature}, - info, + msg, program::{invoke, invoke_signed}, program_error::ProgramError, pubkey::Pubkey, @@ -29,7 +29,7 @@ pub fn process_instruction( tokens_to_mint, acceptance_criteria, } => { - info!("FeatureProposalInstruction::Propose"); + msg!("FeatureProposalInstruction::Propose"); let funder_info = next_account_info(account_info_iter)?; let feature_proposal_info = next_account_info(account_info_iter)?; @@ -45,28 +45,28 @@ pub fn process_instruction( let (mint_address, mint_bump_seed) = get_mint_address_with_seed(feature_proposal_info.key); if mint_address != *mint_info.key { - info!("Error: mint address derivation mismatch"); + msg!("Error: mint address derivation mismatch"); return Err(ProgramError::InvalidArgument); } let (distributor_token_address, distributor_token_bump_seed) = get_distributor_token_address_with_seed(feature_proposal_info.key); if distributor_token_address != *distributor_token_info.key { - info!("Error: distributor token address derivation mismatch"); + msg!("Error: distributor token address derivation mismatch"); return Err(ProgramError::InvalidArgument); } let (acceptance_token_address, acceptance_token_bump_seed) = get_acceptance_token_address_with_seed(feature_proposal_info.key); if acceptance_token_address != *acceptance_token_info.key { - info!("Error: acceptance token address derivation mismatch"); + msg!("Error: acceptance token address derivation mismatch"); return Err(ProgramError::InvalidArgument); } let (feature_id_address, feature_id_bump_seed) = get_feature_id_address_with_seed(feature_proposal_info.key); if feature_id_address != *feature_id_info.key { - info!("Error: feature-id address derivation mismatch"); + msg!("Error: feature-id address derivation mismatch"); return Err(ProgramError::InvalidArgument); } @@ -94,7 +94,7 @@ pub fn process_instruction( &[feature_id_bump_seed], ]; - info!("Creating feature proposal account"); + msg!("Creating feature proposal account"); invoke( &system_instruction::create_account( funder_info.key, @@ -112,7 +112,7 @@ pub fn process_instruction( FeatureProposal::Pending(acceptance_criteria) .pack_into_slice(&mut feature_proposal_info.data.borrow_mut()); - info!("Creating mint"); + msg!("Creating mint"); invoke_signed( &system_instruction::create_account( funder_info.key, @@ -129,7 +129,7 @@ pub fn process_instruction( &[&mint_signer_seeds], )?; - info!("Initializing mint"); + msg!("Initializing mint"); invoke( &spl_token::instruction::initialize_mint( &spl_token::id(), @@ -145,7 +145,7 @@ pub fn process_instruction( ], )?; - info!("Creating distributor token account"); + msg!("Creating distributor token account"); invoke_signed( &system_instruction::create_account( funder_info.key, @@ -162,7 +162,7 @@ pub fn process_instruction( &[&distributor_token_signer_seeds], )?; - info!("Initializing distributor token account"); + msg!("Initializing distributor token account"); invoke( &spl_token::instruction::initialize_account( &spl_token::id(), @@ -179,7 +179,7 @@ pub fn process_instruction( ], )?; - info!("Creating acceptance token account"); + msg!("Creating acceptance token account"); invoke_signed( &system_instruction::create_account( funder_info.key, @@ -196,7 +196,7 @@ pub fn process_instruction( &[&acceptance_token_signer_seeds], )?; - info!("Initializing acceptance token account"); + msg!("Initializing acceptance token account"); invoke( &spl_token::instruction::initialize_account( &spl_token::id(), @@ -245,7 +245,7 @@ pub fn process_instruction( // Mint `tokens_to_mint` tokens into `distributor_token_account` owned by // `feature_proposal` - info!(&format!("Minting {} tokens", tokens_to_mint)); + msg!("Minting {} tokens", tokens_to_mint); invoke_signed( &spl_token::instruction::mint_to( &spl_token::id(), @@ -265,7 +265,7 @@ pub fn process_instruction( // Fully fund the feature id account so the `Tally` instruction will not require any // lamports from the caller - info!("Funding feature id account"); + msg!("Funding feature id account"); invoke( &system_instruction::transfer( funder_info.key, @@ -279,7 +279,7 @@ pub fn process_instruction( ], )?; - info!("Allocating feature id account"); + msg!("Allocating feature id account"); invoke_signed( &system_instruction::allocate(feature_id_info.key, Feature::size_of() as u64), &[feature_id_info.clone(), system_program_info.clone()], @@ -288,7 +288,7 @@ pub fn process_instruction( } FeatureProposalInstruction::Tally => { - info!("FeatureProposalInstruction::Tally"); + msg!("FeatureProposalInstruction::Tally"); let feature_proposal_info = next_account_info(account_info_iter)?; let feature_proposal_state = @@ -307,14 +307,14 @@ pub fn process_instruction( let acceptance_token_address = get_acceptance_token_address(feature_proposal_info.key); if acceptance_token_address != *acceptance_token_info.key { - info!("Error: acceptance token address derivation mismatch"); + msg!("Error: acceptance token address derivation mismatch"); return Err(ProgramError::InvalidArgument); } let (feature_id_address, feature_id_bump_seed) = get_feature_id_address_with_seed(feature_proposal_info.key); if feature_id_address != *feature_id_info.key { - info!("Error: feature-id address derivation mismatch"); + msg!("Error: feature-id address derivation mismatch"); return Err(ProgramError::InvalidArgument); } @@ -325,40 +325,40 @@ pub fn process_instruction( ]; if clock.unix_timestamp >= acceptance_criteria.deadline { - info!("Feature proposal expired"); + msg!("Feature proposal expired"); FeatureProposal::Expired .pack_into_slice(&mut feature_proposal_info.data.borrow_mut()); return Ok(()); } - info!("Unpacking acceptance token account"); + msg!("Unpacking acceptance token account"); let acceptance_token = spl_token::state::Account::unpack(&acceptance_token_info.data.borrow())?; - info!(&format!( + msg!( "Feature proposal has received {} tokens, and {} tokens required for acceptance", acceptance_token.amount, acceptance_criteria.tokens_required - )); + ); if acceptance_token.amount < acceptance_criteria.tokens_required { - info!("Activation threshold has not been reached"); + msg!("Activation threshold has not been reached"); return Ok(()); } - info!("Assigning feature id account"); + msg!("Assigning feature id account"); invoke_signed( &system_instruction::assign(feature_id_info.key, &feature::id()), &[feature_id_info.clone(), system_program_info.clone()], &[&feature_id_signer_seeds], )?; - info!("Feature proposal accepted"); + msg!("Feature proposal accepted"); FeatureProposal::Accepted { tokens_upon_acceptance: acceptance_token.amount, } .pack_into_slice(&mut feature_proposal_info.data.borrow_mut()); } _ => { - info!("Error: feature proposal account not in the pending state"); + msg!("Error: feature proposal account not in the pending state"); return Err(ProgramError::InvalidAccountData); } } diff --git a/feature-proposal/program/src/state.rs b/feature-proposal/program/src/state.rs index d58dfd9f..ab6e9150 100644 --- a/feature-proposal/program/src/state.rs +++ b/feature-proposal/program/src/state.rs @@ -2,7 +2,7 @@ use borsh::{BorshDeserialize, BorshSchema, BorshSerialize}; use solana_program::{ clock::UnixTimestamp, - info, + msg, program_error::ProgramError, program_pack::{Pack, Sealed}, }; @@ -47,10 +47,10 @@ impl Pack for FeatureProposal { fn unpack_from_slice(src: &[u8]) -> Result { let mut mut_src: &[u8] = src; Self::deserialize(&mut mut_src).map_err(|err| { - info!(&format!( + msg!( "Error: failed to deserialize feature proposal account: {}", err - )); + ); ProgramError::InvalidAccountData }) } diff --git a/memo/program/Cargo.toml b/memo/program/Cargo.toml index 184638d7..43e0f43a 100644 --- a/memo/program/Cargo.toml +++ b/memo/program/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" no-entrypoint = [] [dependencies] -solana-program = "1.4.13" +solana-program = "1.4.14" [lib] crate-type = ["cdylib", "lib"] diff --git a/shared-memory/program/Cargo.toml b/shared-memory/program/Cargo.toml index 437719cc..0f7abfb2 100644 --- a/shared-memory/program/Cargo.toml +++ b/shared-memory/program/Cargo.toml @@ -9,11 +9,11 @@ edition = "2018" [dependencies] arrayref = "0.3.6" -solana-program = "1.4.13" +solana-program = "1.4.14" [dev-dependencies] -solana-bpf-loader-program = "1.4.9" -solana-sdk = "1.4.9" +solana-bpf-loader-program = "1.4.14" +solana-sdk = "1.4.14" solana_rbpf = "0.1" [lib] diff --git a/stake-pool/cli/Cargo.toml b/stake-pool/cli/Cargo.toml index a19c607b..0faea543 100644 --- a/stake-pool/cli/Cargo.toml +++ b/stake-pool/cli/Cargo.toml @@ -11,13 +11,13 @@ version = "2.0.1" [dependencies] clap = "2.33.3" serde_json = "1.0.57" -solana-account-decoder = "1.4.9" -solana-clap-utils = "1.4.9" -solana-cli-config = "1.4.9" -solana-client = "1.4.9" -solana-logger = "1.4.9" -solana-sdk = "1.4.9" -solana-program = "1.4.13" +solana-account-decoder = "1.4.14" +solana-clap-utils = "1.4.14" +solana-cli-config = "1.4.14" +solana-client = "1.4.14" +solana-logger = "1.4.14" +solana-sdk = "1.4.14" +solana-program = "1.4.14" spl-stake-pool = { path="../program", features = [ "no-entrypoint" ] } spl-token = { path="../../token/program", features = [ "no-entrypoint" ] } bs58 = "0.4.0" diff --git a/stake-pool/program/Cargo.toml b/stake-pool/program/Cargo.toml index 189d0f80..09a2d24d 100644 --- a/stake-pool/program/Cargo.toml +++ b/stake-pool/program/Cargo.toml @@ -17,14 +17,14 @@ num-traits = "0.2" num_enum = "0.5.1" serde = "1.0.117" serde_derive = "1.0.103" -solana-program = "1.4.13" +solana-program = "1.4.14" spl-token = { path = "../../token/program", features = [ "no-entrypoint" ] } thiserror = "1.0" [dev-dependencies] bincode = "1.3.1" -solana-program-test = "1.4.9" -solana-sdk = "1.4.9" +solana-program-test = "1.4.14" +solana-sdk = "1.4.14" tokio = { version = "0.3", features = ["macros"]} [lib] diff --git a/stake-pool/program/src/processor.rs b/stake-pool/program/src/processor.rs index e301bb24..966029cc 100644 --- a/stake-pool/program/src/processor.rs +++ b/stake-pool/program/src/processor.rs @@ -9,7 +9,7 @@ use crate::{ use num_traits::FromPrimitive; use solana_program::{ account_info::next_account_info, account_info::AccountInfo, decode_error::DecodeError, - entrypoint::ProgramResult, info, program::invoke_signed, program_error::PrintProgramError, + entrypoint::ProgramResult, msg, program::invoke_signed, program_error::PrintProgramError, program_error::ProgramError, program_pack::Pack, pubkey::Pubkey, }; use std::convert::TryFrom; @@ -582,27 +582,27 @@ impl Processor { let instruction = StakePoolInstruction::deserialize(input)?; match instruction { StakePoolInstruction::Initialize(init) => { - info!("Instruction: Init"); + msg!("Instruction: Init"); Self::process_initialize(program_id, init, accounts) } StakePoolInstruction::Deposit => { - info!("Instruction: Deposit"); + msg!("Instruction: Deposit"); Self::process_deposit(program_id, accounts) } StakePoolInstruction::Withdraw(amount) => { - info!("Instruction: Withdraw"); + msg!("Instruction: Withdraw"); Self::process_withdraw(program_id, amount, accounts) } StakePoolInstruction::Claim => { - info!("Instruction: Claim"); + msg!("Instruction: Claim"); Self::process_claim(program_id, accounts) } StakePoolInstruction::SetStakingAuthority => { - info!("Instruction: SetStakingAuthority"); + msg!("Instruction: SetStakingAuthority"); Self::process_set_staking_auth(program_id, accounts) } StakePoolInstruction::SetOwner => { - info!("Instruction: SetOwner"); + msg!("Instruction: SetOwner"); Self::process_set_owner(program_id, accounts) } } @@ -615,19 +615,19 @@ impl PrintProgramError for Error { E: 'static + std::error::Error + DecodeError + PrintProgramError + FromPrimitive, { match self { - Error::AlreadyInUse => info!("Error: AlreadyInUse"), - Error::InvalidProgramAddress => info!("Error: InvalidProgramAddress"), - Error::InvalidOwner => info!("Error: InvalidOwner"), - Error::ExpectedToken => info!("Error: ExpectedToken"), - Error::ExpectedAccount => info!("Error: ExpectedAccount"), - Error::InvalidSupply => info!("Error: InvalidSupply"), - Error::InvalidDelegate => info!("Error: InvalidDelegate"), - Error::InvalidState => info!("Error: InvalidState"), - Error::InvalidInput => info!("Error: InvalidInput"), - Error::InvalidOutput => info!("Error: InvalidOutput"), - Error::CalculationFailure => info!("Error: CalculationFailure"), - Error::FeeTooHigh => info!("Error: FeeTooHigh"), - Error::WrongAccountMint => info!("Error: WrongAccountMint"), + Error::AlreadyInUse => msg!("Error: AlreadyInUse"), + Error::InvalidProgramAddress => msg!("Error: InvalidProgramAddress"), + Error::InvalidOwner => msg!("Error: InvalidOwner"), + Error::ExpectedToken => msg!("Error: ExpectedToken"), + Error::ExpectedAccount => msg!("Error: ExpectedAccount"), + Error::InvalidSupply => msg!("Error: InvalidSupply"), + Error::InvalidDelegate => msg!("Error: InvalidDelegate"), + Error::InvalidState => msg!("Error: InvalidState"), + Error::InvalidInput => msg!("Error: InvalidInput"), + Error::InvalidOutput => msg!("Error: InvalidOutput"), + Error::CalculationFailure => msg!("Error: CalculationFailure"), + Error::FeeTooHigh => msg!("Error: FeeTooHigh"), + Error::WrongAccountMint => msg!("Error: WrongAccountMint"), } } } @@ -671,7 +671,7 @@ mod tests { account_infos: &[AccountInfo], signers_seeds: &[&[&[u8]]], ) -> ProgramResult { - info!("TestSyscallStubs::sol_invoke_signed()"); + msg!("TestSyscallStubs::sol_invoke_signed()"); let mut new_account_infos = vec![]; for meta in instruction.accounts.iter() { diff --git a/themis/client_ristretto/Cargo.toml b/themis/client_ristretto/Cargo.toml index 76e9ab6e..84ffdaf3 100644 --- a/themis/client_ristretto/Cargo.toml +++ b/themis/client_ristretto/Cargo.toml @@ -15,9 +15,9 @@ borsh = "0.7.1" curve25519-dalek = {git = "https://github.com/garious/curve25519-dalek", rev = "60efef3553d6bf3d7f3b09b5f97acd54d72529ff", default-features = false, features = ["borsh"]} elgamal_ristretto = { git = "https://github.com/garious/elgamal", rev = "db1eef8e01b8a6e93d3bdc64ab2c1acb39cb64d6", default-features = false } futures = "0.3" -solana-banks-client = "1.4.9" -solana-cli-config = "1.4.9" -solana-sdk = "1.4.9" +solana-banks-client = "1.4.14" +solana-cli-config = "1.4.14" +solana-sdk = "1.4.14" spl-themis-ristretto = { version = "0.1.0", path = "../program_ristretto", features = ["no-entrypoint"] } tarpc = { version = "0.22.0", features = ["full"] } tokio = "0.3" @@ -25,11 +25,11 @@ url = "2.1" [dev-dependencies] separator = "0.4.1" -solana-banks-server = "1.4.9" -solana-bpf-loader-program = "1.4.9" -solana-core = "1.4.9" +solana-banks-server = "1.4.14" +solana-bpf-loader-program = "1.4.14" +solana-core = "1.4.14" solana_rbpf = "0.1" -solana-runtime = "1.4.9" +solana-runtime = "1.4.14" [lib] crate-type = ["cdylib", "lib"] diff --git a/themis/program_ristretto/Cargo.toml b/themis/program_ristretto/Cargo.toml index 948c8d21..b777d4fd 100644 --- a/themis/program_ristretto/Cargo.toml +++ b/themis/program_ristretto/Cargo.toml @@ -20,7 +20,7 @@ getrandom = { version = "0.1.15", features = ["dummy"] } num-derive = "0.3" num-traits = "0.2" rand = "0.7.0" -solana-program = "1.4.13" +solana-program = "1.4.14" thiserror = "1.0" [lib] diff --git a/token-lending/program/Cargo.toml b/token-lending/program/Cargo.toml index 9566b3b4..54847fb6 100644 --- a/token-lending/program/Cargo.toml +++ b/token-lending/program/Cargo.toml @@ -15,7 +15,7 @@ arrayref = "0.3.6" num_enum = "0.5.1" num-derive = "0.3" num-traits = "0.2" -solana-program = "1.4.13" +solana-program = "1.4.14" thiserror = "1.0" [lib] diff --git a/token-lending/program/src/processor.rs b/token-lending/program/src/processor.rs index 61462a59..e1cdd5a4 100644 --- a/token-lending/program/src/processor.rs +++ b/token-lending/program/src/processor.rs @@ -3,7 +3,7 @@ use crate::error::LendingError; use num_traits::FromPrimitive; use solana_program::{ - account_info::AccountInfo, decode_error::DecodeError, entrypoint::ProgramResult, info, + account_info::AccountInfo, decode_error::DecodeError, entrypoint::ProgramResult, msg, program_error::PrintProgramError, pubkey::Pubkey, }; @@ -27,7 +27,7 @@ impl PrintProgramError for LendingError { E: 'static + std::error::Error + DecodeError + PrintProgramError + FromPrimitive, { match self { - LendingError::AlreadyInUse => info!("Error: Lending account already in use"), + LendingError::AlreadyInUse => msg!("Error: Lending account already in use"), } } } diff --git a/token-swap/program/Cargo.toml b/token-swap/program/Cargo.toml index ef371c1e..e1fc7002 100644 --- a/token-swap/program/Cargo.toml +++ b/token-swap/program/Cargo.toml @@ -16,14 +16,14 @@ fuzz = ["arbitrary"] arrayref = "0.3.6" num-derive = "0.3" num-traits = "0.2" -solana-program = "1.4.13" +solana-program = "1.4.14" spl-token = { version = "3.0", path = "../../token/program", features = [ "no-entrypoint" ] } thiserror = "1.0" uint = "0.8" arbitrary = { version = "0.4", features = ["derive"], optional = true } [dev-dependencies] -solana-sdk = "1.4.9" +solana-sdk = "1.4.14" sim = { path = "./sim" } [lib] diff --git a/token-swap/program/fuzz/Cargo.toml b/token-swap/program/fuzz/Cargo.toml index 9f4cf449..7970988d 100644 --- a/token-swap/program/fuzz/Cargo.toml +++ b/token-swap/program/fuzz/Cargo.toml @@ -11,7 +11,7 @@ publish = false [dependencies] honggfuzz = { version = "0.5" } arbitrary = { version = "0.4", features = ["derive"] } -solana-program = "1.4.13" +solana-program = "1.4.14" spl-token = { version = "3.0", path = "../../../token/program", features = [ "no-entrypoint" ] } spl-token-swap = { path = "..", features = ["fuzz", "no-entrypoint"] } diff --git a/token-swap/program/src/processor.rs b/token-swap/program/src/processor.rs index 0a91fbd4..193bcc64 100644 --- a/token-swap/program/src/processor.rs +++ b/token-swap/program/src/processor.rs @@ -12,7 +12,7 @@ use solana_program::{ account_info::{next_account_info, AccountInfo}, decode_error::DecodeError, entrypoint::ProgramResult, - info, + msg, program::invoke_signed, program_error::{PrintProgramError, ProgramError}, program_option::COption, @@ -625,14 +625,14 @@ impl Processor { let instruction = SwapInstruction::unpack(input)?; match instruction { SwapInstruction::Initialize(Initialize { nonce, swap_curve }) => { - info!("Instruction: Init"); + msg!("Instruction: Init"); Self::process_initialize(program_id, nonce, swap_curve, accounts, fee_constraints) } SwapInstruction::Swap(Swap { amount_in, minimum_amount_out, }) => { - info!("Instruction: Swap"); + msg!("Instruction: Swap"); Self::process_swap(program_id, amount_in, minimum_amount_out, accounts) } SwapInstruction::Deposit(Deposit { @@ -640,7 +640,7 @@ impl Processor { maximum_token_a_amount, maximum_token_b_amount, }) => { - info!("Instruction: Deposit"); + msg!("Instruction: Deposit"); Self::process_deposit( program_id, pool_token_amount, @@ -654,7 +654,7 @@ impl Processor { minimum_token_a_amount, minimum_token_b_amount, }) => { - info!("Instruction: Withdraw"); + msg!("Instruction: Withdraw"); Self::process_withdraw( program_id, pool_token_amount, @@ -673,53 +673,51 @@ impl PrintProgramError for SwapError { E: 'static + std::error::Error + DecodeError + PrintProgramError + FromPrimitive, { match self { - SwapError::AlreadyInUse => info!("Error: Swap account already in use"), + SwapError::AlreadyInUse => msg!("Error: Swap account already in use"), SwapError::InvalidProgramAddress => { - info!("Error: Invalid program address generated from nonce and key") + msg!("Error: Invalid program address generated from nonce and key") } SwapError::InvalidOwner => { - info!("Error: The input account owner is not the program address") + msg!("Error: The input account owner is not the program address") } SwapError::InvalidOutputOwner => { - info!("Error: Output pool account owner cannot be the program address") - } - SwapError::ExpectedMint => { - info!("Error: Deserialized account is not an SPL Token mint") + msg!("Error: Output pool account owner cannot be the program address") } + SwapError::ExpectedMint => msg!("Error: Deserialized account is not an SPL Token mint"), SwapError::ExpectedAccount => { - info!("Error: Deserialized account is not an SPL Token account") + msg!("Error: Deserialized account is not an SPL Token account") } - SwapError::EmptySupply => info!("Error: Input token account empty"), - SwapError::InvalidSupply => info!("Error: Pool token mint has a non-zero supply"), - SwapError::RepeatedMint => info!("Error: Swap input token accounts have the same mint"), - SwapError::InvalidDelegate => info!("Error: Token account has a delegate"), - SwapError::InvalidInput => info!("Error: InvalidInput"), + SwapError::EmptySupply => msg!("Error: Input token account empty"), + SwapError::InvalidSupply => msg!("Error: Pool token mint has a non-zero supply"), + SwapError::RepeatedMint => msg!("Error: Swap input token accounts have the same mint"), + SwapError::InvalidDelegate => msg!("Error: Token account has a delegate"), + SwapError::InvalidInput => msg!("Error: InvalidInput"), SwapError::IncorrectSwapAccount => { - info!("Error: Address of the provided swap token account is incorrect") + msg!("Error: Address of the provided swap token account is incorrect") } SwapError::IncorrectPoolMint => { - info!("Error: Address of the provided pool token mint is incorrect") + msg!("Error: Address of the provided pool token mint is incorrect") } - SwapError::InvalidOutput => info!("Error: InvalidOutput"), - SwapError::CalculationFailure => info!("Error: CalculationFailure"), - SwapError::InvalidInstruction => info!("Error: InvalidInstruction"), + SwapError::InvalidOutput => msg!("Error: InvalidOutput"), + SwapError::CalculationFailure => msg!("Error: CalculationFailure"), + SwapError::InvalidInstruction => msg!("Error: InvalidInstruction"), SwapError::ExceededSlippage => { - info!("Error: Swap instruction exceeds desired slippage limit") + msg!("Error: Swap instruction exceeds desired slippage limit") } - SwapError::InvalidCloseAuthority => info!("Error: Token account has a close authority"), + SwapError::InvalidCloseAuthority => msg!("Error: Token account has a close authority"), SwapError::InvalidFreezeAuthority => { - info!("Error: Pool token mint has a freeze authority") + msg!("Error: Pool token mint has a freeze authority") } - SwapError::IncorrectFeeAccount => info!("Error: Pool fee token account incorrect"), + SwapError::IncorrectFeeAccount => msg!("Error: Pool fee token account incorrect"), SwapError::ZeroTradingTokens => { - info!("Error: Given pool token amount results in zero trading tokens") + msg!("Error: Given pool token amount results in zero trading tokens") } - SwapError::FeeCalculationFailure => info!( + SwapError::FeeCalculationFailure => msg!( "Error: The fee calculation failed due to overflow, underflow, or unexpected 0" ), - SwapError::ConversionFailure => info!("Error: Conversion to or from u64 failed."), + SwapError::ConversionFailure => msg!("Error: Conversion to or from u64 failed."), SwapError::InvalidFee => { - info!("Error: The provided fee does not match the program owner's constraints") + msg!("Error: The provided fee does not match the program owner's constraints") } } } @@ -765,7 +763,7 @@ mod tests { account_infos: &[AccountInfo], signers_seeds: &[&[&[u8]]], ) -> ProgramResult { - info!("TestSyscallStubs::sol_invoke_signed()"); + msg!("TestSyscallStubs::sol_invoke_signed()"); let mut new_account_infos = vec![]; diff --git a/token/cli/Cargo.toml b/token/cli/Cargo.toml index 6c03b3ee..bad82618 100644 --- a/token/cli/Cargo.toml +++ b/token/cli/Cargo.toml @@ -12,14 +12,14 @@ version = "2.0.5" clap = "2.33.3" console = "0.13.0" serde_json = "1.0.59" -solana-account-decoder = "1.4.9" -solana-clap-utils = "1.4.9" -solana-cli-config = "1.4.9" -solana-cli-output = "1.4.9" -solana-client = "1.4.9" -solana-logger = "1.4.9" -solana-remote-wallet = "1.4.9" -solana-sdk = "1.4.9" +solana-account-decoder = "1.4.14" +solana-clap-utils = "1.4.14" +solana-cli-config = "1.4.14" +solana-cli-output = "1.4.14" +solana-client = "1.4.14" +solana-logger = "1.4.14" +solana-remote-wallet = "1.4.14" +solana-sdk = "1.4.14" spl-token = { version = "3.0", path="../program", features = [ "no-entrypoint" ] } spl-associated-token-account = { version = "1.0", path="../../associated-token-account/program", features = [ "no-entrypoint" ] } diff --git a/token/perf-monitor/Cargo.toml b/token/perf-monitor/Cargo.toml index 04f76324..83b00d84 100644 --- a/token/perf-monitor/Cargo.toml +++ b/token/perf-monitor/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" [dev-dependencies] rand = { version = "0.7.0"} spl-token = { path = "../program", features = [ "no-entrypoint" ] } -solana-runtime = "1.4.9" -solana-sdk = "1.4.9" -solana-bpf-loader-program = "1.4.9" +solana-runtime = "1.4.14" +solana-sdk = "1.4.14" +solana-bpf-loader-program = "1.4.14" solana_rbpf = "0.1" diff --git a/token/program-v3/Cargo.toml b/token/program-v3/Cargo.toml index 67313389..98b1ead3 100644 --- a/token/program-v3/Cargo.toml +++ b/token/program-v3/Cargo.toml @@ -16,11 +16,11 @@ arrayref = "0.3.6" num-derive = "0.3" num-traits = "0.2" num_enum = "0.5.1" -solana-program = "1.4.13" +solana-program = "1.4.14" thiserror = "1.0" [dev-dependencies] -solana-sdk = "1.4.9" +solana-sdk = "1.4.14" [lib] crate-type = ["cdylib", "lib"] diff --git a/token/program-v3/src/processor.rs b/token/program-v3/src/processor.rs index 4bf6d161..5d2b1ec5 100644 --- a/token/program-v3/src/processor.rs +++ b/token/program-v3/src/processor.rs @@ -10,7 +10,7 @@ use solana_program::{ account_info::{next_account_info, AccountInfo}, decode_error::DecodeError, entrypoint::ProgramResult, - info, + msg, program_error::{PrintProgramError, ProgramError}, program_option::COption, program_pack::{IsInitialized, Pack}, @@ -628,70 +628,70 @@ impl Processor { mint_authority, freeze_authority, } => { - info!("Instruction: InitializeMint"); + msg!("Instruction: InitializeMint"); Self::process_initialize_mint(accounts, decimals, mint_authority, freeze_authority) } TokenInstruction::InitializeAccount => { - info!("Instruction: InitializeAccount"); + msg!("Instruction: InitializeAccount"); Self::process_initialize_account(accounts) } TokenInstruction::InitializeMultisig { m } => { - info!("Instruction: InitializeMultisig"); + msg!("Instruction: InitializeMultisig"); Self::process_initialize_multisig(accounts, m) } TokenInstruction::Transfer { amount } => { - info!("Instruction: Transfer"); + msg!("Instruction: Transfer"); Self::process_transfer(program_id, accounts, amount, None) } TokenInstruction::Approve { amount } => { - info!("Instruction: Approve"); + msg!("Instruction: Approve"); Self::process_approve(program_id, accounts, amount, None) } TokenInstruction::Revoke => { - info!("Instruction: Revoke"); + msg!("Instruction: Revoke"); Self::process_revoke(program_id, accounts) } TokenInstruction::SetAuthority { authority_type, new_authority, } => { - info!("Instruction: SetAuthority"); + msg!("Instruction: SetAuthority"); Self::process_set_authority(program_id, accounts, authority_type, new_authority) } TokenInstruction::MintTo { amount } => { - info!("Instruction: MintTo"); + msg!("Instruction: MintTo"); Self::process_mint_to(program_id, accounts, amount, None) } TokenInstruction::Burn { amount } => { - info!("Instruction: Burn"); + msg!("Instruction: Burn"); Self::process_burn(program_id, accounts, amount, None) } TokenInstruction::CloseAccount => { - info!("Instruction: CloseAccount"); + msg!("Instruction: CloseAccount"); Self::process_close_account(program_id, accounts) } TokenInstruction::FreezeAccount => { - info!("Instruction: FreezeAccount"); + msg!("Instruction: FreezeAccount"); Self::process_toggle_freeze_account(program_id, accounts, true) } TokenInstruction::ThawAccount => { - info!("Instruction: FreezeAccount"); + msg!("Instruction: FreezeAccount"); Self::process_toggle_freeze_account(program_id, accounts, false) } TokenInstruction::Transfer2 { amount, decimals } => { - info!("Instruction: Transfer"); + msg!("Instruction: Transfer"); Self::process_transfer(program_id, accounts, amount, Some(decimals)) } TokenInstruction::Approve2 { amount, decimals } => { - info!("Instruction: Approve"); + msg!("Instruction: Approve"); Self::process_approve(program_id, accounts, amount, Some(decimals)) } TokenInstruction::MintTo2 { amount, decimals } => { - info!("Instruction: MintTo"); + msg!("Instruction: MintTo"); Self::process_mint_to(program_id, accounts, amount, Some(decimals)) } TokenInstruction::Burn2 { amount, decimals } => { - info!("Instruction: Burn"); + msg!("Instruction: Burn"); Self::process_burn(program_id, accounts, amount, Some(decimals)) } } @@ -741,37 +741,35 @@ impl PrintProgramError for TokenError { E: 'static + std::error::Error + DecodeError + PrintProgramError + FromPrimitive, { match self { - TokenError::NotRentExempt => { - info!("Error: Lamport balance below rent-exempt threshold") - } - TokenError::InsufficientFunds => info!("Error: insufficient funds"), - TokenError::InvalidMint => info!("Error: Invalid Mint"), - TokenError::MintMismatch => info!("Error: Account not associated with this Mint"), - TokenError::OwnerMismatch => info!("Error: owner does not match"), - TokenError::FixedSupply => info!("Error: the total supply of this token is fixed"), - TokenError::AlreadyInUse => info!("Error: account or token already in use"), + TokenError::NotRentExempt => msg!("Error: Lamport balance below rent-exempt threshold"), + TokenError::InsufficientFunds => msg!("Error: insufficient funds"), + TokenError::InvalidMint => msg!("Error: Invalid Mint"), + TokenError::MintMismatch => msg!("Error: Account not associated with this Mint"), + TokenError::OwnerMismatch => msg!("Error: owner does not match"), + TokenError::FixedSupply => msg!("Error: the total supply of this token is fixed"), + TokenError::AlreadyInUse => msg!("Error: account or token already in use"), TokenError::InvalidNumberOfProvidedSigners => { - info!("Error: Invalid number of provided signers") + msg!("Error: Invalid number of provided signers") } TokenError::InvalidNumberOfRequiredSigners => { - info!("Error: Invalid number of required signers") + msg!("Error: Invalid number of required signers") } TokenError::NativeNotSupported => { - info!("Error: Instruction does not support native tokens") + msg!("Error: Instruction does not support native tokens") } TokenError::NonNativeHasBalance => { - info!("Error: Non-native account can only be closed if its balance is zero") + msg!("Error: Non-native account can only be closed if its balance is zero") } - TokenError::InvalidInstruction => info!("Error: Invalid instruction"), - TokenError::InvalidState => info!("Error: Invalid account state for operation"), - TokenError::Overflow => info!("Error: Operation overflowed"), + TokenError::InvalidInstruction => msg!("Error: Invalid instruction"), + TokenError::InvalidState => msg!("Error: Invalid account state for operation"), + TokenError::Overflow => msg!("Error: Operation overflowed"), TokenError::AuthorityTypeNotSupported => { - info!("Error: Account does not support specified authority type") + msg!("Error: Account does not support specified authority type") } - TokenError::MintCannotFreeze => info!("Error: This token mint cannot freeze accounts"), - TokenError::AccountFrozen => info!("Error: Account is frozen"), + TokenError::MintCannotFreeze => msg!("Error: This token mint cannot freeze accounts"), + TokenError::AccountFrozen => msg!("Error: Account is frozen"), TokenError::MintDecimalsMismatch => { - info!("Error: decimals different from the Mint decimals") + msg!("Error: decimals different from the Mint decimals") } } } diff --git a/token/program/Cargo.toml b/token/program/Cargo.toml index d1c1b2fa..458201b9 100644 --- a/token/program/Cargo.toml +++ b/token/program/Cargo.toml @@ -16,11 +16,11 @@ arrayref = "0.3.6" num-derive = "0.3" num-traits = "0.2" num_enum = "0.5.1" -solana-program = "1.4.13" +solana-program = "1.4.14" thiserror = "1.0" [dev-dependencies] -solana-sdk = "1.4.9" +solana-sdk = "1.4.14" [lib] crate-type = ["cdylib", "lib"] diff --git a/token/program/src/processor.rs b/token/program/src/processor.rs index da46e716..a1476ba9 100644 --- a/token/program/src/processor.rs +++ b/token/program/src/processor.rs @@ -10,7 +10,7 @@ use solana_program::{ account_info::{next_account_info, AccountInfo}, decode_error::DecodeError, entrypoint::ProgramResult, - info, + msg, program_error::{PrintProgramError, ProgramError}, program_option::COption, program_pack::{IsInitialized, Pack}, @@ -628,70 +628,70 @@ impl Processor { mint_authority, freeze_authority, } => { - info!("Instruction: InitializeMint"); + msg!("Instruction: InitializeMint"); Self::process_initialize_mint(accounts, decimals, mint_authority, freeze_authority) } TokenInstruction::InitializeAccount => { - info!("Instruction: InitializeAccount"); + msg!("Instruction: InitializeAccount"); Self::process_initialize_account(accounts) } TokenInstruction::InitializeMultisig { m } => { - info!("Instruction: InitializeMultisig"); + msg!("Instruction: InitializeMultisig"); Self::process_initialize_multisig(accounts, m) } TokenInstruction::Transfer { amount } => { - info!("Instruction: Transfer"); + msg!("Instruction: Transfer"); Self::process_transfer(program_id, accounts, amount, None) } TokenInstruction::Approve { amount } => { - info!("Instruction: Approve"); + msg!("Instruction: Approve"); Self::process_approve(program_id, accounts, amount, None) } TokenInstruction::Revoke => { - info!("Instruction: Revoke"); + msg!("Instruction: Revoke"); Self::process_revoke(program_id, accounts) } TokenInstruction::SetAuthority { authority_type, new_authority, } => { - info!("Instruction: SetAuthority"); + msg!("Instruction: SetAuthority"); Self::process_set_authority(program_id, accounts, authority_type, new_authority) } TokenInstruction::MintTo { amount } => { - info!("Instruction: MintTo"); + msg!("Instruction: MintTo"); Self::process_mint_to(program_id, accounts, amount, None) } TokenInstruction::Burn { amount } => { - info!("Instruction: Burn"); + msg!("Instruction: Burn"); Self::process_burn(program_id, accounts, amount, None) } TokenInstruction::CloseAccount => { - info!("Instruction: CloseAccount"); + msg!("Instruction: CloseAccount"); Self::process_close_account(program_id, accounts) } TokenInstruction::FreezeAccount => { - info!("Instruction: FreezeAccount"); + msg!("Instruction: FreezeAccount"); Self::process_toggle_freeze_account(program_id, accounts, true) } TokenInstruction::ThawAccount => { - info!("Instruction: FreezeAccount"); + msg!("Instruction: FreezeAccount"); Self::process_toggle_freeze_account(program_id, accounts, false) } TokenInstruction::TransferChecked { amount, decimals } => { - info!("Instruction: TransferChecked"); + msg!("Instruction: TransferChecked"); Self::process_transfer(program_id, accounts, amount, Some(decimals)) } TokenInstruction::ApproveChecked { amount, decimals } => { - info!("Instruction: ApproveChecked"); + msg!("Instruction: ApproveChecked"); Self::process_approve(program_id, accounts, amount, Some(decimals)) } TokenInstruction::MintToChecked { amount, decimals } => { - info!("Instruction: MintToChecked"); + msg!("Instruction: MintToChecked"); Self::process_mint_to(program_id, accounts, amount, Some(decimals)) } TokenInstruction::BurnChecked { amount, decimals } => { - info!("Instruction: BurnChecked"); + msg!("Instruction: BurnChecked"); Self::process_burn(program_id, accounts, amount, Some(decimals)) } } @@ -741,38 +741,36 @@ impl PrintProgramError for TokenError { E: 'static + std::error::Error + DecodeError + PrintProgramError + FromPrimitive, { match self { - TokenError::NotRentExempt => { - info!("Error: Lamport balance below rent-exempt threshold") - } - TokenError::InsufficientFunds => info!("Error: insufficient funds"), - TokenError::InvalidMint => info!("Error: Invalid Mint"), - TokenError::MintMismatch => info!("Error: Account not associated with this Mint"), - TokenError::OwnerMismatch => info!("Error: owner does not match"), - TokenError::FixedSupply => info!("Error: the total supply of this token is fixed"), - TokenError::AlreadyInUse => info!("Error: account or token already in use"), + TokenError::NotRentExempt => msg!("Error: Lamport balance below rent-exempt threshold"), + TokenError::InsufficientFunds => msg!("Error: insufficient funds"), + TokenError::InvalidMint => msg!("Error: Invalid Mint"), + TokenError::MintMismatch => msg!("Error: Account not associated with this Mint"), + TokenError::OwnerMismatch => msg!("Error: owner does not match"), + TokenError::FixedSupply => msg!("Error: the total supply of this token is fixed"), + TokenError::AlreadyInUse => msg!("Error: account or token already in use"), TokenError::InvalidNumberOfProvidedSigners => { - info!("Error: Invalid number of provided signers") + msg!("Error: Invalid number of provided signers") } TokenError::InvalidNumberOfRequiredSigners => { - info!("Error: Invalid number of required signers") + msg!("Error: Invalid number of required signers") } - TokenError::UninitializedState => info!("Error: State is uninitialized"), + TokenError::UninitializedState => msg!("Error: State is uninitialized"), TokenError::NativeNotSupported => { - info!("Error: Instruction does not support native tokens") + msg!("Error: Instruction does not support native tokens") } TokenError::NonNativeHasBalance => { - info!("Error: Non-native account can only be closed if its balance is zero") + msg!("Error: Non-native account can only be closed if its balance is zero") } - TokenError::InvalidInstruction => info!("Error: Invalid instruction"), - TokenError::InvalidState => info!("Error: Invalid account state for operation"), - TokenError::Overflow => info!("Error: Operation overflowed"), + TokenError::InvalidInstruction => msg!("Error: Invalid instruction"), + TokenError::InvalidState => msg!("Error: Invalid account state for operation"), + TokenError::Overflow => msg!("Error: Operation overflowed"), TokenError::AuthorityTypeNotSupported => { - info!("Error: Account does not support specified authority type") + msg!("Error: Account does not support specified authority type") } - TokenError::MintCannotFreeze => info!("Error: This token mint cannot freeze accounts"), - TokenError::AccountFrozen => info!("Error: Account is frozen"), + TokenError::MintCannotFreeze => msg!("Error: This token mint cannot freeze accounts"), + TokenError::AccountFrozen => msg!("Error: Account is frozen"), TokenError::MintDecimalsMismatch => { - info!("Error: decimals different from the Mint decimals") + msg!("Error: decimals different from the Mint decimals") } } } diff --git a/utils/test-client/Cargo.toml b/utils/test-client/Cargo.toml index 5c2307c2..86ff5c93 100644 --- a/utils/test-client/Cargo.toml +++ b/utils/test-client/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" # Used to ensure that SPL programs are buildable by external clients [dependencies] -solana-sdk = "1.4.9" +solana-sdk = "1.4.14" spl-memo = { path = "../../memo/program", features = [ "no-entrypoint" ] } spl-token = { path = "../../token/program", features = [ "no-entrypoint" ] } spl-token-swap = { path = "../../token-swap/program", features = [ "no-entrypoint" ] }