Skip to content

Commit

Permalink
Merge pull request #39 from solendprotocol/WM_null_address
Browse files Browse the repository at this point in the history
Add a canonical null address
  • Loading branch information
DaSichuan authored Aug 23, 2021
2 parents b51bfa9 + fb9da09 commit c570b02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 1 addition & 7 deletions token-lending/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ fn command_update_reserve(
reserve.config.fee_receiver = reserve_config.fee_receiver.unwrap();
}

let mut new_pyth_product_pubkey = null_pyth_product_oracle_pubkey();
let mut new_pyth_product_pubkey = spl_token_lending::null_pubkey();
if pyth_price_pubkey.is_some() {
println!(
"Updating pyth oracle pubkey from {} to {}",
Expand Down Expand Up @@ -1257,9 +1257,3 @@ fn quote_currency_of(matches: &ArgMatches<'_>, name: &str) -> Option<[u8; 32]> {
None
}
}

/// We need a bogus value to send up when we don't want to change
/// the oracle addresses.
pub fn null_pyth_product_oracle_pubkey() -> Pubkey {
Pubkey::from_str("nu11orac1e111111111111111111111111111111111").unwrap()
}
6 changes: 6 additions & 0 deletions token-lending/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ pub mod math;
pub mod processor;
pub mod pyth;
pub mod state;
use std::str::FromStr;

// Export current sdk types for downstream users building with a different sdk version
pub use solana_program;

solana_program::declare_id!("So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo");

/// null pubkey
pub fn null_pubkey() -> solana_program::pubkey::Pubkey {
solana_program::pubkey::Pubkey::from_str("nu11111111111111111111111111111111111111111").unwrap()
}

0 comments on commit c570b02

Please sign in to comment.