Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to v0.119.0 #682

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -78,6 +78,16 @@ public interface CkbRpcApi {
byte[] sendTransaction(Transaction transaction, OutputsValidator outputsValidator)
throws IOException;

byte[] sendTestTransaction(Transaction transaction) throws IOException;

byte[] sendTestTransaction(Transaction transaction, OutputsValidator outputsValidator)
throws IOException;

byte[] test_tx_pool_accept(Transaction transaction) throws IOException;

byte[] test_tx_pool_accept(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 @@ -279,6 +279,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
24 changes: 16 additions & 8 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 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;
}
4 changes: 4 additions & 0 deletions core/src/main/java/org/nervos/ckb/type/TxPoolInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ public class TxPoolInfo {
public long minFeeRate;
public byte[] tipHash;
public long tipNumber;
public long maxTxPoolSize;
public long minRbfRate;
public long txSizeLimit;
public long verifyQueueSize;
}