Clean up demote program write lock feature (#21949)

* Clean up demote program write lock feature

* fix test
This commit is contained in:
Justin Starry
2021-12-16 17:27:22 -05:00
committed by GitHub
parent a5769c029f
commit 6ff0be6a82
19 changed files with 98 additions and 204 deletions

View File

@@ -13,11 +13,8 @@ crate::declare_sysvar_id!("Sysvar1nstructions1111111111111111111111111", Instruc
// Construct the account data for the Instruction sSysvar
#[cfg(not(target_arch = "bpf"))]
pub fn construct_instructions_data(
message: &crate::message::SanitizedMessage,
demote_program_write_locks: bool,
) -> Vec<u8> {
let mut data = message.serialize_instructions(demote_program_write_locks);
pub fn construct_instructions_data(message: &crate::message::SanitizedMessage) -> Vec<u8> {
let mut data = message.serialize_instructions();
// add room for current instruction index.
data.resize(data.len() + 2, 0);
@@ -154,7 +151,7 @@ mod tests {
let key = id();
let mut lamports = 0;
let mut data = construct_instructions_data(&sanitized_message, true);
let mut data = construct_instructions_data(&sanitized_message);
let owner = crate::sysvar::id();
let mut account_info = AccountInfo::new(
&key,
@@ -208,7 +205,7 @@ mod tests {
let key = id();
let mut lamports = 0;
let mut data = construct_instructions_data(&sanitized_message, true);
let mut data = construct_instructions_data(&sanitized_message);
store_current_index(&mut data, 1);
let owner = crate::sysvar::id();
let mut account_info = AccountInfo::new(
@@ -266,7 +263,7 @@ mod tests {
let key = id();
let mut lamports = 0;
let mut data = construct_instructions_data(&sanitized_message, true);
let mut data = construct_instructions_data(&sanitized_message);
store_current_index(&mut data, 1);
let owner = crate::sysvar::id();
let mut account_info = AccountInfo::new(