Update APIs returning futures
This commit is contained in:
@@ -12,28 +12,28 @@ public class Test {
|
||||
final int index = 0;
|
||||
|
||||
TransactionLedgerClient tlClient = new TransactionLedgerClient("localhost", 8004);
|
||||
System.out.println(tlClient.createLedger(ledger).getOk());
|
||||
GetLedgersResponse r = tlClient.getLedgers();
|
||||
System.out.println(tlClient.createLedgerSync(ledger).getOk());
|
||||
GetLedgersResponse r = tlClient.getLedgersSync();
|
||||
for (int i = 0; i < r.getLedgersCount(); i++) {
|
||||
System.out.println(r.getLedgers(i));
|
||||
}
|
||||
System.out.println(
|
||||
tlClient
|
||||
.sendTransaction(ledger, TransactionType.RECORD, "0x0", "0x1", "data".getBytes())
|
||||
.sendTransactionSync(ledger, TransactionType.RECORD, "0x0", "0x1", "data".getBytes())
|
||||
.getHash());
|
||||
tlClient.shutdown();
|
||||
|
||||
AccountingChainClient acClient = new AccountingChainClient("localhost", 8013);
|
||||
System.out.println(acClient.blockNumber(ledger).getBlockNumber());
|
||||
System.out.println(acClient.getBlockByNumber(ledger, block_number, false).toString());
|
||||
System.out.println(acClient.getBlockByNumber(ledger, block_number, true).toString());
|
||||
System.out.println(acClient.getBlockByHash(ledger, block_hash, false).toString());
|
||||
System.out.println(acClient.getBlockByHash(ledger, block_hash, true).toString());
|
||||
System.out.println(acClient.getTransactionByHash(ledger, "0x0").toString());
|
||||
System.out.println(acClient.blockNumberSync(ledger).getBlockNumber());
|
||||
System.out.println(acClient.getBlockByNumberSync(ledger, block_number, false).toString());
|
||||
System.out.println(acClient.getBlockByNumberSync(ledger, block_number, true).toString());
|
||||
System.out.println(acClient.getBlockByHashSync(ledger, block_hash, false).toString());
|
||||
System.out.println(acClient.getBlockByHashSync(ledger, block_hash, true).toString());
|
||||
System.out.println(acClient.getTransactionByHashSync(ledger, "0x0").toString());
|
||||
System.out.println(
|
||||
acClient.getTransactionByBlockNumberAndIndex(ledger, block_number, index).toString());
|
||||
acClient.getTransactionByBlockNumberAndIndexSync(ledger, block_number, index).toString());
|
||||
System.out.println(
|
||||
acClient.getTransactionByBlockHashAndIndex(ledger, block_hash, index).toString());
|
||||
acClient.getTransactionByBlockHashAndIndexSync(ledger, block_hash, index).toString());
|
||||
acClient.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user