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

List bitcoin rebooted asset #1911

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
41 changes: 41 additions & 0 deletions assets/src/main/java/bisq/asset/coins/BitcoinRebooted.java
@@ -0,0 +1,41 @@
/*
* This file is part of Bisq.
*
* Bisq 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.
*
* Bisq 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 Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.asset.coins;

import bisq.asset.AddressValidationResult;
import bisq.asset.AddressValidator;
import bisq.asset.Coin;

public class BitcoinRebooted extends Coin {

public BitcoinRebooted() {
super("Bitcoin Rebooted", "BOOT", new BitcoinRebootedAddressValidator());
}


public static class BitcoinRebootedAddressValidator implements AddressValidator {

@Override
public AddressValidationResult validate(String address) {
if (!address.startsWith("R"))
return AddressValidationResult.invalidAddress("", "validation.altcoin.BitcoinRebootedAddressesNotSupported");

return AddressValidationResult.validAddress();
}
}
}
Expand Up @@ -14,6 +14,7 @@ bisq.asset.coins.BitcoinClashic
bisq.asset.coins.BitcoinCore
bisq.asset.coins.BitcoinGold
bisq.asset.coins.BitcoinInstant
bisq.asset.coins.BitcoinRebooted
bisq.asset.coins.Bitcoin$Mainnet
bisq.asset.coins.Bitcoin$Regtest
bisq.asset.coins.Bitcoin$Testnet
Expand Down
43 changes: 43 additions & 0 deletions assets/src/test/java/bisq/asset/coins/BitcoinRebootedTest.java
@@ -0,0 +1,43 @@
/*
* This file is part of Bisq.
*
* Bisq 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.
*
* Bisq 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 Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.asset.coins;

import bisq.asset.AbstractAssetTest;

import org.junit.Test;

public class BitcoinRebootedTest extends AbstractAssetTest {

public BitcoinRebootedTest() {
super(new BitcoinRebooted());
}

@Test
public void testValidAddresses() {
assertValidAddress("RJ2qrnqG4jwDzjDpKCykA1Lb1DdbAJ9EGL");
assertValidAddress("RCeR3TuB1jNUpnJZd8NWbxG85z4TtXodow");
}

@Test
public void testInvalidAddresses() {
assertInvalidAddress("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhem");
assertInvalidAddress("38NwrYsD1HxQW5zfLT0QcUUXGMPvQgzTSn");
assertInvalidAddress("8tP9rh3SH6n9cSLmV22vnSNNw56LKGpLrB");
assertInvalidAddress("8Zbvjr");
}
}