Solana 1.14.9 compatibility

This commit is contained in:
Christian Kamm 2022-12-10 11:18:18 +01:00
parent 3f8373770c
commit 309c2c2f4c
11 changed files with 20 additions and 24 deletions

View File

@ -5,7 +5,7 @@ on:
branches: branches:
- master - master
env: env:
SOLANA_CLI_VERSION: 1.10.29 SOLANA_CLI_VERSION: 1.14.9
NODE_VERSION: 17.0.1 NODE_VERSION: 17.0.1
jobs: jobs:

View File

@ -8,7 +8,7 @@ on:
branches: branches:
- master - master
env: env:
SOLANA_CLI_VERSION: 1.10.29 SOLANA_CLI_VERSION: 1.14.9
NODE_VERSION: 17.0.1 NODE_VERSION: 17.0.1
jobs: jobs:

View File

@ -28,11 +28,11 @@ shellexpand = "2.1.0"
toml = "0.5.8" toml = "0.5.8"
semver = "1.0.4" semver = "1.0.4"
serde = { version = "1.0.122", features = ["derive"] } serde = { version = "1.0.122", features = ["derive"] }
solana-sdk = "~1.10.29" solana-sdk = "~1.14.9"
solana-program = "~1.10.29" solana-program = "~1.14.9"
solana-client = "~1.10.29" solana-client = "~1.14.9"
solana-cli-config = "~1.10.29" solana-cli-config = "~1.14.9"
solana-faucet = "~1.10.29" solana-faucet = "~1.14.9"
dirs = "3.0" dirs = "3.0"
heck = "0.3.1" heck = "0.3.1"
flate2 = "1.0.19" flate2 = "1.0.19"

View File

@ -1388,7 +1388,7 @@ pub fn verify_bin(program_id: Pubkey, bin_path: &Path, cluster: &str) -> Result<
.value .value
.map_or(Err(anyhow!("Account not found")), Ok)?; .map_or(Err(anyhow!("Account not found")), Ok)?;
let bin = account.data let bin = account.data
[UpgradeableLoaderState::programdata_data_offset().unwrap_or(0)..] [UpgradeableLoaderState::size_of_programdata_metadata()..]
.to_vec(); .to_vec();
if let UpgradeableLoaderState::ProgramData { if let UpgradeableLoaderState::ProgramData {
@ -1406,7 +1406,7 @@ pub fn verify_bin(program_id: Pubkey, bin_path: &Path, cluster: &str) -> Result<
} }
} }
UpgradeableLoaderState::Buffer { .. } => { UpgradeableLoaderState::Buffer { .. } => {
let offset = UpgradeableLoaderState::buffer_data_offset().unwrap_or(0); let offset = UpgradeableLoaderState::size_of_buffer_metadata();
( (
account.data[offset..].to_vec(), account.data[offset..].to_vec(),
BinVerificationState::Buffer, BinVerificationState::Buffer,

View File

@ -15,8 +15,8 @@ anchor-lang = { path = "../lang", version = "0.25.0" }
anyhow = "1.0.32" anyhow = "1.0.32"
regex = "1.4.5" regex = "1.4.5"
serde = { version = "1.0.122", features = ["derive"] } serde = { version = "1.0.122", features = ["derive"] }
solana-client = "~1.10.29" solana-client = "~1.14.9"
solana-sdk = "~1.10.29" solana-sdk = "~1.14.9"
solana-account-decoder = "~1.10.29" solana-account-decoder = "~1.14.9"
thiserror = "1.0.20" thiserror = "1.0.20"
url = "2.2.2" url = "2.2.2"

View File

@ -17,4 +17,4 @@ shellexpand = "2.1.0"
anyhow = "1.0.32" anyhow = "1.0.32"
rand = "0.7.3" rand = "0.7.3"
clap = { version = "3.0.0-rc.0", features = ["derive"] } clap = { version = "3.0.0-rc.0", features = ["derive"] }
solana-sdk = "~1.10.29" solana-sdk = "~1.14.9"

View File

@ -15,10 +15,9 @@ use solana_client::rpc_config::{
RpcAccountInfoConfig, RpcProgramAccountsConfig, RpcSendTransactionConfig, RpcAccountInfoConfig, RpcProgramAccountsConfig, RpcSendTransactionConfig,
RpcTransactionLogsConfig, RpcTransactionLogsFilter, RpcTransactionLogsConfig, RpcTransactionLogsFilter,
}; };
use solana_client::rpc_filter::{Memcmp, MemcmpEncodedBytes, RpcFilterType}; use solana_client::rpc_filter::{Memcmp, RpcFilterType};
use solana_client::rpc_response::{Response as RpcResponse, RpcLogsResponse}; use solana_client::rpc_response::{Response as RpcResponse, RpcLogsResponse};
use solana_sdk::account::Account; use solana_sdk::account::Account;
use solana_sdk::bs58;
use solana_sdk::commitment_config::CommitmentConfig; use solana_sdk::commitment_config::CommitmentConfig;
use solana_sdk::signature::{Signature, Signer}; use solana_sdk::signature::{Signature, Signer};
use solana_sdk::transaction::Transaction; use solana_sdk::transaction::Transaction;
@ -155,11 +154,8 @@ impl Program {
&self, &self,
filters: Vec<RpcFilterType>, filters: Vec<RpcFilterType>,
) -> Result<ProgramAccountsIterator<T>, ClientError> { ) -> Result<ProgramAccountsIterator<T>, ClientError> {
let account_type_filter = RpcFilterType::Memcmp(Memcmp { let account_type_filter =
offset: 0, RpcFilterType::Memcmp(Memcmp::new_base58_encoded(0, &T::discriminator()));
bytes: MemcmpEncodedBytes::Base58(bs58::encode(T::discriminator()).into_string()),
encoding: None,
});
let config = RpcProgramAccountsConfig { let config = RpcProgramAccountsConfig {
filters: Some([vec![account_type_filter], filters].concat()), filters: Some([vec![account_type_filter], filters].concat()),
account_config: RpcAccountInfoConfig { account_config: RpcAccountInfoConfig {

View File

@ -6,7 +6,7 @@ ANCHOR_CLI=v$(shell awk -F ' = ' '$$1 ~ /version/ { gsub(/[\"]/, "", $$2); print
# #
# Solana toolchain. # Solana toolchain.
# #
SOLANA_CLI=v1.10.29 SOLANA_CLI=v1.14.9
# #
# Build version should match the Anchor cli version. # Build version should match the Anchor cli version.
# #

View File

@ -39,6 +39,6 @@ arrayref = "0.3.6"
base64 = "0.13.0" base64 = "0.13.0"
borsh = "0.9" borsh = "0.9"
bytemuck = "1.4.0" bytemuck = "1.4.0"
solana-program = "~1.10.29" solana-program = "~1.14.9"
thiserror = "1.0.20" thiserror = "1.0.20"
bincode = "1.3.3" bincode = "1.3.3"

View File

@ -21,7 +21,7 @@ dex = ["serum_dex"]
[dependencies] [dependencies]
anchor-lang = { path = "../lang", version = "0.25.0", features = ["derive"] } anchor-lang = { path = "../lang", version = "0.25.0", features = ["derive"] }
serum_dex = { git = "https://github.com/project-serum/serum-dex", rev = "1be91f2", version = "0.4.0", features = ["no-entrypoint"], optional = true } serum_dex = { git = "https://github.com/project-serum/serum-dex", rev = "1be91f2", version = "0.4.0", features = ["no-entrypoint"], optional = true }
solana-program = "~1.10.29" solana-program = "~1.14.9"
spl-token = { version = "~3.5.0", features = ["no-entrypoint"], optional = true } spl-token = { version = "~3.5.0", features = ["no-entrypoint"], optional = true }
spl-associated-token-account = { version = "~1.1.1", features = ["no-entrypoint"], optional = true } spl-associated-token-account = { version = "~1.1.1", features = ["no-entrypoint"], optional = true }
mpl-token-metadata = { version = "1.2.7", optional = true, features = ["no-entrypoint"] } mpl-token-metadata = { version = "1.2.7", optional = true, features = ["no-entrypoint"] }

View File

@ -22,4 +22,4 @@ anchor-lang = { path = "../../../../lang" }
[dev-dependencies] [dev-dependencies]
anchor-client = { path = "../../../../client", features = ["debug"] } anchor-client = { path = "../../../../client", features = ["debug"] }
bytemuck = "1.4.0" bytemuck = "1.4.0"
solana-program-test = "1.10.35" solana-program-test = "1.14.9"