mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-21 21:19:36 -04:00
rename all packages and other names from bisq to haveno
This commit is contained in:
parent
ab0b9e3b77
commit
1a1fb130c0
1775 changed files with 14575 additions and 16767 deletions
70
apitest/src/main/java/haveno/apitest/SmokeTestBitcoind.java
Normal file
70
apitest/src/main/java/haveno/apitest/SmokeTestBitcoind.java
Normal file
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* This file is part of Haveno.
|
||||
*
|
||||
* Haveno is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Haveno is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
|
||||
* License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package haveno.apitest;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static java.lang.String.format;
|
||||
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
import haveno.apitest.linux.BitcoinCli;
|
||||
|
||||
@Slf4j
|
||||
class SmokeTestBitcoind {
|
||||
|
||||
private final ApiTestConfig config;
|
||||
|
||||
public SmokeTestBitcoind(ApiTestConfig config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
public void run() throws IOException, InterruptedException {
|
||||
runBitcoinGetWalletInfo(); // smoke test bitcoin-cli
|
||||
String newBitcoinAddress = getNewAddress();
|
||||
generateToAddress(1, newBitcoinAddress);
|
||||
}
|
||||
|
||||
public void runBitcoinGetWalletInfo() throws IOException, InterruptedException {
|
||||
// This might be good for a sanity check to make sure the regtest data was installed.
|
||||
log.info("Smoke test bitcoin-cli getwalletinfo");
|
||||
BitcoinCli walletInfo = new BitcoinCli(config, "getwalletinfo").run();
|
||||
log.info("{}\n{}", walletInfo.getCommandWithOptions(), walletInfo.getOutput());
|
||||
log.info("balance str = {}", walletInfo.getOutputValueAsString("balance"));
|
||||
log.info("balance dbl = {}", walletInfo.getOutputValueAsDouble("balance"));
|
||||
log.info("keypoololdest long = {}", walletInfo.getOutputValueAsLong("keypoololdest"));
|
||||
log.info("paytxfee dbl = {}", walletInfo.getOutputValueAsDouble("paytxfee"));
|
||||
log.info("keypoolsize_hd_internal int = {}", walletInfo.getOutputValueAsInt("keypoolsize_hd_internal"));
|
||||
log.info("private_keys_enabled bool = {}", walletInfo.getOutputValueAsBoolean("private_keys_enabled"));
|
||||
log.info("hdseedid str = {}", walletInfo.getOutputValueAsString("hdseedid"));
|
||||
}
|
||||
|
||||
public String getNewAddress() throws IOException, InterruptedException {
|
||||
BitcoinCli newAddress = new BitcoinCli(config, "getnewaddress").run();
|
||||
log.info("{}\n{}", newAddress.getCommandWithOptions(), newAddress.getOutput());
|
||||
return newAddress.getOutput();
|
||||
}
|
||||
|
||||
public void generateToAddress(int blocks, String address) throws IOException, InterruptedException {
|
||||
String generateToAddressCmd = format("generatetoaddress %d \"%s\"", blocks, address);
|
||||
BitcoinCli generateToAddress = new BitcoinCli(config, generateToAddressCmd).run();
|
||||
// Return value is an array of TxIDs.
|
||||
log.info("{}\n{}", generateToAddress.getCommandWithOptions(), generateToAddress.getOutputValueAsStringArray());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue