mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-13 23:16:52 +00:00
bus checks
This commit is contained in:
@@ -91,9 +91,8 @@ async fn test_initialize() {
|
||||
let bus_account = banks.get_account(bus_pdas[i].0).await.unwrap().unwrap();
|
||||
assert_eq!(bus_account.owner, ore::id());
|
||||
let bus = Bus::try_from_bytes(&bus_account.data).unwrap();
|
||||
// assert_eq!(bus.bump as u8, bus_pdas[i].1);
|
||||
assert_eq!(bus.id as u8, i as u8);
|
||||
assert_eq!(bus.available_rewards, 0);
|
||||
assert_eq!(bus.rewards, 0);
|
||||
println!(
|
||||
"Bus {:?} {:?} {:?}",
|
||||
bus_pdas[i].0,
|
||||
|
||||
@@ -97,7 +97,7 @@ async fn setup_program_test_env() -> (BanksClient, Keypair, solana_program::hash
|
||||
&(Bus::discriminator() as u64).to_le_bytes(),
|
||||
Bus {
|
||||
id: i as u64,
|
||||
available_rewards: 250_000_000,
|
||||
rewards: 250_000_000,
|
||||
}
|
||||
.to_bytes(),
|
||||
]
|
||||
|
||||
@@ -56,7 +56,7 @@ async fn test_reset() {
|
||||
bs64::encode(&bus_account.data)
|
||||
);
|
||||
assert_eq!(bus.id as u8, i as u8);
|
||||
assert_eq!(bus.available_rewards, BUS_EPOCH_REWARDS);
|
||||
assert_eq!(bus.rewards, BUS_EPOCH_REWARDS);
|
||||
}
|
||||
|
||||
// Test treasury state
|
||||
@@ -136,7 +136,7 @@ async fn setup_program_test_env() -> (BanksClient, Keypair, Hash) {
|
||||
&(Bus::discriminator() as u64).to_le_bytes(),
|
||||
Bus {
|
||||
id: i as u64,
|
||||
available_rewards: 0,
|
||||
rewards: 0,
|
||||
}
|
||||
.to_bytes(),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user