From ea06e68fdccef91e180449286e912277800e3d51 Mon Sep 17 00:00:00 2001
From: wzy <wzy19931122ai@163.com>
Date: Mon, 04 Jan 2021 23:12:26 +0800
Subject: [PATCH] modify
---
src/test/java/com/xcong/excoin/GuijiTest.java | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/test/java/com/xcong/excoin/GuijiTest.java b/src/test/java/com/xcong/excoin/GuijiTest.java
index 8babbbe..4ef29a9 100644
--- a/src/test/java/com/xcong/excoin/GuijiTest.java
+++ b/src/test/java/com/xcong/excoin/GuijiTest.java
@@ -23,7 +23,7 @@
import lombok.extern.slf4j.Slf4j;
@Slf4j
-@SpringBootTest
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class GuijiTest {
private static final BigDecimal LIMIT = new BigDecimal("50");
@@ -40,6 +40,16 @@
private MemberCoinAddressDao memberCoinAddressDao;
@Resource
private MemberWalletCoinDao memberWalletCoinDao;
+
+ @Test
+ public void poolTest() {
+ String address = "0x19177bfd062852a4398cae3ab701a82a6b959bf2";
+ EthService ethService = new EthService();
+ BigDecimal balance = ethService.tokenGetBalance(address);
+ BigDecimal eth = EthService.getEthBlance(address);
+
+ log.info("--->{}, {}", balance, eth);
+ }
public void pool() throws ExecutionException, InterruptedException {
//List<MemberCoinChargeEntity> list = memberCoinChargeDao.selectAllBySymbolAndTag(CoinTypeEnum.USDT.name(), "ERC20", 1);
@@ -83,7 +93,7 @@
usdtStr = usdtStr.substring(0, usdtStr.lastIndexOf("."));
}
- String hash = ethService.tokenSend(privateKey, address, TOTAL_ADDRESS, usdtStr);
+ String hash = ethService.tokenSend(privateKey, address, TOTAL_ADDRESS, usdtStr,null);
System.out.println("归集:"+hash);
if (StrUtil.isNotBlank(hash)) {
// 归集成功更新状态 先保存本次的hash值,待交易成功后再更新
@@ -91,7 +101,7 @@
memberCoinChargeDao.updateById(coinCharge);
}
} else {
- String hash = ethService.ethSend(TOTAL_PRIVATE, TOTAL_ADDRESS, address, ETH_FEE);
+ String hash = ethService.ethSend(TOTAL_PRIVATE, TOTAL_ADDRESS, address, ETH_FEE,null);
System.out.println("转手续费:"+hash);
}
}
@@ -106,7 +116,7 @@
String toAddress = "0xbc6050a2898511bda406660267e6667448070552";
EthService ethService = new EthService();
try {
- String hash = ethService.ethSend(TOTAL_PRIVATE, TOTAL_ADDRESS, toAddress, "0.0032");
+ String hash = ethService.ethSend(TOTAL_PRIVATE, TOTAL_ADDRESS, toAddress, "0.0032",null);
System.out.println("转手续费:"+hash);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
--
Gitblit v1.9.1