package com.wuban.tron.explore.dao;

import com.wuban.tron.explore.BaseTest;
import com.wuban.tron.explore.entity.Transaction;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

class TransactionRepositoryTest extends BaseTest {

    @Autowired
    private TransactionRepository transactionRepository;

    @BeforeEach
    void setUp() {

    }

    @Test
    void testSelectListByAddress() {
        String address = "41af2f523da93df32ca91bf387c5cc95b02c1a6635";
        long t = 1600124514272L;
       /* TransactionExample example = new TransactionExample();
        example.createCriteria().andOwnerAddressEqualTo(address).andTimestampEqualTo(t);*/
        List<Transaction> list = this.transactionRepository.selectListByAddress(address, t);
        System.out.println(list.size() + "***************************"+list.toString());
    }

    @Test
    void test() {
       /* String hexString = "416c4858d8d3435d278a34146d49dd7e126879ba0d";
        String base58check = WalletApi.encode58Check(ByteArray.fromHexString(hexString));
        System.out.println(base58check);*/
    }

}