add pda_seeds field

This commit is contained in:
Sergio Chouhy 2025-11-27 12:08:27 -03:00
parent a3e07347a4
commit d82f06593d
3 changed files with 8 additions and 0 deletions

View File

@ -12,12 +12,17 @@ pub struct ProgramInput<T> {
pub instruction: T, pub instruction: T,
} }
#[derive(Serialize, Deserialize, Clone)]
#[cfg_attr(any(feature = "host", test), derive(Debug, PartialEq, Eq))]
pub struct PdaSeed([u8; 32]);
#[derive(Serialize, Deserialize, Clone)] #[derive(Serialize, Deserialize, Clone)]
#[cfg_attr(any(feature = "host", test), derive(Debug, PartialEq, Eq))] #[cfg_attr(any(feature = "host", test), derive(Debug, PartialEq, Eq))]
pub struct ChainedCall { pub struct ChainedCall {
pub program_id: ProgramId, pub program_id: ProgramId,
pub instruction_data: InstructionData, pub instruction_data: InstructionData,
pub pre_states: Vec<AccountWithMetadata>, pub pre_states: Vec<AccountWithMetadata>,
pub pda_seeds: Vec<PdaSeed>
} }
#[derive(Serialize, Deserialize, Clone)] #[derive(Serialize, Deserialize, Clone)]

View File

@ -107,6 +107,7 @@ impl PublicTransaction {
program_id: message.program_id, program_id: message.program_id,
instruction_data: message.instruction_data.clone(), instruction_data: message.instruction_data.clone(),
pre_states: input_pre_states, pre_states: input_pre_states,
pda_seeds: vec![],
}; };
let mut chained_calls = VecDeque::from_iter([initial_call]); let mut chained_calls = VecDeque::from_iter([initial_call]);

View File

@ -25,6 +25,7 @@ fn main() {
program_id, program_id,
instruction_data: instruction_data.clone(), instruction_data: instruction_data.clone(),
pre_states: vec![receiver_pre.clone(), sender_pre.clone()], // <- Account order permutation here pre_states: vec![receiver_pre.clone(), sender_pre.clone()], // <- Account order permutation here
pda_seeds: vec![]
}; };
num_chain_calls as usize - 1 num_chain_calls as usize - 1
]; ];
@ -33,6 +34,7 @@ fn main() {
program_id, program_id,
instruction_data, instruction_data,
pre_states: vec![receiver_pre.clone(), sender_pre.clone()], // <- Account order permutation here pre_states: vec![receiver_pre.clone(), sender_pre.clone()], // <- Account order permutation here
pda_seeds: vec![],
}); });
write_nssa_outputs_with_chained_call( write_nssa_outputs_with_chained_call(