Skip to content

Commit 703cf87

Browse files
committed
add test case of WalletTest
1 parent 2548300 commit 703cf87

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

framework/src/test/java/org/tron/core/WalletTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,24 @@ public void getPaginatedExchangeList() {
552552
exchangeList.getExchangesList().get(1).getCreatorAddress().toStringUtf8());
553553
}
554554

555+
@Test
556+
public void testGetExchangeById() {
557+
buildExchange();
558+
//
559+
Exchange exchange = wallet.getExchangeById(ByteString.copyFrom(ByteArray.fromLong(1L)));
560+
Assert.assertNotNull(exchange);
561+
exchange = wallet.getExchangeById(ByteString.copyFrom(ByteArray.fromLong(3L)));
562+
Assert.assertNull(exchange);
563+
}
564+
565+
@Test
566+
public void testGetExchangeList() {
567+
buildExchange();
568+
//
569+
ExchangeList exchangeList = wallet.getExchangeList();
570+
Assert.assertEquals(2, exchangeList.getExchangesCount());
571+
}
572+
555573
@Test
556574
public void getBlock() {
557575
GrpcAPI.BlockReq req = GrpcAPI.BlockReq.getDefaultInstance();

0 commit comments

Comments
 (0)