diff --git a/src/main/java/bisq/asset/coins/QuantumResistantLedger.java b/src/main/java/bisq/asset/coins/QuantumResistantLedger.java new file mode 100644 index 0000000..479cbc0 --- /dev/null +++ b/src/main/java/bisq/asset/coins/QuantumResistantLedger.java @@ -0,0 +1,28 @@ +/* + * 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 . + */ + +package bisq.asset.coins; + +import bisq.asset.Coin; +import bisq.asset.RegexAddressValidator; + +public class QuantumResistantLedger extends Coin { + + public QuantumResistantLedger() { + super("Quantum Resistant Ledger", "QRL", new RegexAddressValidator("^(Q)[0-9A-Za-z]{78}$")); + } +} diff --git a/src/main/resources/META-INF/services/bisq.asset.Asset b/src/main/resources/META-INF/services/bisq.asset.Asset index 6474d48..70ba052 100644 --- a/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/src/main/resources/META-INF/services/bisq.asset.Asset @@ -94,6 +94,7 @@ bisq.asset.coins.PIVX bisq.asset.coins.PostCoin bisq.asset.coins.Pranacoin bisq.asset.coins.PRiVCY +bisq.asset.coins.QuantumResistantLedger bisq.asset.coins.ReddCoin bisq.asset.coins.Ringo bisq.asset.coins.Roicoin diff --git a/src/test/java/bisq/asset/coins/QuantumResistantLedgerTest.java b/src/test/java/bisq/asset/coins/QuantumResistantLedgerTest.java new file mode 100644 index 0000000..03d702b --- /dev/null +++ b/src/test/java/bisq/asset/coins/QuantumResistantLedgerTest.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 . + */ + +package bisq.asset.coins; + +import bisq.asset.AbstractAssetTest; + +import org.junit.Test; + +public class QuantumResistantLedgerTest extends AbstractAssetTest { + + public QuantumResistantLedgerTest() { + super(new QuantumResistantLedger()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("Q01070050d31c7f123995f097bc98209e9231d663dc26e06085df55dc2f6afe3c2cd62e8271a6bd"); + assertValidAddress("QabcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890000000000000000"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("q01070050d31c7f123995f097bc98209e9231d663dc26e06085df55dc2f6afe3c2cd62e8271a6bd"); + assertInvalidAddress("q#1070050d31c7f123995f097bc98209e9231d663dc26e06085df55dc2f6afe3c2cd62e8271a6bd"); + assertInvalidAddress("Q01070050d31c7f123995f097bc98209e9231d663dc26e06085df55dc2f6afe3c2cd62e8271a6b"); + assertInvalidAddress("Q01070050d31c7f123995f097bc98209e9231d663dc26e06085df55dc2f6afe3c2cd62e8271a6bdfa"); + } +}