fix
Helius
2021-11-30 c13c98374281a6316348979841a2fb249575ac26
src/test/java/com/xcong/excoin/TradeTest.java
@@ -1,16 +1,24 @@
package com.xcong.excoin;
import cn.hutool.crypto.SecureUtil;
import com.xcong.excoin.modules.blackchain.service.Trc20Service;
import com.xcong.excoin.modules.blackchain.service.TrxUsdtUpdateService;
import com.xcong.excoin.modules.coin.dao.OrderCoinsDao;
import com.xcong.excoin.modules.coin.entity.OrderCoinsEntity;
import com.xcong.excoin.modules.coin.service.OrderCoinService;
import com.xcong.excoin.rabbit.consumer.UsdtUpdateConsumer;
import com.xcong.excoin.rabbit.producer.UsdtUpdateProducer;
import com.xcong.excoin.trade.CoinTrader;
import com.xcong.excoin.utils.CoinTypeConvert;
import com.xcong.excoin.utils.RedisUtils;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.tron.trident.core.ApiWrapper;
import org.tron.trident.core.contract.Contract;
import org.tron.trident.core.contract.Trc20Contract;
import javax.annotation.Resource;
import java.math.BigDecimal;
@@ -36,13 +44,49 @@
        redisUtils.set("GBZ_NEW_PRICE",new BigDecimal("12.33"));
    }
    public static void main(String[] args) throws InterruptedException {
        String s = SecureUtil.md5("330021");
        System.out.println(s);
    }
//    public static void main(String[] args) throws InterruptedException {
//        String s = SecureUtil.md5("330021");
//        System.out.println(s);
//    }
    @Test
    public void gbz() {
        System.out.println(redisUtils.getString(CoinTypeConvert.convertToKey("GBZ"+"/USDT")));
    }
    @Autowired
    private UsdtUpdateConsumer usdtUpdateConsumer;
    @Resource
    TrxUsdtUpdateService trxUsdtUpdateService;
    @Test
    public void xccTest() {
        String content = "{\"address\":\"TGq1DCMs1bR9pA9fwj2bKZwNWRyWZykJBZ\",\"balance\":10000,\"hash\":\"0563c844e00ded7a2851276e06240efd06ba00468450ab586dd05f0d686aa5a5\",\"symbol\":\"XCC_TRC20\"}";
//        usdtUpdateConsumer.doSomething(content);
        trxUsdtUpdateService.poolByAddress("TGq1DCMs1bR9pA9fwj2bKZwNWRyWZykJBZ");
//        ApiWrapper wrapper = ApiWrapper.ofMainnet("af4913d8462ca83e0a2df587072e42ec565bc26f6bec0724d1bf2e80d4c0bcb7", Trc20Service.API_KEY);
//        Contract trc20Contract = wrapper.getContract("TL2pea32CTtxJ48pJmnLQuoRHeoX79dLCT");
//        Trc20Contract token =  new Trc20Contract(trc20Contract, "TZ5sZBLU5pdZbqN56rVsUEQuRHzYGRSY8a", wrapper);
//
//        System.out.println(token.balanceOf("TZ5sZBLU5pdZbqN56rVsUEQuRHzYGRSY8a"));;
    }
    @Autowired
    private UsdtUpdateProducer usdtUpdateProducer;
    @Test
    public void blockTest() {
//        usdtUpdateProducer.sendTrc20BlockMsg("35908596");
        trxUsdtUpdateService.monitorCoinListener(35908596L);
    }
    public static void main(String[] args) {
    }
}