Skip to content

Commit

Permalink
Lock and extract
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge committed Sep 21, 2023
1 parent 96008a8 commit 0d649fe
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions token/program-2022-test/tests/transfer_fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
mod program_test;
use {
program_test::{TestContext, TokenContext},
solana_program::epoch_schedule::EpochSchedule,
solana_program_test::tokio,
solana_sdk::{
instruction::InstructionError, program_option::COption, pubkey::Pubkey, signature::Signer,
Expand Down Expand Up @@ -280,17 +279,14 @@ async fn set_fee() {
.unwrap();

// warp to first normal slot to easily calculate epochs
let EpochSchedule {
first_normal_slot,
slots_per_epoch,
..
} = context
.context
.lock()
.await
.genesis_config()
.epoch_schedule
.clone();
let (first_normal_slot, slots_per_epoch) = {
let context = context.context.lock().await;
(
context.epoch_schedule.first_normal_slot,

Check failure on line 285 in token/program-2022-test/tests/transfer_fee.rs

View workflow job for this annotation

GitHub Actions / clippy

no field `epoch_schedule` on type `solana_program_test::tokio::sync::MutexGuard<'_, solana_program_test::ProgramTestContext>`
context.epoch_schedule.slots_per_epoch,

Check failure on line 286 in token/program-2022-test/tests/transfer_fee.rs

View workflow job for this annotation

GitHub Actions / clippy

no field `epoch_schedule` on type `solana_program_test::tokio::sync::MutexGuard<'_, solana_program_test::ProgramTestContext>`
)
};

context
.context
.lock()
Expand Down

0 comments on commit 0d649fe

Please sign in to comment.