Refactor: Remove trait
from nonce keyed account (#23811)
* Removes the trait `NonceKeyedAccount`.
This commit is contained in:
committed by
GitHub
parent
3d7c8442c7
commit
9f0ca6d88a
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,8 @@
|
|||||||
use {
|
use {
|
||||||
crate::nonce_keyed_account::NonceKeyedAccount,
|
crate::nonce_keyed_account::{
|
||||||
|
advance_nonce_account, authorize_nonce_account, initialize_nonce_account,
|
||||||
|
withdraw_nonce_account,
|
||||||
|
},
|
||||||
log::*,
|
log::*,
|
||||||
solana_program_runtime::{
|
solana_program_runtime::{
|
||||||
ic_msg, invoke_context::InvokeContext, sysvar_cache::get_sysvar_with_account_check,
|
ic_msg, invoke_context::InvokeContext, sysvar_cache::get_sysvar_with_account_check,
|
||||||
@ -361,7 +364,7 @@ pub fn process_instruction(
|
|||||||
);
|
);
|
||||||
return Err(NonceError::NoRecentBlockhashes.into());
|
return Err(NonceError::NoRecentBlockhashes.into());
|
||||||
}
|
}
|
||||||
me.advance_nonce_account(&signers, invoke_context)
|
advance_nonce_account(me, &signers, invoke_context)
|
||||||
}
|
}
|
||||||
SystemInstruction::WithdrawNonceAccount(lamports) => {
|
SystemInstruction::WithdrawNonceAccount(lamports) => {
|
||||||
let me = &mut keyed_account_at_index(keyed_accounts, first_instruction_account)?;
|
let me = &mut keyed_account_at_index(keyed_accounts, first_instruction_account)?;
|
||||||
@ -375,7 +378,7 @@ pub fn process_instruction(
|
|||||||
keyed_account_at_index(keyed_accounts, first_instruction_account + 3)?,
|
keyed_account_at_index(keyed_accounts, first_instruction_account + 3)?,
|
||||||
invoke_context,
|
invoke_context,
|
||||||
)?;
|
)?;
|
||||||
me.withdraw_nonce_account(lamports, to, &rent, &signers, invoke_context)
|
withdraw_nonce_account(me, lamports, to, &rent, &signers, invoke_context)
|
||||||
}
|
}
|
||||||
SystemInstruction::InitializeNonceAccount(authorized) => {
|
SystemInstruction::InitializeNonceAccount(authorized) => {
|
||||||
let me = &mut keyed_account_at_index(keyed_accounts, first_instruction_account)?;
|
let me = &mut keyed_account_at_index(keyed_accounts, first_instruction_account)?;
|
||||||
@ -395,11 +398,11 @@ pub fn process_instruction(
|
|||||||
keyed_account_at_index(keyed_accounts, first_instruction_account + 2)?,
|
keyed_account_at_index(keyed_accounts, first_instruction_account + 2)?,
|
||||||
invoke_context,
|
invoke_context,
|
||||||
)?;
|
)?;
|
||||||
me.initialize_nonce_account(&authorized, &rent, invoke_context)
|
initialize_nonce_account(me, &authorized, &rent, invoke_context)
|
||||||
}
|
}
|
||||||
SystemInstruction::AuthorizeNonceAccount(nonce_authority) => {
|
SystemInstruction::AuthorizeNonceAccount(nonce_authority) => {
|
||||||
let me = &mut keyed_account_at_index(keyed_accounts, first_instruction_account)?;
|
let me = &mut keyed_account_at_index(keyed_accounts, first_instruction_account)?;
|
||||||
me.authorize_nonce_account(&nonce_authority, &signers, invoke_context)
|
authorize_nonce_account(me, &nonce_authority, &signers, invoke_context)
|
||||||
}
|
}
|
||||||
SystemInstruction::Allocate { space } => {
|
SystemInstruction::Allocate { space } => {
|
||||||
let keyed_account = keyed_account_at_index(keyed_accounts, first_instruction_account)?;
|
let keyed_account = keyed_account_at_index(keyed_accounts, first_instruction_account)?;
|
||||||
|
Reference in New Issue
Block a user