Add get_processed_sibling_instruction syscall (#22859)

This commit is contained in:
Jack May
2022-02-02 16:45:57 -08:00
committed by GitHub
parent 75563f6c7b
commit ab02dba96f
19 changed files with 898 additions and 61 deletions

View File

@@ -91,6 +91,12 @@ pub trait SyscallStubs: Sync + Send {
fn sol_log_data(&self, fields: &[&[u8]]) {
println!("data: {}", fields.iter().map(base64::encode).join(" "));
}
fn sol_get_processed_sibling_instruction(&self, _index: usize) -> Option<Instruction> {
None
}
fn sol_get_stack_height(&self) -> u64 {
0
}
}
struct DefaultSyscallStubs {}
@@ -177,6 +183,17 @@ pub(crate) fn sol_log_data(data: &[&[u8]]) {
SYSCALL_STUBS.read().unwrap().sol_log_data(data)
}
pub(crate) fn sol_get_processed_sibling_instruction(index: usize) -> Option<Instruction> {
SYSCALL_STUBS
.read()
.unwrap()
.sol_get_processed_sibling_instruction(index)
}
pub(crate) fn sol_get_stack_height() -> u64 {
SYSCALL_STUBS.read().unwrap().sol_get_stack_height()
}
/// Check that two regions do not overlap.
///
/// Adapted from libcore, hidden to share with bpf_loader without being part of