mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-08-27 04:11:08 +00:00
refactor(lee): migrate ChainedCall/Message program reference from ProgramId to AccountId
Chained-call and public-transaction dispatch now address the target program directly by AccountId instead of routing through ProgramId and converting internally, closing the gap that blocked PDA-addressed program invocation. The field is named program_account_id (not account_id) to stay unambiguous next to the account_ids list it sits beside in the same structs. Execution/PDA-derivation logic that fundamentally needs the RISC0 image id (self_program_id, caller_program_id, env::verify, PDA seed derivation) stays ProgramId-typed, recovering it from the dispatched AccountId via the existing bijection where needed.
This commit is contained in:
@@ -37,7 +37,7 @@ fn main() {
|
||||
let mut chained_calls = Vec::new();
|
||||
for _i in 0..num_chain_calls {
|
||||
let new_chained_call = ChainedCall {
|
||||
program_id: auth_transfer_id,
|
||||
program_account_id: auth_transfer_id.into(),
|
||||
instruction_data: instruction_data.clone(),
|
||||
pre_states: vec![running_sender_pre.clone(), running_recipient_pre.clone()], /* <- Account order permutation here */
|
||||
pda_seeds: pda_seed.iter().copied().collect(),
|
||||
|
||||
@@ -28,7 +28,7 @@ fn main() {
|
||||
.collect();
|
||||
|
||||
let chained_call = ChainedCall {
|
||||
program_id: clock_program_id,
|
||||
program_account_id: clock_program_id.into(),
|
||||
instruction_data: to_vec(×tamp).unwrap(),
|
||||
pre_states: pre_states.clone(),
|
||||
pda_seeds: vec![],
|
||||
|
||||
@@ -29,7 +29,7 @@ fn main() {
|
||||
let [faucet_pre, vault_pda_pre] = [pre_states[0].clone(), pre_states[1].clone()];
|
||||
|
||||
let chained_calls = vec![ChainedCall {
|
||||
program_id: faucet_program_id,
|
||||
program_account_id: faucet_program_id.into(),
|
||||
instruction_data: to_vec(&faucet_core::Instruction::GenesisTransferVault {
|
||||
vault_program_id,
|
||||
recipient_id,
|
||||
|
||||
@@ -31,7 +31,7 @@ fn main() {
|
||||
first_for_callee.is_authorized = true;
|
||||
|
||||
let chained_call = ChainedCall {
|
||||
program_id: auth_transfer_id,
|
||||
program_account_id: auth_transfer_id.into(),
|
||||
instruction_data: to_vec(&authenticated_transfer_core::Instruction::Transfer { amount })
|
||||
.unwrap(),
|
||||
pre_states: vec![first_for_callee, second.clone()],
|
||||
|
||||
Reference in New Issue
Block a user