From c05b72f2154b514a18245dd5e143b21f7873dbdd Mon Sep 17 00:00:00 2001 From: jmacxx <47253594+jmacxx@users.noreply.github.com> Date: Wed, 29 Sep 2021 10:22:15 -0500 Subject: [PATCH 1/2] add USDT-E --- .../main/java/bisq/asset/tokens/TetherUSDERC20.java | 11 +++++++++++ .../main/resources/META-INF/services/bisq.asset.Asset | 1 + 2 files changed, 12 insertions(+) create mode 100644 assets/src/main/java/bisq/asset/tokens/TetherUSDERC20.java diff --git a/assets/src/main/java/bisq/asset/tokens/TetherUSDERC20.java b/assets/src/main/java/bisq/asset/tokens/TetherUSDERC20.java new file mode 100644 index 00000000000..cb57361a1f4 --- /dev/null +++ b/assets/src/main/java/bisq/asset/tokens/TetherUSDERC20.java @@ -0,0 +1,11 @@ +package bisq.asset.tokens; + +import bisq.asset.Erc20Token; + +public class TetherUSDERC20 extends Erc20Token { + public TetherUSDERC20() { + // If you add a new USDT variant or want to change this ticker symbol you should also look here: + // core/src/main/java/bisq/core/provider/price/PriceProvider.java:getAll() + super("Tether USD (ERC20)", "USDT-E"); + } +} 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 4fb5ae60f46..0599d7622d9 100644 --- a/assets/src/main/resources/META-INF/services/bisq.asset.Asset +++ b/assets/src/main/resources/META-INF/services/bisq.asset.Asset @@ -124,6 +124,7 @@ bisq.asset.coins.ZeroClassic bisq.asset.tokens.AugmintEuro bisq.asset.tokens.DaiStablecoin bisq.asset.tokens.EtherStone +bisq.asset.tokens.TetherUSDERC20 bisq.asset.tokens.TrueUSD bisq.asset.tokens.USDCoin bisq.asset.tokens.VectorspaceAI From 4a2e7fdbfa490c2ba5a598c226661e89d845ce0e Mon Sep 17 00:00:00 2001 From: jmacxx <47253594+jmacxx@users.noreply.github.com> Date: Sat, 2 Oct 2021 18:41:13 -0500 Subject: [PATCH 2/2] add TetherUSDERC20Test --- .../bisq/asset/tokens/TetherUSDERC20Test.java | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 assets/src/test/java/bisq/asset/tokens/TetherUSDERC20Test.java diff --git a/assets/src/test/java/bisq/asset/tokens/TetherUSDERC20Test.java b/assets/src/test/java/bisq/asset/tokens/TetherUSDERC20Test.java new file mode 100644 index 00000000000..f9b923e5662 --- /dev/null +++ b/assets/src/test/java/bisq/asset/tokens/TetherUSDERC20Test.java @@ -0,0 +1,42 @@ +/* + * 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.tokens; + +import bisq.asset.AbstractAssetTest; + +import org.junit.Test; + +public class TetherUSDERC20Test extends AbstractAssetTest { + + public TetherUSDERC20Test() { + super(new DaiStablecoin()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("0x2a65Aca4D5fC5B5C859090a6c34d164135398226"); + assertValidAddress("2a65Aca4D5fC5B5C859090a6c34d164135398226"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("0x2a65Aca4D5fC5B5C859090a6c34d1641353982266"); + assertInvalidAddress("0x2a65Aca4D5fC5B5C859090a6c34d16413539822g"); + assertInvalidAddress("2a65Aca4D5fC5B5C859090a6c34d16413539822g"); + } +}