Skip to content

Commit

Permalink
feat: Support cycles in rpc api get_transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Liu Chuankai committed Dec 1, 2022
1 parent dc89e39 commit 340424a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ckb/src/test/java/service/ApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ public void testTransaction() throws IOException {
Assertions.assertEquals(1, transaction.inputs.size());
Assertions.assertEquals(3, transaction.outputs.size());
Assertions.assertEquals(30000000000L, transaction.outputs.get(0).capacity);

transactionHash =
Numeric.hexStringToByteArray(
"0x3dca00e45e2f3a39d707d5559ba49d27d21038624b0402039898d3a8830525be");
TransactionWithStatus transactionWithStatus = api.getTransaction(transactionHash);

Assertions.assertNotNull(transactionWithStatus.txStatus);
Assertions.assertNotNull(transactionWithStatus.cycles);
Assertions.assertTrue(transactionWithStatus.cycles > 0);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
public class TransactionWithStatus {
public TxStatus txStatus;
public Transaction transaction;
public Long cycles;

public static class TxStatus {
public Status status;
Expand Down

0 comments on commit 340424a

Please sign in to comment.