Program mutable lamports (#4964)
This commit is contained in:
@ -15,7 +15,7 @@ pub struct SolKeyedAccount<'a> {
|
||||
/// Public key of the account
|
||||
pub is_signer: bool,
|
||||
/// Number of lamports owned by this account
|
||||
pub lamports: u64,
|
||||
pub lamports: &'a mut u64,
|
||||
/// On-chain data within this account
|
||||
pub data: &'a mut [u8],
|
||||
/// Program that owns this account
|
||||
@ -79,7 +79,7 @@ pub unsafe fn deserialize<'a>(
|
||||
offset += size_of::<SolPubkey>();
|
||||
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
let lamports = *(input.add(offset) as *const u64);
|
||||
let lamports = &mut *(input.add(offset) as *mut u64);
|
||||
offset += size_of::<u64>();
|
||||
|
||||
#[allow(clippy::cast_ptr_alignment)]
|
||||
|
@ -82,7 +82,7 @@ pub fn sol_log_params(ka: &[SolKeyedAccount], data: &[u8]) {
|
||||
sol_log("- Key");
|
||||
sol_log_key(&k.key);
|
||||
sol_log("- Lamports");
|
||||
sol_log_64(0, 0, 0, 0, k.lamports);
|
||||
sol_log_64(0, 0, 0, 0, *k.lamports);
|
||||
sol_log("- AccountData");
|
||||
sol_log_slice(k.data);
|
||||
sol_log("- Owner");
|
||||
|
Reference in New Issue
Block a user