From 029b73bc0d719cb3610168d8a526cad1cb0094bb Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Sun, 27 Oct 2024 16:52:27 +0800 Subject: [PATCH] Add support to v0.119.0 Signed-off-by: Eval EXEC --- .../main/java/org/nervos/ckb/CkbRpcApi.java | 10 ++++++ .../main/java/org/nervos/ckb/service/Api.java | 34 +++++++++++++++++++ .../java/org/nervos/ckb/type/SyncState.java | 24 ++++++++----- .../java/org/nervos/ckb/type/TxPoolInfo.java | 4 ++- 4 files changed, 63 insertions(+), 9 deletions(-) diff --git a/ckb/src/main/java/org/nervos/ckb/CkbRpcApi.java b/ckb/src/main/java/org/nervos/ckb/CkbRpcApi.java index 8d761e6d5..11965349e 100644 --- a/ckb/src/main/java/org/nervos/ckb/CkbRpcApi.java +++ b/ckb/src/main/java/org/nervos/ckb/CkbRpcApi.java @@ -106,6 +106,16 @@ default PackedTransactionWithStatus getPackedTransaction(@Nonnull byte[] transac byte[] sendTransaction(Transaction transaction, OutputsValidator outputsValidator) throws IOException; + byte[] sendTestTransaction(Transaction transaction) throws IOException; + + byte[] sendTestTransaction(Transaction transaction, OutputsValidator outputsValidator) + throws IOException; + + byte[] testTxPoolAccept(Transaction transaction) throws IOException; + + byte[] testTxPoolAccept(Transaction transaction, OutputsValidator outputsValidator) + throws IOException; + NodeInfo localNodeInfo() throws IOException; List getPeers() throws IOException; diff --git a/ckb/src/main/java/org/nervos/ckb/service/Api.java b/ckb/src/main/java/org/nervos/ckb/service/Api.java index 29615aab6..9cbeeae72 100644 --- a/ckb/src/main/java/org/nervos/ckb/service/Api.java +++ b/ckb/src/main/java/org/nervos/ckb/service/Api.java @@ -297,6 +297,40 @@ public RawTxPoolVerbose getRawTxPoolVerbose() throws IOException { "get_raw_tx_pool", Collections.singletonList(true), RawTxPoolVerbose.class); } + @Override + public byte[] sendTestTransaction(Transaction transaction) throws IOException { + return rpcService.post( + "send_test_transaction", + Arrays.asList(Convert.parseTransaction(transaction), OutputsValidator.PASSTHROUGH), + byte[].class); + } + + @Override + public byte[] sendTestTransaction(Transaction transaction, OutputsValidator outputsValidator) + throws IOException { + return rpcService.post( + "send_test_transaction", + Arrays.asList(Convert.parseTransaction(transaction), outputsValidator), + byte[].class); + } + + @Override + public byte[] testTxPoolAccept(Transaction transaction) throws IOException { + return rpcService.post( + "test_tx_pool_accept", + Arrays.asList(Convert.parseTransaction(transaction), OutputsValidator.PASSTHROUGH), + byte[].class); + } + + @Override + public byte[] testTxPoolAccept(Transaction transaction, OutputsValidator outputsValidator) + throws IOException { + return rpcService.post( + "test_tx_pool_accept", + Arrays.asList(Convert.parseTransaction(transaction), outputsValidator), + byte[].class); + } + @Override public byte[] sendTransaction(Transaction transaction) throws IOException { return rpcService.post( diff --git a/core/src/main/java/org/nervos/ckb/type/SyncState.java b/core/src/main/java/org/nervos/ckb/type/SyncState.java index 488f18021..b8479c76f 100644 --- a/core/src/main/java/org/nervos/ckb/type/SyncState.java +++ b/core/src/main/java/org/nervos/ckb/type/SyncState.java @@ -1,12 +1,20 @@ package org.nervos.ckb.type; public class SyncState { - public boolean ibd; - public long bestKnownBlockNumber; - public long bestKnownBlockTimestamp; - public long orphanBlocksCount; - public long inflightBlocksCount; - public long fastTime; - public long normalTime; - public long lowTime; + public byte[] AssumeValidTarget; + public boolean AssumeValidTargetReached; + public long BestKnownBlockNumber; + public long BestKnownBlockTimestamp; + public long FastTime; + public boolean Ibd; + public long InflightBlocksCount; + public long LowTime; + public long MinChainWork; + public boolean MinChainWorkReached; + public long NormalTime; + public long OrphanBlocksCount; + public byte[] TipHash; + public long TipNumber; + public byte[] UnverifiedTipHash; + public long UnverifiedTipNumber; } diff --git a/core/src/main/java/org/nervos/ckb/type/TxPoolInfo.java b/core/src/main/java/org/nervos/ckb/type/TxPoolInfo.java index 853d9c4c8..771b88d8c 100644 --- a/core/src/main/java/org/nervos/ckb/type/TxPoolInfo.java +++ b/core/src/main/java/org/nervos/ckb/type/TxPoolInfo.java @@ -10,6 +10,8 @@ public class TxPoolInfo { public long minFeeRate; public byte[] tipHash; public long tipNumber; - public long txSizeLimit; public long maxTxPoolSize; + public long minRbfRate; + public long txSizeLimit; + public long verifyQueueSize; }