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

Cli fix #126

Merged
merged 3 commits into from
Aug 14, 2023
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
27 changes: 27 additions & 0 deletions clients/rust/marginfi-cli/src/entrypoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ pub enum Command {
},
#[cfg(feature = "dev")]
InspectPadding {},
#[cfg(feature = "dev")]
InspectSize {},
Account {
#[clap(subcommand)]
subcmd: AccountCommand,
Expand Down Expand Up @@ -375,6 +377,8 @@ pub fn entry(opts: Opts) -> Result<()> {

Ok(())
}
#[cfg(feature = "dev")]
Command::InspectSize {} => inspect_size(),
}
}

Expand Down Expand Up @@ -644,6 +648,29 @@ fn inspect_padding() -> Result<()> {
Ok(())
}

#[cfg(feature = "dev")]
fn inspect_size() -> Result<()> {
use std::mem::size_of;

println!("MarginfiGroup: {}", size_of::<MarginfiGroup>());
println!("GroupConfig: {}", size_of::<GroupConfig>());
println!("InterestRateConfig: {}", size_of::<InterestRateConfig>());
println!(
"Bank: {}",
size_of::<marginfi::state::marginfi_group::Bank>()
);
println!("BankConfig: {}", size_of::<BankConfig>());
println!("OracleConfig: {}", size_of::<OracleConfig>());
println!("BankConfigOpt: {}", size_of::<BankConfigOpt>());
println!("WrappedI80F48: {}", size_of::<WrappedI80F48>());

println!("MarginfiAccount: {}", size_of::<MarginfiAccount>());
println!("LendingAccount: {}", size_of::<LendingAccount>());
println!("Balance: {}", size_of::<Balance>());

Ok(())
}

fn process_account_subcmd(subcmd: AccountCommand, global_options: &GlobalOptions) -> Result<()> {
let profile = load_profile()?;
let config = profile.get_config(Some(global_options))?;
Expand Down
2 changes: 1 addition & 1 deletion clients/rust/marginfi-cli/src/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl Profile {
match cluster {
Cluster::Localnet => pubkey!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"),
Cluster::Devnet => pubkey!("mf2iDQbVTAE3tT4tgAZBhBAmKUW56GsXX7H3oeH4atr"),
Cluster::Mainnet => pubkey!("yyyxaNHJP5FiDhmQW8RkBkp1jTL2cyxJmhMdWpJfsiy"),
Cluster::Mainnet => pubkey!("MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA"),
_ => bail!("cluster {:?} does not have a default target program ID, please provide it through the --pid option", cluster)
}
}
Expand Down
Loading