Include token owners in TransactionTokenBalances (#20642)

* Cache owners in TransactionTokenBalances

* Light cleanup

* Use return struct, and remove pub

* Single-use statements

* Why not, just do the whole crate

* Add metrics

* Make datapoint_debug to prevent spam unless troubleshooting
This commit is contained in:
Tyera Eulberg
2021-10-13 21:46:52 -06:00
committed by GitHub
parent 13462d63a2
commit e806fa6904
17 changed files with 213 additions and 137 deletions

View File

@@ -1,10 +1,12 @@
use crate::parse_instruction::{
check_num_accounts, ParsableProgram, ParseInstructionError, ParsedInstructionEnum,
};
use bincode::deserialize;
use serde_json::{json, Map};
use solana_sdk::{
instruction::CompiledInstruction, pubkey::Pubkey, stake::instruction::StakeInstruction,
use {
crate::parse_instruction::{
check_num_accounts, ParsableProgram, ParseInstructionError, ParsedInstructionEnum,
},
bincode::deserialize,
serde_json::{json, Map},
solana_sdk::{
instruction::CompiledInstruction, pubkey::Pubkey, stake::instruction::StakeInstruction,
},
};
pub fn parse_stake(
@@ -275,13 +277,15 @@ fn check_num_stake_accounts(accounts: &[u8], num: usize) -> Result<(), ParseInst
#[cfg(test)]
mod test {
use super::*;
use solana_sdk::{
message::Message,
pubkey::Pubkey,
stake::{
instruction::{self, LockupArgs},
state::{Authorized, Lockup, StakeAuthorize},
use {
super::*,
solana_sdk::{
message::Message,
pubkey::Pubkey,
stake::{
instruction::{self, LockupArgs},
state::{Authorized, Lockup, StakeAuthorize},
},
},
};