From bf1fe469e4e04a77032cab3c12ce0305c333b44a Mon Sep 17 00:00:00 2001 From: trustfarm-vr1 Date: Wed, 24 Apr 2019 22:48:29 +0900 Subject: [PATCH] List Trust Eth reOrigin (TEO) Author: trustfarm.info@gmail.com Date: Thu April 24 23:00 GMT+9 List Trust Eth reOrigin (TEO) Official project URL: https://forum.tao.foundation Official block explorer URL: https://explorer.tao.foundation , https://explorer2.tao.foundation Official git repository URL: https://github.com/tao-foundation --- .../src/main/java/bisq/asset/coins/TEO.java | 28 ++++++++++++ .../META-INF/services/bisq.asset.Asset | 1 + .../test/java/bisq/asset/coins/TEOTest.java | 45 +++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 assets/src/main/java/bisq/asset/coins/TEO.java create mode 100644 assets/src/test/java/bisq/asset/coins/TEOTest.java diff --git a/assets/src/main/java/bisq/asset/coins/TEO.java b/assets/src/main/java/bisq/asset/coins/TEO.java new file mode 100644 index 0000000000..e36581e2da --- /dev/null +++ b/assets/src/main/java/bisq/asset/coins/TEO.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 TEO extends Coin { + + public TEO() { + super("Trust Ether reOrigin", "TEO", new RegexAddressValidator("^0x[0-9a-fA-F]{40}$")); + } +} 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 5a141f856f..69d88c5e33 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -82,6 +82,7 @@ bisq.asset.coins.SpaceCash bisq.asset.coins.Spectrecoin bisq.asset.coins.Starwels bisq.asset.coins.SUB1X +bisq.asset.coins.TEO bisq.asset.coins.TurtleCoin bisq.asset.coins.UnitedCommunityCoin bisq.asset.coins.Unobtanium diff --git a/assets/src/test/java/bisq/asset/coins/TEOTest.java b/assets/src/test/java/bisq/asset/coins/TEOTest.java new file mode 100644 index 0000000000..66f67b605f --- /dev/null +++ b/assets/src/test/java/bisq/asset/coins/TEOTest.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 TEOTest extends AbstractAssetTest { + + public TEOTest() { + super(new TEO()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("0x8d1ba0497c3e3db17143604ab7f5e93a3cbac68b"); + assertValidAddress("0x23c9c5ae8c854e9634a610af82924a5366a360a3"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress(""); + assertInvalidAddress("8d1ba0497c3e3db17143604ab7f5e93a3cbac68b"); + assertInvalidAddress("0x8d1ba0497c3e3db17143604ab7f5e93a3cbac68"); + assertInvalidAddress("0x8d1ba0497c3e3db17143604ab7f5e93a3cbac68k"); + assertInvalidAddress("098d1ba0497c3e3db17143604ab7f5e93a3cbac68b"); + assertInvalidAddress("098d1ba0497c3e3db17143604ab7f5e93a3cbac68b"); + } +}