Skip to content

Commit

Permalink
Merge pull request #683 from eval-exec/exec/Update-to-119.0
Browse files Browse the repository at this point in the history
Add support to v0.119.0
  • Loading branch information
quake authored Nov 25, 2024
2 parents b88e79d + fbf7383 commit 615bf0e
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 5 deletions.
10 changes: 10 additions & 0 deletions ckb/src/main/java/org/nervos/ckb/CkbRpcApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<PeerNodeInfo> getPeers() throws IOException;
Expand Down
34 changes: 34 additions & 0 deletions ckb/src/main/java/org/nervos/ckb/service/Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
16 changes: 12 additions & 4 deletions core/src/main/java/org/nervos/ckb/type/SyncState.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
package org.nervos.ckb.type;

public class SyncState {
public boolean ibd;
public byte[] assumeValidTarget;
public boolean assumeValidTargetReached;
public long bestKnownBlockNumber;
public long bestKnownBlockTimestamp;
public long orphanBlocksCount;
public long inflightBlocksCount;
public long fastTime;
public long normalTime;
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;
}
4 changes: 3 additions & 1 deletion core/src/main/java/org/nervos/ckb/type/TxPoolInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 615bf0e

Please sign in to comment.