automerge
This commit is contained in:
@@ -24,7 +24,7 @@ pub fn transaction_uses_durable_nonce(tx: &Transaction) -> Option<&CompiledInstr
|
||||
}
|
||||
})
|
||||
.filter(|maybe_ix| match limited_deserialize(&maybe_ix.data) {
|
||||
Ok(SystemInstruction::NonceAdvance) => true,
|
||||
Ok(SystemInstruction::AdvanceNonceAccount) => true,
|
||||
_ => false,
|
||||
})
|
||||
}
|
||||
|
@@ -221,14 +221,14 @@ pub fn process_instruction(
|
||||
let to = next_keyed_account(keyed_accounts_iter)?;
|
||||
transfer_lamports(from, to, lamports)
|
||||
}
|
||||
SystemInstruction::NonceAdvance => {
|
||||
SystemInstruction::AdvanceNonceAccount => {
|
||||
let me = &mut next_keyed_account(keyed_accounts_iter)?;
|
||||
me.nonce_advance(
|
||||
&RecentBlockhashes::from_keyed_account(next_keyed_account(keyed_accounts_iter)?)?,
|
||||
&signers,
|
||||
)
|
||||
}
|
||||
SystemInstruction::NonceWithdraw(lamports) => {
|
||||
SystemInstruction::WithdrawNonceAccount(lamports) => {
|
||||
let me = &mut next_keyed_account(keyed_accounts_iter)?;
|
||||
let to = &mut next_keyed_account(keyed_accounts_iter)?;
|
||||
me.nonce_withdraw(
|
||||
@@ -239,7 +239,7 @@ pub fn process_instruction(
|
||||
&signers,
|
||||
)
|
||||
}
|
||||
SystemInstruction::NonceInitialize(authorized) => {
|
||||
SystemInstruction::InitializeNonceAccount(authorized) => {
|
||||
let me = &mut next_keyed_account(keyed_accounts_iter)?;
|
||||
me.nonce_initialize(
|
||||
&authorized,
|
||||
@@ -247,7 +247,7 @@ pub fn process_instruction(
|
||||
&Rent::from_keyed_account(next_keyed_account(keyed_accounts_iter)?)?,
|
||||
)
|
||||
}
|
||||
SystemInstruction::NonceAuthorize(nonce_authority) => {
|
||||
SystemInstruction::AuthorizeNonceAccount(nonce_authority) => {
|
||||
let me = &mut next_keyed_account(keyed_accounts_iter)?;
|
||||
me.nonce_authorize(&nonce_authority, &signers)
|
||||
}
|
||||
@@ -882,7 +882,7 @@ mod tests {
|
||||
super::process_instruction(
|
||||
&Pubkey::default(),
|
||||
&mut [],
|
||||
&serialize(&SystemInstruction::NonceAdvance).unwrap()
|
||||
&serialize(&SystemInstruction::AdvanceNonceAccount).unwrap()
|
||||
),
|
||||
Err(InstructionError::NotEnoughAccountKeys),
|
||||
);
|
||||
@@ -898,7 +898,7 @@ mod tests {
|
||||
true,
|
||||
&mut Account::default(),
|
||||
),],
|
||||
&serialize(&SystemInstruction::NonceAdvance).unwrap(),
|
||||
&serialize(&SystemInstruction::AdvanceNonceAccount).unwrap(),
|
||||
),
|
||||
Err(InstructionError::NotEnoughAccountKeys),
|
||||
);
|
||||
@@ -917,7 +917,7 @@ mod tests {
|
||||
&mut Account::default(),
|
||||
),
|
||||
],
|
||||
&serialize(&SystemInstruction::NonceAdvance).unwrap(),
|
||||
&serialize(&SystemInstruction::AdvanceNonceAccount).unwrap(),
|
||||
),
|
||||
Err(InstructionError::InvalidArgument),
|
||||
);
|
||||
@@ -944,7 +944,7 @@ mod tests {
|
||||
&mut sysvar::rent::create_account(1, &Rent::free()),
|
||||
),
|
||||
],
|
||||
&serialize(&SystemInstruction::NonceInitialize(Pubkey::default())).unwrap(),
|
||||
&serialize(&SystemInstruction::InitializeNonceAccount(Pubkey::default())).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
@@ -961,7 +961,7 @@ mod tests {
|
||||
),
|
||||
),
|
||||
],
|
||||
&serialize(&SystemInstruction::NonceAdvance).unwrap(),
|
||||
&serialize(&SystemInstruction::AdvanceNonceAccount).unwrap(),
|
||||
),
|
||||
Ok(()),
|
||||
);
|
||||
@@ -986,7 +986,7 @@ mod tests {
|
||||
super::process_instruction(
|
||||
&Pubkey::default(),
|
||||
&mut [],
|
||||
&serialize(&SystemInstruction::NonceWithdraw(42)).unwrap(),
|
||||
&serialize(&SystemInstruction::WithdrawNonceAccount(42)).unwrap(),
|
||||
),
|
||||
Err(InstructionError::NotEnoughAccountKeys),
|
||||
);
|
||||
@@ -1002,7 +1002,7 @@ mod tests {
|
||||
true,
|
||||
&mut Account::default(),
|
||||
),],
|
||||
&serialize(&SystemInstruction::NonceWithdraw(42)).unwrap(),
|
||||
&serialize(&SystemInstruction::WithdrawNonceAccount(42)).unwrap(),
|
||||
),
|
||||
Err(InstructionError::NotEnoughAccountKeys),
|
||||
);
|
||||
@@ -1022,7 +1022,7 @@ mod tests {
|
||||
&mut Account::default(),
|
||||
),
|
||||
],
|
||||
&serialize(&SystemInstruction::NonceWithdraw(42)).unwrap(),
|
||||
&serialize(&SystemInstruction::WithdrawNonceAccount(42)).unwrap(),
|
||||
),
|
||||
Err(InstructionError::InvalidArgument),
|
||||
);
|
||||
@@ -1050,7 +1050,7 @@ mod tests {
|
||||
),
|
||||
KeyedAccount::new(&sysvar::rent::id(), false, &mut Account::default(),),
|
||||
],
|
||||
&serialize(&SystemInstruction::NonceWithdraw(42)).unwrap(),
|
||||
&serialize(&SystemInstruction::WithdrawNonceAccount(42)).unwrap(),
|
||||
),
|
||||
Err(InstructionError::InvalidArgument),
|
||||
);
|
||||
@@ -1082,7 +1082,7 @@ mod tests {
|
||||
&mut sysvar::rent::create_account(1, &Rent::free())
|
||||
),
|
||||
],
|
||||
&serialize(&SystemInstruction::NonceWithdraw(42)).unwrap(),
|
||||
&serialize(&SystemInstruction::WithdrawNonceAccount(42)).unwrap(),
|
||||
),
|
||||
Ok(()),
|
||||
);
|
||||
@@ -1094,7 +1094,7 @@ mod tests {
|
||||
super::process_instruction(
|
||||
&Pubkey::default(),
|
||||
&mut [],
|
||||
&serialize(&SystemInstruction::NonceInitialize(Pubkey::default())).unwrap(),
|
||||
&serialize(&SystemInstruction::InitializeNonceAccount(Pubkey::default())).unwrap(),
|
||||
),
|
||||
Err(InstructionError::NotEnoughAccountKeys),
|
||||
);
|
||||
@@ -1110,7 +1110,7 @@ mod tests {
|
||||
true,
|
||||
&mut nonce_state::create_account(1_000_000),
|
||||
),],
|
||||
&serialize(&SystemInstruction::NonceInitialize(Pubkey::default())).unwrap(),
|
||||
&serialize(&SystemInstruction::InitializeNonceAccount(Pubkey::default())).unwrap(),
|
||||
),
|
||||
Err(InstructionError::NotEnoughAccountKeys),
|
||||
);
|
||||
@@ -1133,7 +1133,7 @@ mod tests {
|
||||
&mut Account::default(),
|
||||
),
|
||||
],
|
||||
&serialize(&SystemInstruction::NonceInitialize(Pubkey::default())).unwrap(),
|
||||
&serialize(&SystemInstruction::InitializeNonceAccount(Pubkey::default())).unwrap(),
|
||||
),
|
||||
Err(InstructionError::InvalidArgument),
|
||||
);
|
||||
@@ -1160,7 +1160,7 @@ mod tests {
|
||||
),
|
||||
KeyedAccount::new(&sysvar::rent::id(), false, &mut Account::default(),),
|
||||
],
|
||||
&serialize(&SystemInstruction::NonceInitialize(Pubkey::default())).unwrap(),
|
||||
&serialize(&SystemInstruction::InitializeNonceAccount(Pubkey::default())).unwrap(),
|
||||
),
|
||||
Err(InstructionError::InvalidArgument),
|
||||
);
|
||||
@@ -1191,7 +1191,7 @@ mod tests {
|
||||
&mut sysvar::rent::create_account(1, &Rent::free())
|
||||
),
|
||||
],
|
||||
&serialize(&SystemInstruction::NonceInitialize(Pubkey::default())).unwrap(),
|
||||
&serialize(&SystemInstruction::InitializeNonceAccount(Pubkey::default())).unwrap(),
|
||||
),
|
||||
Ok(()),
|
||||
);
|
||||
@@ -1218,14 +1218,14 @@ mod tests {
|
||||
&mut sysvar::rent::create_account(1, &Rent::free()),
|
||||
),
|
||||
],
|
||||
&serialize(&SystemInstruction::NonceInitialize(Pubkey::default())).unwrap(),
|
||||
&serialize(&SystemInstruction::InitializeNonceAccount(Pubkey::default())).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
super::process_instruction(
|
||||
&Pubkey::default(),
|
||||
&mut [KeyedAccount::new(&Pubkey::default(), true, &mut nonce_acc,),],
|
||||
&serialize(&SystemInstruction::NonceAuthorize(Pubkey::default(),)).unwrap(),
|
||||
&serialize(&SystemInstruction::AuthorizeNonceAccount(Pubkey::default(),)).unwrap(),
|
||||
),
|
||||
Ok(()),
|
||||
);
|
||||
|
Reference in New Issue
Block a user