Update tests

This commit is contained in:
Nex 2019-04-23 23:10:32 +08:00
parent 0b156110f0
commit 91be741e87
3 changed files with 8 additions and 16 deletions

@ -1 +1 @@
Subproject commit d2792917e7ac2eabb02c14117544e40f99e278fb Subproject commit 70d4bb0f0c3a88f2ef459dfabdf521bf941dd667

View File

@ -23,14 +23,11 @@ class AccountingChainClientTests {
private static final String ledger = "test"; private static final String ledger = "test";
private static final int blockNumber = 2018; private static final int blockNumber = 2018;
private static final String blockHashStr = private static final String blockHashStr = "deadc0dedeadc0dedeadc0dedeadc0dedeadc0de";
"deadc0dedeadc0dedeadc0dedeadc0dedeadc0dedeadc0dedeadc0dedeadc0de";
private static final ByteString blockHash = private static final ByteString blockHash =
ByteString.copyFrom(Utils.hexStringToByteArray(blockHashStr)); ByteString.copyFrom(Utils.hexStringToByteArray(blockHashStr));
private static final ByteString parentHash = private static final ByteString parentHash =
ByteString.copyFrom( ByteString.copyFrom(Utils.hexStringToByteArray("babefacebabefacebabefacebabefacebabeface"));
Utils.hexStringToByteArray(
"babefacebabefacebabefacebabefacebabefacebabefacebabefacebabeface"));
private static final String[] witnessStrs = { private static final String[] witnessStrs = {
"0404040404040404040404040404040404040404", "0404040404040404040404040404040404040404",
"1313131313131313131313131313131313131313", "1313131313131313131313131313131313131313",
@ -43,9 +40,7 @@ class AccountingChainClientTests {
private static final long timestamp = 2018050400000L; private static final long timestamp = 2018050400000L;
private static final long size = 20180504L; private static final long size = 20180504L;
private static final ByteString transactionsRoot = private static final ByteString transactionsRoot =
ByteString.copyFrom( ByteString.copyFrom(Utils.hexStringToByteArray("50bada5550bada5550bada5550bada5550bada55"));
Utils.hexStringToByteArray(
"50bada5550bada5550bada5550bada5550bada5550bada5550bada5550bada55"));
private static final int index = 0; private static final int index = 0;
private static final ByteString from = private static final ByteString from =
@ -64,14 +59,11 @@ class AccountingChainClientTests {
ByteString.copyFrom( ByteString.copyFrom(
Utils.hexStringToByteArray( Utils.hexStringToByteArray(
"4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c")); "4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c"));
private static final String txHashStr = private static final String txHashStr = "0404040404040404040404040404040404040404";
"0404040404040404040404040404040404040404040404040404040404040404";
private static final ByteString txHash1 = private static final ByteString txHash1 =
ByteString.copyFrom(Utils.hexStringToByteArray(txHashStr)); ByteString.copyFrom(Utils.hexStringToByteArray(txHashStr));
private static final ByteString txHash2 = private static final ByteString txHash2 =
ByteString.copyFrom( ByteString.copyFrom(Utils.hexStringToByteArray("1313131313131313131313131313131313131313"));
Utils.hexStringToByteArray(
"1313131313131313131313131313131313131313131313131313131313131313"));
private static final Block block = private static final Block block =
Block.newBuilder() Block.newBuilder()
.setNumber(blockNumber) .setNumber(blockNumber)
@ -133,7 +125,7 @@ class AccountingChainClientTests {
@DisplayName("GetBlockByNumber#1") @DisplayName("GetBlockByNumber#1")
void getBlockByNumber1() throws ExecutionException, InterruptedException { void getBlockByNumber1() throws ExecutionException, InterruptedException {
// Block b = acClient.getBlockByNumber(ledger, blockNumber, true).get(); // 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()); System.out.println(b.getNumber());
// Block blockFull = // Block blockFull =
// Block.newBuilder(block) // Block.newBuilder(block)

View File

@ -84,7 +84,7 @@ class TransactionLedgerClientTests {
Exception.class, Exception.class,
() -> () ->
tlClient tlClient
.sendTransaction(ledger, TransactionType.MESSAGE, null, "50bada5550bada5550bada5550bada5550bada55", null) .sendTransaction(ledger, TransactionType.MESSAGE, null, "50bada55", null)
.get()); .get());
Status s = Status.fromThrowable(e); Status s = Status.fromThrowable(e);
assertEquals(Status.Code.INVALID_ARGUMENT, s.getCode()); assertEquals(Status.Code.INVALID_ARGUMENT, s.getCode());