Skip to content

Commit

Permalink
Merge pull request #126 from mrgnlabs/j/deser-fix
Browse files Browse the repository at this point in the history
Cli fix
  • Loading branch information
jkbpvsc authored Aug 14, 2023
2 parents 94293d0 + 4c068fe commit 1bf4b97
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
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

0 comments on commit 1bf4b97

Please sign in to comment.