Remove unused InstructionRecorder and some SanitizedMessage methods (#23723)

This commit is contained in:
Justin Starry
2022-03-17 20:25:12 +08:00
committed by GitHub
parent 0eccacbd5b
commit 9ed056424c
2 changed files with 2 additions and 142 deletions

View File

@ -1,32 +0,0 @@
use {
solana_sdk::instruction::CompiledInstruction,
std::{cell::RefCell, rc::Rc},
};
/// Records and compiles cross-program invoked instructions
#[derive(Clone)]
pub struct InstructionRecorder {
records: Vec<Vec<CompiledInstruction>>,
}
impl InstructionRecorder {
pub fn new_ref(instructions_in_message: usize) -> Rc<RefCell<Self>> {
Rc::new(RefCell::new(Self {
records: Vec::with_capacity(instructions_in_message),
}))
}
pub fn deconstruct(self) -> Vec<Vec<CompiledInstruction>> {
self.records
}
pub fn begin_next_recording(&mut self) {
self.records.push(Vec::new());
}
pub fn record_compiled_instruction(&mut self, instruction: CompiledInstruction) {
if let Some(records) = self.records.last_mut() {
records.push(instruction);
}
}
}