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

adds lut arg with a default original one #332

Merged
merged 1 commit into from
Mar 5, 2025
Merged
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
8 changes: 4 additions & 4 deletions cli/s-controller/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use generic_pool_calculator_lib::account_resolvers::LstSolCommonIntermediateKeys
use lazy_static::lazy_static;
use lido_calculator_lib::lido_sol_val_calc_account_metas;
use marinade_calculator_lib::marinade_sol_val_calc_account_metas;
use s_cli_utils::srlut;

use s_controller_interface::PoolState;
use sanctum_lst_list::{PoolInfo, SanctumLst, SanctumLstList, SplPoolAccounts};
use solana_client::nonblocking::rpc_client::RpcClient;
Expand Down Expand Up @@ -118,10 +118,10 @@ pub fn find_sanctum_lst_by_mint(mint: Pubkey) -> Option<&'static SanctumLst> {
.find(|lst| lst.mint == mint)
}

pub async fn fetch_srlut(rpc: &RpcClient) -> AddressLookupTableAccount {
let srlut = rpc.get_account(&srlut::ID).await.unwrap();
pub async fn fetch_srlut(rpc: &RpcClient, lut: &Pubkey) -> AddressLookupTableAccount {
let srlut = rpc.get_account(&lut).await.unwrap();
AddressLookupTableAccount {
key: srlut::ID,
key: *lut,
addresses: AddressLookupTable::deserialize(&srlut.data)
.unwrap()
.addresses
Expand Down
10 changes: 9 additions & 1 deletion cli/s-controller/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use clap::{
builder::{StringValueParser, TypedValueParser, ValueParser},
Parser,
};
use s_cli_utils::{CONFIG_HELP, FEE_LIMIT_CB_HELP, TX_SEND_MODE_HELP};
use s_cli_utils::{srlut, CONFIG_HELP, FEE_LIMIT_CB_HELP, TX_SEND_MODE_HELP};
use sanctum_solana_cli_utils::{ConfigWrapper, TxSendMode};
use solana_sdk::pubkey::Pubkey;
use subcmd::Subcmd;
Expand Down Expand Up @@ -56,6 +56,14 @@ pub struct Args {
)]
pub fee_limit_cb: u64,

#[arg(
long,
short,
help = "LUT address to be used",
default_value_t = srlut::ID,
)]
pub lut: Pubkey,

#[command(subcommand)]
pub subcmd: Subcmd,
}
Expand Down
2 changes: 1 addition & 1 deletion cli/s-controller/src/subcmd/rebal_sol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ impl RebalSolArgs {
}
ixs.push(end_rebalance_ix);

let srlut = fetch_srlut(&rpc).await;
let srlut = fetch_srlut(&rpc, &args.lut).await;

handle_tx_full(
&rpc,
Expand Down
2 changes: 1 addition & 1 deletion cli/s-controller/src/subcmd/rebal_stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ impl RebalStakeArgs {
}
ixs.push(end_rebalance_ix);

let srlut = fetch_srlut(&rpc).await;
let srlut = fetch_srlut(&rpc, &args.lut).await;

handle_tx_full(
&rpc,
Expand Down