Skip to content

Commit

Permalink
cli fix for new pyth
Browse files Browse the repository at this point in the history
  • Loading branch information
nope-finance committed Jul 21, 2024
1 parent 05fe19b commit 58ed4ad
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions token-lending/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,6 @@ fn main() {
.value_name("RESERVE_TYPE")
.takes_value(true)
.required(false)
.default_value("Regular")
.help("Reserve type"),
)
)
Expand Down Expand Up @@ -1863,7 +1862,7 @@ fn command_set_lending_market_owner_and_config(
fn command_update_reserve(
config: &mut Config,
reserve_config: PartialReserveConfig,
pyth_product_pubkey: Option<Pubkey>,
_pyth_product_pubkey: Option<Pubkey>,

Check warning on line 1865 in token-lending/cli/src/main.rs

View check run for this annotation

Codecov / codecov/patch

token-lending/cli/src/main.rs#L1865

Added line #L1865 was not covered by tests
pyth_price_pubkey: Option<Pubkey>,
switchboard_feed_pubkey: Option<Pubkey>,
reserve_pubkey: Pubkey,
Expand Down Expand Up @@ -2117,15 +2116,15 @@ fn command_update_reserve(
}

let mut new_pyth_product_pubkey = solend_sdk::NULL_PUBKEY;
if pyth_price_pubkey.is_some() {
if pyth_price_pubkey.is_some() && reserve.liquidity.pyth_oracle_pubkey != pyth_price_pubkey.unwrap() {

Check warning on line 2119 in token-lending/cli/src/main.rs

View check run for this annotation

Codecov / codecov/patch

token-lending/cli/src/main.rs#L2119

Added line #L2119 was not covered by tests
no_change = false;
println!(
"Updating pyth oracle pubkey from {} to {}",
reserve.liquidity.pyth_oracle_pubkey,
pyth_price_pubkey.unwrap(),
);
reserve.liquidity.pyth_oracle_pubkey = pyth_price_pubkey.unwrap();
new_pyth_product_pubkey = pyth_product_pubkey.unwrap();
new_pyth_product_pubkey = solend_sdk::NULL_PUBKEY;

Check warning on line 2127 in token-lending/cli/src/main.rs

View check run for this annotation

Codecov / codecov/patch

token-lending/cli/src/main.rs#L2127

Added line #L2127 was not covered by tests
}

if switchboard_feed_pubkey.is_some() {
Expand Down

0 comments on commit 58ed4ad

Please sign in to comment.