mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-07-01 03:19:29 +00:00
refactor(circuit): move address derivation out of a loop
This commit is contained in:
parent
38395886e6
commit
84df5252c0
@ -527,15 +527,16 @@ fn resolve_authorization_and_record_bindings(
|
||||
caller_pda_seeds: &[PdaSeed],
|
||||
previous_is_authorized: bool,
|
||||
) -> bool {
|
||||
let pda_address = account_identities
|
||||
.get(pre_state_position)
|
||||
.and_then(InputAccountIdentity::private_pda_address);
|
||||
let matched_caller_seed: Option<(PdaSeed, bool, ProgramId)> =
|
||||
caller_program_id.and_then(|caller| {
|
||||
caller_pda_seeds.iter().find_map(|seed| {
|
||||
if AccountId::for_public_pda(&caller, seed) == pre_account_id {
|
||||
return Some((*seed, false, caller));
|
||||
}
|
||||
if let Some(address) = account_identities
|
||||
.get(pre_state_position)
|
||||
.and_then(InputAccountIdentity::private_pda_address)
|
||||
if let Some(address) = &pda_address
|
||||
&& address.pda_account_id(&caller, seed) == pre_account_id
|
||||
{
|
||||
return Some((*seed, true, caller));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user