Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dao serverside regtest #2447

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions core/src/main/java/bisq/core/btc/BaseCurrencyNetwork.java
Expand Up @@ -28,7 +28,7 @@ public enum BaseCurrencyNetwork {
BTC_MAINNET(MainNetParams.get(), "BTC", "MAINNET", "Bitcoin"),
BTC_TESTNET(TestNet3Params.get(), "BTC", "TESTNET", "Bitcoin"),
BTC_REGTEST(RegTestParams.get(), "BTC", "REGTEST", "Bitcoin"),
BTC_DAO_TESTNET(RegTestParams.get(), "BTC", "DAO_TESTNET", "Bitcoin"); // server side regtest
BTC_DAO_TESTNET(RegTestParams.get(), "BTC", "REGTEST", "Bitcoin"); // server side regtest

@Getter
private final NetworkParameters parameters;
Expand All @@ -47,19 +47,19 @@ public enum BaseCurrencyNetwork {
}

public boolean isMainnet() {
return "MAINNET".equals(network);
return "BTC_MAINNET".equals(name());
}

public boolean isTestnet() {
return "TESTNET".equals(network);
return "BTC_TESTNET".equals(name());
}

public boolean isDaoTestNet() {
return "DAO_TESTNET".equals(network);
return "BTC_DAO_TESTNET".equals(name());
}

public boolean isRegtest() {
return "REGTEST".equals(network);
return "BTC_REGTEST".equals(name());
}

public long getDefaultMinFeePerByte() {
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/bisq/core/dao/governance/param/Param.java
Expand Up @@ -100,9 +100,9 @@ public enum Param {
// but can be also a burner address if we prefer to burn the BTC
RECIPIENT_BTC_ADDRESS(BisqEnvironment.getBaseCurrencyNetwork().isMainnet() ?
"1BVxNn3T12veSK6DgqwU4Hdn7QHcDDRag7" : // mainnet
BisqEnvironment.getBaseCurrencyNetwork().isRegtest() ?
"2N5J6MyjAsWnashimGiNwoRzUXThsQzRmbv" : // regtest
"2N4mVTpUZAnhm9phnxB7VrHB4aBhnWrcUrV", // testnet
BisqEnvironment.getBaseCurrencyNetwork().isTestnet() ?
"2N4mVTpUZAnhm9phnxB7VrHB4aBhnWrcUrV" : // testnet
"mquz1zFmhs7iy8qJTkhY7C9bhJ5S3g8Xim", // regtest or DAO testnet (regtest)
ParamType.ADDRESS),

// Fee for activating an asset or re-listing after deactivation due lack of trade activity. Fee per day of trial period without activity checks.
Expand Down
Expand Up @@ -257,7 +257,6 @@ public void onParseTxsCompleteAfterBatchProcessing(Block block) {
}



///////////////////////////////////////////////////////////////////////////////////////////
// Private
///////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -279,18 +278,20 @@ private void publishMyProposal(ProposalType type) {
Coin fee = daoFacade.getProposalFee(daoFacade.getChainHeight());

if (type.equals(ProposalType.BONDED_ROLE)) {
final long requiredBond = proposalDisplay.bondedRoleTypeComboBox.getSelectionModel().getSelectedItem().getRequiredBond();
final long availableBalance = bsqWalletService.getAvailableBalance().value;
long requiredBond = proposalDisplay.bondedRoleTypeComboBox.getSelectionModel().getSelectedItem().getRequiredBond();
long availableBalance = bsqWalletService.getAvailableBalance().value;

if (requiredBond > availableBalance) {
final long missing = requiredBond - availableBalance;
long missing = requiredBond - availableBalance;
new Popup<>().warning(Res.get("dao.proposal.create.missingBsqFundsForBond",
bsqFormatter.formatCoinWithCode(missing)))
.actionButtonText(Res.get("dao.proposal.create.publish"))
.onAction(() -> {
showFeeInfoAndPublishMyProposal(proposal, transaction, miningFee, txSize, fee);
})
.show();
} else {
showFeeInfoAndPublishMyProposal(proposal, transaction, miningFee, txSize, fee);
}
} else {
showFeeInfoAndPublishMyProposal(proposal, transaction, miningFee, txSize, fee);
Expand Down Expand Up @@ -330,7 +331,6 @@ private void showFeeInfoAndPublishMyProposal(Proposal proposal, Transaction tran
}

private void doPublishMyProposal(Proposal proposal, Transaction transaction) {

busyLabel.setVisible(true);
busyAnimation.play();
makeProposalButton.setDisable(true);
Expand Down

This file was deleted.

Expand Up @@ -225,8 +225,8 @@ private void initializeGeneralOptions() {
@Override
public String toString(BaseCurrencyNetwork baseCurrencyNetwork) {
return baseCurrencyNetwork != null ?
(baseCurrencyNetwork.getCurrencyName() + "_" + baseCurrencyNetwork.getNetwork())
: "";
Res.get(baseCurrencyNetwork.name()) :
Res.get("na");
}

@Override
Expand Down