Skip to content

Commit

Permalink
Restore wait_for_nonzero_fees to TestValidatorGenesis::start_with_min…
Browse files Browse the repository at this point in the history
…t_address
  • Loading branch information
Tyera Eulberg authored and mvines committed Feb 16, 2022
1 parent 527f62c commit 64f5e57
Showing 1 changed file with 12 additions and 13 deletions.
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

0 comments on commit 64f5e57

Please sign in to comment.