Prepare RPC subsystem for multiple SPL Token program ids
This commit is contained in:
@@ -2,7 +2,9 @@ use {
|
||||
jsonrpc_core::{Error, Result},
|
||||
solana_account_decoder::{
|
||||
parse_account_data::AccountAdditionalData,
|
||||
parse_token::{get_token_account_mint, spl_token_id, spl_token_native_mint},
|
||||
parse_token::{
|
||||
get_token_account_mint, spl_token_native_mint, spl_token_native_mint_program_id,
|
||||
},
|
||||
UiAccount, UiAccountData, UiAccountEncoding,
|
||||
},
|
||||
solana_client::rpc_response::RpcKeyedAccount,
|
||||
@@ -75,7 +77,10 @@ where
|
||||
/// program_id) and decimals
|
||||
pub fn get_mint_owner_and_decimals(bank: &Arc<Bank>, mint: &Pubkey) -> Result<(Pubkey, u8)> {
|
||||
if mint == &spl_token_native_mint() {
|
||||
Ok((spl_token_id(), spl_token::native_mint::DECIMALS))
|
||||
Ok((
|
||||
spl_token_native_mint_program_id(),
|
||||
spl_token::native_mint::DECIMALS,
|
||||
))
|
||||
} else {
|
||||
let mint_account = bank.get_account(mint).ok_or_else(|| {
|
||||
Error::invalid_params("Invalid param: could not find mint".to_string())
|
||||
|
||||
Reference in New Issue
Block a user