From 1c9d0521caf9dd9eae07597d86afdf56f695bc0d Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 16 Aug 2021 08:21:48 +0000 Subject: [PATCH] Revert `TestValidatorGenesis::start()` to v1.7.8 signature; add `TestValidatorGenesis::start_with_socket_addr_space()` (#19241) (cherry picked from commit 3e5ba594e076b9a7d56e5907aaa15deb06c29493) Co-authored-by: Michael Vines --- core/src/test_validator.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/core/src/test_validator.rs b/core/src/test_validator.rs index fcd3f0c073..86fcfd738e 100644 --- a/core/src/test_validator.rs +++ b/core/src/test_validator.rs @@ -275,7 +275,20 @@ impl TestValidatorGenesis { /// created at genesis. /// /// This function panics on initialization failure. - pub fn start(&self, socket_addr_space: SocketAddrSpace) -> (TestValidator, Keypair) { + pub fn start(&self) -> (TestValidator, Keypair) { + self.start_with_socket_addr_space(SocketAddrSpace::new(/*allow_private_addr=*/ true)) + } + + /// Start a test validator with the given `SocketAddrSpace` + /// + /// Returns a new `TestValidator` as well as the keypair for the mint account that will receive tokens + /// created at genesis. + /// + /// This function panics on initialization failure. + pub fn start_with_socket_addr_space( + &self, + socket_addr_space: SocketAddrSpace, + ) -> (TestValidator, Keypair) { let mint_keypair = Keypair::new(); TestValidator::start(mint_keypair.pubkey(), self, socket_addr_space) .map(|test_validator| (test_validator, mint_keypair))