From 91be741e876b1a4f07057dcd58461744d4341f62 Mon Sep 17 00:00:00 2001 From: Nex Date: Tue, 23 Apr 2019 23:10:32 +0800 Subject: [PATCH] Update tests --- src/main/proto | 2 +- .../api/AccountingChainClientTests.java | 20 ++++++------------- .../api/TransactionLedgerClientTests.java | 2 +- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/main/proto b/src/main/proto index d279291..70d4bb0 160000 --- a/src/main/proto +++ b/src/main/proto @@ -1 +1 @@ -Subproject commit d2792917e7ac2eabb02c14117544e40f99e278fb +Subproject commit 70d4bb0f0c3a88f2ef459dfabdf521bf941dd667 diff --git a/src/test/java/bdchain/api/AccountingChainClientTests.java b/src/test/java/bdchain/api/AccountingChainClientTests.java index 7678e2d..a14ef57 100644 --- a/src/test/java/bdchain/api/AccountingChainClientTests.java +++ b/src/test/java/bdchain/api/AccountingChainClientTests.java @@ -23,14 +23,11 @@ class AccountingChainClientTests { private static final String ledger = "test"; private static final int blockNumber = 2018; - private static final String blockHashStr = - "deadc0dedeadc0dedeadc0dedeadc0dedeadc0dedeadc0dedeadc0dedeadc0de"; + private static final String blockHashStr = "deadc0dedeadc0dedeadc0dedeadc0dedeadc0de"; private static final ByteString blockHash = ByteString.copyFrom(Utils.hexStringToByteArray(blockHashStr)); private static final ByteString parentHash = - ByteString.copyFrom( - Utils.hexStringToByteArray( - "babefacebabefacebabefacebabefacebabefacebabefacebabefacebabeface")); + ByteString.copyFrom(Utils.hexStringToByteArray("babefacebabefacebabefacebabefacebabeface")); private static final String[] witnessStrs = { "0404040404040404040404040404040404040404", "1313131313131313131313131313131313131313", @@ -43,9 +40,7 @@ class AccountingChainClientTests { private static final long timestamp = 2018050400000L; private static final long size = 20180504L; private static final ByteString transactionsRoot = - ByteString.copyFrom( - Utils.hexStringToByteArray( - "50bada5550bada5550bada5550bada5550bada5550bada5550bada5550bada55")); + ByteString.copyFrom(Utils.hexStringToByteArray("50bada5550bada5550bada5550bada5550bada55")); private static final int index = 0; private static final ByteString from = @@ -64,14 +59,11 @@ class AccountingChainClientTests { ByteString.copyFrom( Utils.hexStringToByteArray( "4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c")); - private static final String txHashStr = - "0404040404040404040404040404040404040404040404040404040404040404"; + private static final String txHashStr = "0404040404040404040404040404040404040404"; private static final ByteString txHash1 = ByteString.copyFrom(Utils.hexStringToByteArray(txHashStr)); private static final ByteString txHash2 = - ByteString.copyFrom( - Utils.hexStringToByteArray( - "1313131313131313131313131313131313131313131313131313131313131313")); + ByteString.copyFrom(Utils.hexStringToByteArray("1313131313131313131313131313131313131313")); private static final Block block = Block.newBuilder() .setNumber(blockNumber) @@ -133,7 +125,7 @@ class AccountingChainClientTests { @DisplayName("GetBlockByNumber#1") void getBlockByNumber1() throws ExecutionException, InterruptedException { // Block b = acClient.getBlockByNumber(ledger, blockNumber, true).get(); - Block b = acClient.getBlockByNumber(ledger, 2595, false).get(); + Block b = acClient.getBlockByNumber(ledger, blockNumber, false).get(); System.out.println(b.getNumber()); // Block blockFull = // Block.newBuilder(block) diff --git a/src/test/java/bdchain/api/TransactionLedgerClientTests.java b/src/test/java/bdchain/api/TransactionLedgerClientTests.java index 6be74e6..8843b33 100644 --- a/src/test/java/bdchain/api/TransactionLedgerClientTests.java +++ b/src/test/java/bdchain/api/TransactionLedgerClientTests.java @@ -84,7 +84,7 @@ class TransactionLedgerClientTests { Exception.class, () -> tlClient - .sendTransaction(ledger, TransactionType.MESSAGE, null, "50bada5550bada5550bada5550bada5550bada55", null) + .sendTransaction(ledger, TransactionType.MESSAGE, null, "50bada55", null) .get()); Status s = Status.fromThrowable(e); assertEquals(Status.Code.INVALID_ARGUMENT, s.getCode());