spl-token: New program feature flag (#21354)

* spl-token: Add feature flag for new release

* Remove all spl token version declarations
This commit is contained in:
Jon Cinque
2021-11-21 14:27:03 +01:00
committed by GitHub
parent 2ed7e3af89
commit 02bc4e3fc1
23 changed files with 229 additions and 245 deletions

View File

@@ -2,7 +2,7 @@ use {
jsonrpc_core::{Error, Result},
solana_account_decoder::{
parse_account_data::AccountAdditionalData,
parse_token::{get_token_account_mint, spl_token_id_v2_0, spl_token_v2_0_native_mint},
parse_token::{get_token_account_mint, spl_token_id, spl_token_native_mint},
UiAccount, UiAccountData, UiAccountEncoding,
},
solana_client::rpc_response::RpcKeyedAccount,
@@ -11,7 +11,7 @@ use {
account::{AccountSharedData, ReadableAccount},
pubkey::Pubkey,
},
spl_token_v2_0::{solana_program::program_pack::Pack, state::Mint},
spl_token::{solana_program::program_pack::Pack, state::Mint},
std::{collections::HashMap, sync::Arc},
};
@@ -74,8 +74,8 @@ where
/// Analyze a mint Pubkey that may be the native_mint and get the mint-account owner (token
/// program_id) and decimals
pub fn get_mint_owner_and_decimals(bank: &Arc<Bank>, mint: &Pubkey) -> Result<(Pubkey, u8)> {
if mint == &spl_token_v2_0_native_mint() {
Ok((spl_token_id_v2_0(), spl_token_v2_0::native_mint::DECIMALS))
if mint == &spl_token_native_mint() {
Ok((spl_token_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())