mirror of
https://github.com/d0zingcat/ore.git
synced 2026-06-07 23:26:46 +00:00
comments and tests
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
use ore::{state::Treasury, utils::AccountDeserialize, TREASURY_ADDRESS};
|
||||
use solana_program::{hash::Hash, keccak::Hash as KeccakHash};
|
||||
use solana_program_test::{processor, BanksClient, ProgramTest};
|
||||
use solana_program::{hash::Hash, keccak::Hash as KeccakHash, rent::Rent};
|
||||
use solana_program_test::{processor, read_file, BanksClient, ProgramTest};
|
||||
use solana_sdk::{
|
||||
account::Account,
|
||||
signature::{Keypair, Signer},
|
||||
transaction::Transaction,
|
||||
};
|
||||
@@ -66,5 +67,19 @@ async fn test_update_difficulty_bad_signer() {
|
||||
async fn setup_program_test_env() -> (BanksClient, Keypair, Hash) {
|
||||
let mut program_test = ProgramTest::new("ore", ore::ID, processor!(ore::process_instruction));
|
||||
program_test.prefer_bpf(true);
|
||||
|
||||
// Setup metadata program
|
||||
let data = read_file(&"tests/buffers/metadata_program.bpf");
|
||||
program_test.add_account(
|
||||
mpl_token_metadata::ID,
|
||||
Account {
|
||||
lamports: Rent::default().minimum_balance(data.len()).max(1),
|
||||
data,
|
||||
owner: solana_sdk::bpf_loader::id(),
|
||||
executable: true,
|
||||
rent_epoch: 0,
|
||||
},
|
||||
);
|
||||
|
||||
program_test.start().await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user