Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solana v2 update #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,679 changes: 1,361 additions & 1,318 deletions Cargo.lock

Large diffs are not rendered by default.

27 changes: 13 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ members = [
[workspace.dependencies]
anyhow = "^1.0"
bincode = "^1.0"
borsh = ">=0.9,<1.0.0"
clap = "^3"
borsh = "^1"
clap = "^4"
itertools = ">=0.1"
jupiter-amm-interface = "~0.4.0"
lazy_static = "^1.0"
# set git dependencies to branch instead of locking to rev so that consumers can upgrade easily
lido = { git = "https://github.com/jup-ag/solido", branch = "jupiter", features = ["no-entrypoint"] } # rev = "ec25a9b"
marinade_finance_interface = { git = "https://github.com/igneous-labs/marinade_finance_interface", branch = "master" } # rev = "4d1895b"
lido = { git = "https://github.com/igneous-labs/solido", branch = "main", features = ["no-entrypoint"] }
marinade_finance_interface = { git = "https://github.com/igneous-labs/marinade_finance_interface", branch = "master" }
num-derive = ">=0.1"
num-traits = ">=0.1"
rand = "0.8.5"
Expand All @@ -29,26 +29,25 @@ sanctum-macros = "^1.2"
serde = "^1"
serde_json = "^1"
spl-associated-token-account = { version = ">=1", features = ["no-entrypoint"] }
spl-math = { version = "0.1.0", features = ["no-entrypoint"]}
spl-stake-pool = { version = "^1", features = ["no-entrypoint"] }
spl-stake-pool = { version = ">=2.0.1", features = ["no-entrypoint"] } # 2.0.1 is the specific vers that patches incompatible breaking changes in 2.0.0
spl-token = ">=3.0"
thiserror = "^1.0"
tokio = "^1.0"
unstake_interface = { git = "https://github.com/igneous-labs/sanctum-unstake-program.git", rev = "069f941" }
unstake-lib = { git = "https://github.com/igneous-labs/sanctum-unstake-program.git", rev = "069f941" }
unstake_interface = { git = "https://github.com/igneous-labs/sanctum-unstake-program.git", rev = "3651f16" }
unstake-lib = { git = "https://github.com/igneous-labs/sanctum-unstake-program.git", rev = "3651f16" }

# sanctum solana utils
sanctum-solana-cli-utils = { git = "https://github.com/igneous-labs/sanctum-solana-utils.git", branch = "master" } # rev = "111f01"
sanctum-solana-cli-utils = { git = "https://github.com/igneous-labs/sanctum-solana-utils.git", branch = "master" }

# sanctum-lst-list
# keep branch = "master" for flexibility of downstream crates
sanctum-lst-list = { git = "https://github.com/igneous-labs/sanctum-lst-list.git", branch = "master" } # rev = ebecde4
sanctum-lst-list = { git = "https://github.com/igneous-labs/sanctum-lst-list.git", branch = "master" }

# solana core crates
solana-program = "^1"
solana-sdk = "^1"
solana-account-decoder = "^1"
solana-client = "^1"
solana-program = ">=1"
solana-sdk = ">=1"
solana-account-decoder = ">=1"
solana-client = ">=1"

# workspace members
stakedex_deposit_sol_interface = { path = "./interfaces/stakedex_deposit_sol_interface" }
Expand Down
6 changes: 4 additions & 2 deletions cli/srlut/src/subcmd/extend.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{fs::File, io::BufReader, path::PathBuf};

use clap::Args;
use sanctum_solana_cli_utils::{parse_signer, TxSendingNonblockingRpcClient};
use sanctum_solana_cli_utils::{parse_signer, HandleTxArgs, TxSendingNonblockingRpcClient};
use solana_sdk::{
address_lookup_table::{instruction::extend_lookup_table, state::AddressLookupTable},
compute_budget::ComputeBudgetInstruction,
Expand Down Expand Up @@ -109,7 +109,9 @@ impl ExtendArgs {
&signers,
)
.unwrap();
rpc.handle_tx(&tx, args.send_mode).await;
rpc.handle_tx(&tx, args.send_mode, HandleTxArgs::cli_default())
.await
.unwrap();
}
}
}
6 changes: 4 additions & 2 deletions cli/srlut/src/subcmd/init.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::Args;
use sanctum_solana_cli_utils::{parse_signer, TxSendingNonblockingRpcClient};
use sanctum_solana_cli_utils::{parse_signer, HandleTxArgs, TxSendingNonblockingRpcClient};
use solana_sdk::{
address_lookup_table::instruction::create_lookup_table,
epoch_info::EpochInfo,
Expand Down Expand Up @@ -54,6 +54,8 @@ impl InitArgs {

eprintln!("Creating LUT {lut_addr}");

rpc.handle_tx(&tx, args.send_mode).await;
rpc.handle_tx(&tx, args.send_mode, HandleTxArgs::cli_default())
.await
.unwrap();
}
}
2 changes: 1 addition & 1 deletion libs/lido/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use lido::state::{AccountType, Lido, Validator};

mod stakedex_traits;

use solana_program::{borsh0_10::try_from_slice_unchecked, program_pack::Pack};
use solana_program::{borsh1::try_from_slice_unchecked, program_pack::Pack};
pub use stakedex_traits::*;

pub const LIDO_LABEL: &str = "Lido";
Expand Down
2 changes: 1 addition & 1 deletion libs/marinade/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use consts::VALIDATOR_RECORD_BYTE_LENGTH;
use marinade_finance_interface::{
Fee, FeeCents, LiqPool, List, StakeSystem, State, ValidatorRecord, ValidatorSystem,
};
use solana_program::{borsh0_10::try_from_slice_unchecked, pubkey::Pubkey};
use solana_program::{borsh1::try_from_slice_unchecked, pubkey::Pubkey};

pub const MARINADE_LABEL: &str = "Marinade";

Expand Down
2 changes: 1 addition & 1 deletion libs/spl_stake_pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::sync::{atomic::AtomicU64, Arc};

use anyhow::{anyhow, Result};
use deposit_cap_guard::{find_spl_deposit_cap_guard_state, DepositCap};
use solana_program::{borsh0_10::try_from_slice_unchecked, pubkey::Pubkey};
use solana_program::{borsh1::try_from_slice_unchecked, pubkey::Pubkey};
use spl_stake_pool::{
error::StakePoolError,
find_deposit_authority_program_address, find_withdraw_authority_program_address,
Expand Down
1 change: 0 additions & 1 deletion libs/unstake_it/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ edition = "2021"
anyhow = { workspace = true }
jupiter-amm-interface = { workspace = true }
solana-program = { workspace = true }
spl-math = { workspace = true }
spl-token = { workspace = true }
stakedex_deposit_stake_interface = { workspace = true }
stakedex_jup_interface = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion libs/unstake_it/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use solana_program::{borsh0_10::try_from_slice_unchecked, pubkey::Pubkey};
use solana_program::{borsh1::try_from_slice_unchecked, pubkey::Pubkey};
use unstake_interface::{Fee, FeeEnum, Pool, ProtocolFee, Rational};

mod pda;
Expand Down
5 changes: 2 additions & 3 deletions stakedex_sdk/tests/test_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,8 @@ fn setup_swap_via_stake(
) -> (u64, Vec<Instruction>, u64, u64) {
let source_balance = RPC
.get_token_account_balance(&src_token_acc)
.map_err(|err| {
println!("Could not swap {} to {}", input_mint, output_mint);
err
.inspect_err(|err| {
println!("Could not swap {input_mint} to {output_mint}: {err}");
})
.unwrap();

Expand Down