|
@@ -170,6 +170,17 @@ fn process_allocate_with_seed(
|
|
|
assign(account_info, &address, &owner)
|
|
assign(account_info, &address, &owner)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+fn process_assign(accounts: &[AccountInfo], owner: Pubkey) -> ProgramResult {
|
|
|
|
|
+ accounts!(
|
|
|
|
|
+ accounts,
|
|
|
|
|
+ 0 => account_info,
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ let address = AddressInfo::create(account_info, None)?;
|
|
|
|
|
+
|
|
|
|
|
+ assign(account_info, &address, &owner)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
pub fn process(_program_id: &Pubkey, accounts: &[AccountInfo], input: &[u8]) -> ProgramResult {
|
|
pub fn process(_program_id: &Pubkey, accounts: &[AccountInfo], input: &[u8]) -> ProgramResult {
|
|
|
match solana_bincode::limited_deserialize::<SystemInstruction>(input, MAX_INPUT_LEN)
|
|
match solana_bincode::limited_deserialize::<SystemInstruction>(input, MAX_INPUT_LEN)
|
|
|
.map_err(|_| ProgramError::InvalidInstructionData)?
|
|
.map_err(|_| ProgramError::InvalidInstructionData)?
|
|
@@ -187,6 +198,10 @@ pub fn process(_program_id: &Pubkey, accounts: &[AccountInfo], input: &[u8]) ->
|
|
|
msg!("Instruction: AllocateWithSeed");
|
|
msg!("Instruction: AllocateWithSeed");
|
|
|
process_allocate_with_seed(accounts, base, seed, space, owner)
|
|
process_allocate_with_seed(accounts, base, seed, space, owner)
|
|
|
}
|
|
}
|
|
|
|
|
+ SystemInstruction::Assign { owner } => {
|
|
|
|
|
+ msg!("Instruction: Assign");
|
|
|
|
|
+ process_assign(accounts, owner)
|
|
|
|
|
+ }
|
|
|
/* TODO: Remaining instruction implementations... */
|
|
/* TODO: Remaining instruction implementations... */
|
|
|
_ => Err(ProgramError::InvalidInstructionData),
|
|
_ => Err(ProgramError::InvalidInstructionData),
|
|
|
}
|
|
}
|