Skip to content

Commit

Permalink
Adds loader-v4 to write lock demotion exemptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Nov 5, 2024
1 parent 6db93da commit 0a493c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion sdk/program/src/message/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use {
bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable,
hash::Hash,
instruction::{CompiledInstruction, Instruction},
loader_v4,
message::{compiled_keys::CompiledKeys, MessageHeader},
pubkey::Pubkey,
system_instruction, system_program, sysvar,
Expand Down Expand Up @@ -691,7 +692,7 @@ impl Message {
pub fn is_upgradeable_loader_present(&self) -> bool {
self.account_keys
.iter()
.any(|&key| key == bpf_loader_upgradeable::id())
.any(|key| bpf_loader_upgradeable::check_id(key) || loader_v4::check_id(key))
}
}

Expand Down
4 changes: 2 additions & 2 deletions sdk/program/src/message/versions/v0/loaded.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use {
crate::{
bpf_loader_upgradeable,
bpf_loader_upgradeable, loader_v4,
message::{v0, AccountKeys},
pubkey::Pubkey,
},
Expand Down Expand Up @@ -179,7 +179,7 @@ impl<'a> LoadedMessage<'a> {
pub fn is_upgradeable_loader_present(&self) -> bool {
self.account_keys()
.iter()
.any(|&key| key == bpf_loader_upgradeable::id())
.any(|key| bpf_loader_upgradeable::check_id(key) || loader_v4::check_id(key))
}
}

Expand Down

0 comments on commit 0a493c3

Please sign in to comment.