cleanup old features (#19956)

This commit is contained in:
Jack May
2021-09-17 09:46:49 -07:00
committed by GitHub
parent 37d6f5013f
commit 7b0bf64404
5 changed files with 54 additions and 304 deletions

View File

@ -116,7 +116,6 @@ impl PreAccount {
post: &AccountSharedData,
timings: &mut ExecuteDetailsTimings,
outermost_call: bool,
updated_verify_policy: bool,
) -> Result<(), InstructionError> {
let pre = self.account.borrow();
@ -185,14 +184,9 @@ impl PreAccount {
if !rent.is_exempt(post.lamports(), post.data().len()) {
return Err(InstructionError::ExecutableAccountNotRentExempt);
}
let owner = if updated_verify_policy {
post.owner()
} else {
pre.owner()
};
if !is_writable // line coverage used to get branch coverage
|| pre.executable()
|| program_id != owner
|| program_id != post.owner()
{
return Err(InstructionError::ExecutableModified);
}
@ -703,7 +697,6 @@ impl InstructionProcessor {
write_privileges: &[bool],
timings: &mut ExecuteDetailsTimings,
logger: Rc<RefCell<dyn Logger>>,
updated_verify_policy: bool,
) -> Result<(), InstructionError> {
// Verify the per-account instruction results
let (mut pre_sum, mut post_sum) = (0_u128, 0_u128);
@ -722,15 +715,7 @@ impl InstructionProcessor {
}
let account = account.borrow();
pre_account
.verify(
program_id,
is_writable,
rent,
&account,
timings,
false,
updated_verify_policy,
)
.verify(program_id, is_writable, rent, &account, timings, false)
.map_err(|err| {
ic_logger_msg!(logger, "failed to verify account {}: {}", key, err);
err
@ -848,7 +833,6 @@ mod tests {
&self.post,
&mut ExecuteDetailsTimings::default(),
false,
true,
)
}
}