Update sample test code

This commit is contained in:
Nex 2018-09-12 01:02:56 +08:00
parent bdcc333b7d
commit 1eac2150b1

View File

@ -4,7 +4,7 @@ import bdchain.api.grpc.GetLedgersResponse;
import bdchain.api.grpc.TransactionType;
public class Test {
public static void main(String[] args) {
public static void main(String[] args) throws InterruptedException {
final String ledger = "test";
final int block_number = 1;
@ -21,6 +21,7 @@ public class Test {
tlClient
.sendTransaction(ledger, TransactionType.RECORD, "0x0", "0x1", "data".getBytes())
.getHash());
tlClient.shutdown();
AccountingChainClient acClient = new AccountingChainClient("localhost", 8013);
System.out.println(acClient.blockNumber(ledger).getBlockNumber());
@ -33,5 +34,6 @@ public class Test {
acClient.getTransactionByBlockNumberAndIndex(ledger, block_number, index).toString());
System.out.println(
acClient.getTransactionByBlockHashAndIndex(ledger, block_hash, index).toString());
acClient.shutdown();
}
}