Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Restore wait_for_nonzero_fees to TestValidatorGenesis::start_with_mint_address #23160

Merged
merged 1 commit into from
Feb 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions test-validator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,15 @@ impl TestValidatorGenesis {
mint_address: Pubkey,
socket_addr_space: SocketAddrSpace,
) -> Result<TestValidator, Box<dyn std::error::Error>> {
TestValidator::start(mint_address, self, socket_addr_space)
TestValidator::start(mint_address, self, socket_addr_space).map(|test_validator| {
let runtime = tokio::runtime::Builder::new_current_thread()
.enable_io()
.enable_time()
.build()
.unwrap();
runtime.block_on(test_validator.wait_for_nonzero_fees());
test_validator
})
}

/// Start a test validator
Expand All @@ -404,18 +412,9 @@ impl TestValidatorGenesis {
socket_addr_space: SocketAddrSpace,
) -> (TestValidator, Keypair) {
let mint_keypair = Keypair::new();
match TestValidator::start(mint_keypair.pubkey(), self, socket_addr_space) {
Ok(test_validator) => {
let runtime = tokio::runtime::Builder::new_current_thread()
.enable_io()
.enable_time()
.build()
.unwrap();
runtime.block_on(test_validator.wait_for_nonzero_fees());
(test_validator, mint_keypair)
}
Err(err) => panic!("Test validator failed to start: {}", err),
}
self.start_with_mint_address(mint_keypair.pubkey(), socket_addr_space)
.map(|test_validator| (test_validator, mint_keypair))
.unwrap_or_else(|err| panic!("Test validator failed to start: {}", err))
}

pub async fn start_async(&self) -> (TestValidator, Keypair) {
Expand Down