4242import org .tron .api .GrpcAPI .AssetIssueList ;
4343import org .tron .api .GrpcAPI .BlockList ;
4444import org .tron .api .GrpcAPI .ExchangeList ;
45+ import org .tron .api .GrpcAPI .NumberMessage ;
4546import org .tron .api .GrpcAPI .ProposalList ;
4647import org .tron .common .BaseTest ;
4748import org .tron .common .crypto .ECKey ;
@@ -531,6 +532,16 @@ public void getPaginatedProposalList() {
531532
532533 }
533534
535+ @ Test
536+ public void testGetProposalById () {
537+ buildProposal ();
538+ //
539+ Proposal proposal = wallet .getProposalById (ByteString .copyFrom (ByteArray .fromLong (1L )));
540+ Assert .assertNotNull (proposal );
541+ proposal = wallet .getProposalById (ByteString .copyFrom (ByteArray .fromLong (3L )));
542+ Assert .assertNull (proposal );
543+ }
544+
534545 @ Test
535546 public void getPaginatedExchangeList () {
536547 buildExchange ();
@@ -541,6 +552,24 @@ public void getPaginatedExchangeList() {
541552 exchangeList .getExchangesList ().get (1 ).getCreatorAddress ().toStringUtf8 ());
542553 }
543554
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+
544573 @ Test
545574 public void getBlock () {
546575 GrpcAPI .BlockReq req = GrpcAPI .BlockReq .getDefaultInstance ();
@@ -567,6 +596,12 @@ public void getBlock() {
567596 assertEquals (block , wallet .getBlock (req ));
568597 }
569598
599+ @ Test
600+ public void testGetNextMaintenanceTime () {
601+ NumberMessage numberMessage = wallet .getNextMaintenanceTime ();
602+ Assert .assertEquals (0 , numberMessage .getNum ());
603+ }
604+
570605 //@Test
571606 public void testChainParameters () {
572607
0 commit comments