diff --git a/assets/src/main/java/bisq/asset/coins/PENG.java b/assets/src/main/java/bisq/asset/coins/PENG.java new file mode 100644 index 00000000000..df6025e40ec --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/PENG.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 PENG extends Coin { + + public PENG() { + super("PENG Coin", "PENG", new RegexAddressValidator("^[P][a-km-zA-HJ-NP-Z1-9]{33}$")); + } +} diff --git a/assets/src/main/resources/META-INF/services/bisq.asset.Asset b/assets/src/main/resources/META-INF/services/bisq.asset.Asset index 2a6cf1a7d54..7f2a053d3c7 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -67,6 +67,7 @@ bisq.asset.coins.Navcoin bisq.asset.coins.Neos bisq.asset.coins.Noir bisq.asset.coins.ParsiCoin +bisq.asset.coins.PENG bisq.asset.coins.Persona bisq.asset.coins.Pinkcoin bisq.asset.coins.PIVX diff --git a/assets/src/test/java/bisq/asset/coins/PENGTest.java b/assets/src/test/java/bisq/asset/coins/PENGTest.java new file mode 100644 index 00000000000..5850e28e905 --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/PENGTest.java @@ -0,0 +1,45 @@ +/* + * 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 PENGTest extends AbstractAssetTest { + + public PENGTest() { + super(new PENG()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("P9KqnVS9UpcJmLtCF1j4SV3fcccMuGEbhs"); + assertValidAddress("PUTXyY73s3HDvEzNJQekXMnjNjTrzFBzE2"); + assertValidAddress("PEfabj5DzRj6WBpc3jtVDorsVM5nddDxie"); + assertValidAddress("PAvXbSUAdCyd9MEtDPYYSmezmeLGL1HcjG"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("Pp9KqnVS9UpcJmLtCF1j4SV3fcccMuGEbhs"); + assertInvalidAddress("PqUTXyY73s3HDvEzNJQekXMnjNjTrzFBzE2"); + assertInvalidAddress("P8Efabj5DzRj6WBpc3jtVDorsVM5nddDxie"); + assertInvalidAddress("P9AvXbSUAdCyd9MEtDPYYSmezmeLGL1HcjG"); + } +}