* Add pubkey_new_rand(), mark Pubkey::new_rand() deprecated (cherry picked from commit0e68ed6a8d
) * Add hash_new_rand(), mark Hash::new_rand() as deprecated (cherry picked from commit76f11c7dae
) * Run `codemod --extensions rs Pubkey::new_rand solana_sdk::pubkey::new_rand` (cherry picked from commit7bc073defe
) # Conflicts: # programs/bpf/benches/bpf_loader.rs # runtime/benches/accounts.rs # runtime/src/accounts.rs * Run `codemod --extensions rs Hash::new_rand solana_sdk:#️⃣:new_rand` (cherry picked from commit17c391121a
) * Remove unused pubkey::Pubkey imports (cherry picked from commit959880db60
) # Conflicts: # runtime/src/accounts_index.rs * Resolve conflicts Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
@@ -441,8 +441,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_bpf_loader_write() {
|
||||
let program_id = Pubkey::new_rand();
|
||||
let program_key = Pubkey::new_rand();
|
||||
let program_id = solana_sdk::pubkey::new_rand();
|
||||
let program_key = solana_sdk::pubkey::new_rand();
|
||||
let program_account = Account::new_ref(1, 0, &program_id);
|
||||
let keyed_accounts = vec![KeyedAccount::new(&program_key, false, &program_account)];
|
||||
let instruction_data = bincode::serialize(&LoaderInstruction::Write {
|
||||
@@ -508,8 +508,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_bpf_loader_finalize() {
|
||||
let program_id = Pubkey::new_rand();
|
||||
let program_key = Pubkey::new_rand();
|
||||
let program_id = solana_sdk::pubkey::new_rand();
|
||||
let program_key = solana_sdk::pubkey::new_rand();
|
||||
let mut file = File::open("test_elfs/noop_aligned.so").expect("file open failed");
|
||||
let mut elf = Vec::new();
|
||||
let rent = Rent::default();
|
||||
@@ -572,8 +572,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_bpf_loader_invoke_main() {
|
||||
let program_id = Pubkey::new_rand();
|
||||
let program_key = Pubkey::new_rand();
|
||||
let program_id = solana_sdk::pubkey::new_rand();
|
||||
let program_key = solana_sdk::pubkey::new_rand();
|
||||
|
||||
// Create program account
|
||||
let mut file = File::open("test_elfs/noop_aligned.so").expect("file open failed");
|
||||
@@ -646,7 +646,7 @@ mod tests {
|
||||
);
|
||||
|
||||
// Case: With duplicate accounts
|
||||
let duplicate_key = Pubkey::new_rand();
|
||||
let duplicate_key = solana_sdk::pubkey::new_rand();
|
||||
let parameter_account = Account::new_ref(1, 0, &program_id);
|
||||
let mut keyed_accounts = vec![KeyedAccount::new(&program_key, false, &program_account)];
|
||||
keyed_accounts.push(KeyedAccount::new(&duplicate_key, false, ¶meter_account));
|
||||
@@ -664,8 +664,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_bpf_loader_serialize_unaligned() {
|
||||
let program_id = Pubkey::new_rand();
|
||||
let program_key = Pubkey::new_rand();
|
||||
let program_id = solana_sdk::pubkey::new_rand();
|
||||
let program_key = solana_sdk::pubkey::new_rand();
|
||||
|
||||
// Create program account
|
||||
let mut file = File::open("test_elfs/noop_unaligned.so").expect("file open failed");
|
||||
@@ -690,7 +690,7 @@ mod tests {
|
||||
);
|
||||
|
||||
// Case: With duplicate accounts
|
||||
let duplicate_key = Pubkey::new_rand();
|
||||
let duplicate_key = solana_sdk::pubkey::new_rand();
|
||||
let parameter_account = Account::new_ref(1, 0, &program_id);
|
||||
let mut keyed_accounts = vec![KeyedAccount::new(&program_key, false, &program_account)];
|
||||
keyed_accounts.push(KeyedAccount::new(&duplicate_key, false, ¶meter_account));
|
||||
@@ -708,8 +708,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_bpf_loader_serialize_aligned() {
|
||||
let program_id = Pubkey::new_rand();
|
||||
let program_key = Pubkey::new_rand();
|
||||
let program_id = solana_sdk::pubkey::new_rand();
|
||||
let program_key = solana_sdk::pubkey::new_rand();
|
||||
|
||||
// Create program account
|
||||
let mut file = File::open("test_elfs/noop_aligned.so").expect("file open failed");
|
||||
@@ -734,7 +734,7 @@ mod tests {
|
||||
);
|
||||
|
||||
// Case: With duplicate accounts
|
||||
let duplicate_key = Pubkey::new_rand();
|
||||
let duplicate_key = solana_sdk::pubkey::new_rand();
|
||||
let parameter_account = Account::new_ref(1, 0, &program_id);
|
||||
let mut keyed_accounts = vec![KeyedAccount::new(&program_key, false, &program_account)];
|
||||
keyed_accounts.push(KeyedAccount::new(&duplicate_key, false, ¶meter_account));
|
||||
@@ -776,8 +776,8 @@ mod tests {
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn test_fuzz() {
|
||||
let program_id = Pubkey::new_rand();
|
||||
let program_key = Pubkey::new_rand();
|
||||
let program_id = solana_sdk::pubkey::new_rand();
|
||||
let program_key = solana_sdk::pubkey::new_rand();
|
||||
|
||||
// Create program account
|
||||
let mut file = File::open("test_elfs/noop_aligned.so").expect("file open failed");
|
||||
|
Reference in New Issue
Block a user