diff --git a/assets/src/main/java/bisq/asset/coins/Iridium.java b/assets/src/main/java/bisq/asset/coins/Iridium.java new file mode 100644 index 00000000000..f1263e81d5c --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/Iridium.java @@ -0,0 +1,25 @@ +/* + * 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 Iridium extends Coin { + public Iridium() { + super("Iridium", "IRD", new RegexAddressValidator("^ir[1-9A-Za-z^OIl]{95}")); + } +} 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 034ed33f5cf..fe76d5ae777 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -23,6 +23,7 @@ bisq.asset.coins.Dragonglass bisq.asset.coins.Ether bisq.asset.coins.EtherClassic bisq.asset.coins.Gridcoin +bisq.asset.coins.Iridium bisq.asset.coins.Horizen bisq.asset.coins.Kekcoin bisq.asset.coins.Litecoin diff --git a/assets/src/test/java/bisq/asset/coins/IridiumTest.java b/assets/src/test/java/bisq/asset/coins/IridiumTest.java new file mode 100644 index 00000000000..c9572aaaace --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/IridiumTest.java @@ -0,0 +1,40 @@ +/* + * 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 IridiumTest extends AbstractAssetTest { + public IridiumTest() { + super(new Iridium()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("ir2oHYW7MbBQuMzTELg5o6FRqXNwWCU1wNzFsJG3VUCT9qMwayNsdwaQ85NHC3vLFSQ1eWtAPsYpvV4tXpnXKM9M377BW5KQ4"); + assertValidAddress("ir2PK6y3hjq9wLqdTQnPQ2FXhCJqJ1pKXNXezZUqeUWbTb3T74Xqiy1Yqwtkgri934C1E9Ba2quJDDh75nxDqEQj1K8i9DQXf"); + assertValidAddress("ir3steHWr1FRbtpjWWCAaxhzNggzJK6tqBy3qFw32YGV4CJdRsgYrpLifA7ivGdgZGNRKbRtYUp9GKvxnFSRFWTt2XuWunRYb"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("ir2oHYW7MbBQuMzTELg5o6FRqXNwWCU1wNzFsJG3VUCT9qMwayNsdwaQ85NHC3vLFSQ1eWtAPsYpvV4tXpnXKM9M377BW5KQ4t"); + assertInvalidAddress("ir2PK6y3hjq9wLqdTQnPQ2FXhCJqJ1pKXNXezZUqeUWb#Tb3T74Xqiy1Yqwtkgri934C1E9Ba2quJDDh75nxDqEQj1K8i9DQXf"); + assertInvalidAddress(""); + } +}