From fbcc5ef9fec4a1b1581ea41b03d83f07da8514de Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Mon, 08 Jul 2024 16:16:21 +0800
Subject: [PATCH] 逻辑

---
 src/test/java/cc/mrbird/febs/ChainTest.java |  119 ++++++++---------------------------------------------------
 1 files changed, 17 insertions(+), 102 deletions(-)

diff --git a/src/test/java/cc/mrbird/febs/ChainTest.java b/src/test/java/cc/mrbird/febs/ChainTest.java
index 5f58130..136bc99 100644
--- a/src/test/java/cc/mrbird/febs/ChainTest.java
+++ b/src/test/java/cc/mrbird/febs/ChainTest.java
@@ -12,6 +12,7 @@
 //import cc.mrbird.febs.job.SystemTradeJob;
 import cc.mrbird.febs.dapp.service.impl.BscCoinContractEvent;
 import cc.mrbird.febs.dapp.service.impl.BscUsdtContractEvent;
+import cc.mrbird.febs.job.ProfitDailyJob;
 import cc.mrbird.febs.rabbit.producer.ChainProducer;
 import com.alibaba.fastjson.JSONObject;
 import org.junit.jupiter.api.Test;
@@ -32,106 +33,6 @@
 @SpringBootTest
 public class ChainTest {
 
-    @Test
-    public void balanceOfTest() {
-        ContractChainService instance = ChainService.getInstance(ChainEnum.BSC_TFC.name());
-
-        System.out.println(instance.balanceOf("0x0000000000000000000000000000000000000001"));
-    }
-
-//    @Autowired
-//    private SystemTradeJob systemTradeJob;
-//
-//    @Test
-//    public void transferPoolTest() {
-//        systemTradeJob.transferPoolVol();
-//    }
-//
-//
-//    @Test
-//    public void sourceUsdtTest() {
-//        systemTradeJob.sourcePoolUsdtOutLimit();
-//    }
-//
-//    @Test
-//    public void poolTest() {
-//        systemTradeJob.transferPoolVol();
-//    }
-
-    @Autowired
-    private DappOnlineTransferDao dappOnlineTransferDao;
-
-    @Test
-    public void transferTest() {
-        System.out.println(ChainService.getInstance(ChainEnum.BSC_USDT.name()).transfer(ChainEnum.BSC_USDT_SOURCE.getAddress(), BigDecimal.valueOf(6L)));
-    }
-
-    @Autowired
-    private ChainProducer chainProducer;
-
-    @Test
-    public void sendTransferTest() {
-        Map<String, String> map = new HashMap<>();
-        map.put("batchNo", "678o20scjg5stqf836");
-        map.put("type", "batch");
-        chainProducer.sendOnlineTransfer(JSONObject.toJSONString(map));
-    }
-
-    @Test
-    public void totalSupplyTest() {
-        System.out.println(ChainService.getInstance(ChainEnum.BSC_TFC.name()).blockNumber());
-    }
-
-//    @Test
-//    public void mineTest() {
-//        systemTradeJob.mineJob();
-//    }
-
-    @Autowired
-    private DappFundFlowDao dappFundFlowDao;
-
-    @Test
-    public void fundFlowInsertTest() {
-        DappFundFlowEntity rewardFlow = new DappFundFlowEntity(11L, BigDecimal.valueOf(1L), 4, 2, BigDecimal.ZERO);
-        rewardFlow.setFromHash("1");
-        dappFundFlowDao.insert(rewardFlow);
-    }
-
-    @Test
-    public void userBuyRewardTest() {
-        chainProducer.sendUserBuyReward(56L);
-    }
-
-    @Test
-    public void coinDecimalsTest() {
-        int decimals = ChainService.getInstance(ChainEnum.BSC_TFC.name()).decimals();
-        BigInteger bigInteger = new BigInteger("110000000000");
-        BigDecimal amount = new BigDecimal(bigInteger.toString()).divide(BigDecimal.TEN.pow(decimals), decimals, RoundingMode.HALF_DOWN);
-        System.out.println(amount);
-    }
-
-    @Autowired
-    private DappSystemService dappSystemService;
-
-    @Test
-    public void profitTest() {
-        dappSystemService.tradeProfitDistribute(31L);
-    }
-
-    @Test
-    public void nftBalanceTest() {
-        BigDecimal balance = ChainService.getInstance(ChainEnum.BSC_NFT_SDC.name()).balanceOf("0x971c09aa9735eb98459b17ec8b48932d24cbb931");
-        System.out.println(1);
-    }
-
-    @Test
-    public void nftTotalSupplyTest() {
-        BigInteger bigInteger = ChainService.getInstance(ChainEnum.BSC_NFT_SDC.name()).totalSupplyNFT();
-
-        int i = CardPeriod.ONE.recommendCnt(bigInteger.intValue());
-        System.out.println(i);
-    }
-
     @Autowired
     private BscUsdtContractEvent bscUsdtContractEvent;
 
@@ -140,9 +41,23 @@
 
     @Test
     public void chainListener(){
-//        ChainService.contractEventListener(new BigInteger("20686754"), new BigInteger("20686754"), bscUsdtContractEvent, ChainEnum.BSC_USDT.name());
+        ChainService.contractEventListener(new BigInteger("22934633"), new BigInteger("22934633"), bscUsdtContractEvent, ChainEnum.BSC_USDT.name());
 
-        ChainService.contractEventListener(new BigInteger("20687397"), new BigInteger("20687397"), bscCoinContractEvent, ChainEnum.BSC_TFC.name());
+//        ChainService.contractEventListener(new BigInteger("20860178"), new BigInteger("20860178"), bscCoinContractEvent, ChainEnum.BSC_TFC.name());
 
     }
+
+
+    @Test
+    public void wssChainListener(){
+        ChainService.wssContractEventListener(new BigInteger("22819014"), bscUsdtContractEvent, ChainEnum.BSC_USDT.name());
+    }
+
+//    @Autowired
+//    private ProfitDailyJob profitDailyJob;
+//
+//    @Test
+//    public void profitTest() {
+//        profitDailyJob.profitDailyJob();
+//    }
 }

--
Gitblit v1.9.1