Bump spl-token to clean up magic number (#11726)

This commit is contained in:
Tyera Eulberg
2020-08-20 09:51:12 -06:00
committed by GitHub
parent dc17e2983d
commit 2fd2aceeb2
5 changed files with 7 additions and 9 deletions

View File

@@ -67,7 +67,7 @@ solana-transaction-status = { path = "../transaction-status", version = "1.4.0"
solana-version = { path = "../version", version = "1.4.0" }
solana-vote-program = { path = "../programs/vote", version = "1.4.0" }
solana-vote-signer = { path = "../vote-signer", version = "1.4.0" }
spl-token-v1-0 = { package = "spl-token", version = "1.0.6", features = ["skip-no-mangle"] }
spl-token-v1-0 = { package = "spl-token", version = "1.0.8", features = ["skip-no-mangle"] }
tempfile = "3.1.0"
thiserror = "1.0"
tokio = { version = "0.2.22", features = ["full"] }

View File

@@ -1383,9 +1383,7 @@ fn get_token_program_id_and_mint(
/// program_id) and decimals
fn get_mint_owner_and_decimals(bank: &Arc<Bank>, mint: &Pubkey) -> Result<(Pubkey, u8)> {
if mint == &spl_token_v1_0_native_mint() {
// Uncomment the following once spl_token is bumped to a version that includes native_mint::DECIMALS
// Ok((spl_token_id_v1_0(), spl_token_v1_0::native_mint::DECIMALS))
Ok((spl_token_id_v1_0(), 9))
Ok((spl_token_id_v1_0(), spl_token_v1_0::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())