Run codemod --extensions rs Pubkey::new_rand solana_sdk::pubkey::new_rand
This commit is contained in:
@@ -151,9 +151,9 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_ownable_missing_owner_signature() {
|
||||
let mut account_owner_pubkey = Pubkey::new_rand();
|
||||
let mut account_owner_pubkey = solana_sdk::pubkey::new_rand();
|
||||
let owner_pubkey = account_owner_pubkey;
|
||||
let new_owner_pubkey = Pubkey::new_rand();
|
||||
let new_owner_pubkey = solana_sdk::pubkey::new_rand();
|
||||
let account = Account::new_ref(1, 0, &system_program::id());
|
||||
let owner_keyed_account = KeyedAccount::new(&owner_pubkey, false, &account); // <-- Attack! Setting owner without the original owner's signature.
|
||||
let err = set_owner(
|
||||
@@ -167,10 +167,10 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_ownable_incorrect_owner() {
|
||||
let mut account_owner_pubkey = Pubkey::new_rand();
|
||||
let new_owner_pubkey = Pubkey::new_rand();
|
||||
let mut account_owner_pubkey = solana_sdk::pubkey::new_rand();
|
||||
let new_owner_pubkey = solana_sdk::pubkey::new_rand();
|
||||
let account = Account::new_ref(1, 0, &system_program::id());
|
||||
let mallory_pubkey = Pubkey::new_rand(); // <-- Attack! Signing with wrong pubkey
|
||||
let mallory_pubkey = solana_sdk::pubkey::new_rand(); // <-- Attack! Signing with wrong pubkey
|
||||
let owner_keyed_account = KeyedAccount::new(&mallory_pubkey, true, &account);
|
||||
let err = set_owner(
|
||||
&mut account_owner_pubkey,
|
||||
|
Reference in New Issue
Block a user