@@ -26,7 +26,7 @@ describe('get_transactions', function () {
2626 let txs = await rpcCLient . getTransactions ( {
2727 "script" : test_scripts [ 0 ] . script , "scriptType" : test_scripts [ 0 ] . scriptType ,
2828 "groupByTransaction" : true
29- } , "asc" , "0xfff " )
29+ } , "asc" , "0x1ff " )
3030 console . log ( txs . objects [ 0 ] . blockNumber )
3131 console . log ( txs . objects [ txs . objects . length - 1 ] . blockNumber )
3232 await lightClientRPC . setScripts ( [
@@ -51,28 +51,28 @@ describe('get_transactions', function () {
5151 filter : {
5252 blockRange : [ BI . from ( 12112687 ) . sub ( 1 ) . toHexString ( ) , BI . from ( 12116260 ) . toHexString ( ) ] ,
5353 }
54- } , "asc" , "0xfff " , lightAfterCursor
54+ } , "asc" , "0x1ff " , lightAfterCursor
5555 )
5656 let ckbTxs = await rpcCLient . getTransactions ( {
5757 "script" : test_scripts [ 0 ] . script , "scriptType" : test_scripts [ 0 ] . scriptType ,
5858 // "groupByTransaction": true
5959 filter : {
6060 blockRange : [ BI . from ( 12112687 ) . sub ( 1 ) . toHexString ( ) , BI . from ( 12116260 ) . toHexString ( ) ] ,
6161 }
62- } , "asc" , "0xfff " , ckbAfterCursor )
62+ } , "asc" , "0x1ff " , ckbAfterCursor )
6363
6464 console . log ( "lightTxs.objects.length:" , lightTxs . objects . length )
6565 console . log ( "ckbTxs.objects.length:" , ckbTxs . objects . length )
66- expect ( lightTxs . objects . length == ckbTxs . objects . length , "light txs length not equal ckb txs length" )
66+ expect ( lightTxs . objects . length ) . to . be . equal ( ckbTxs . objects . length , "light txs length not equal ckb txs length" )
6767 for ( let i = 0 ; i < lightTxs . objects . length ; i ++ ) {
6868 let lightTx = lightTxs . objects [ i ]
6969 let ckbTx = ckbTxs . objects [ i ]
7070 // console.log("lightTx:", lightTx)
7171 // console.log("ckbTx:", ckbTx)
72- expect ( lightTx . transaction . hash == ckbTx . txHash , "light tx hash not equal ckb tx hash" )
73- expect ( lightTx . blockNumber == ckbTx . blockNumber , "light block number not equal ckb tx hash" )
74- expect ( lightTx . ioIndex == ckbTx . ioIndex , "light block number not equal ckb tx hash" )
75- expect ( lightTx . txIndex == ckbTx . txIndex , "light block number not equal ckb tx hash" )
72+ expect ( lightTx . transaction . hash ) . to . be . equal ( ckbTx . txHash , "light tx hash not equal ckb tx hash" )
73+ expect ( lightTx . blockNumber ) . to . be . equal ( ckbTx . blockNumber , "light block number not equal ckb tx hash" )
74+ expect ( lightTx . ioIndex ) . to . be . equal ( ckbTx . ioIndex , "light block number not equal ckb tx hash" )
75+ expect ( lightTx . txIndex ) . to . be . equal ( ckbTx . txIndex , "light block number not equal ckb tx hash" )
7676 }
7777 lightAfterCursor = lightTxs . lastCursor
7878 ckbAfterCursor = ckbTxs . lastCursor
@@ -93,7 +93,7 @@ describe('get_transactions', function () {
9393 filter : {
9494 blockRange : [ BI . from ( 12112687 ) . sub ( 1 ) . toHexString ( ) , BI . from ( 12116260 ) . toHexString ( ) ] ,
9595 }
96- } , "asc" , BI . from ( 5000 ) . toHexString ( ) , lightAfterCursor
96+ } , "asc" , BI . from ( 1000 ) . toHexString ( ) , lightAfterCursor
9797 )
9898 if ( lightTxs . objects . length == 0 ) {
9999 return
@@ -105,18 +105,20 @@ describe('get_transactions', function () {
105105 filter : {
106106 blockRange : [ BI . from ( 12112687 ) . sub ( 1 ) . toHexString ( ) , BI . from ( 12116260 ) . toHexString ( ) ] ,
107107 }
108- } , "asc" , BI . from ( 5000 ) . toHexString ( ) , ckbAfterCursor )
108+ } , "asc" , BI . from ( 1000 ) . toHexString ( ) , ckbAfterCursor )
109109
110110 console . log ( "lightTxs.objects.length:" , lightTxs . objects . length )
111111 console . log ( "ckbTxs.objects.length:" , ckbTxs . objects . length )
112- expect ( lightTxs . objects . length == ckbTxs . objects . length , "light txs length not equal ckb txs length" )
112+ expect ( lightTxs . objects . length ) . to . be . equal ( ckbTxs . objects . length , "light txs length not equal ckb txs length" )
113113 for ( let i = 0 ; i < lightTxs . objects . length ; i ++ ) {
114114 let lightTx = lightTxs . objects [ i ]
115115 let ckbTx = ckbTxs . objects [ i ]
116- expect ( lightTx . transaction . hash == ckbTx . txHash , "light tx hash not equal ckb tx hash" )
117- expect ( lightTx . blockNumber == ckbTx . blockNumber , "light block number not equal ckb tx hash" )
118- expect ( lightTx . cells == ckbTx . cells , "light block number not equal ckb tx hash" )
119- expect ( lightTx . txIndex == ckbTx . txIndex , "light block number not equal ckb tx hash" )
116+ // console.log("index:",i," lightTx:", lightTx.transaction.hash,JSON.stringify(lightTx.cells) )
117+ // console.log("ckbTx:", ckbTx.txHash)
118+ expect ( lightTx . transaction . hash ) . to . be . equal ( ckbTx . txHash , "light tx hash not equal ckb tx hash" )
119+ expect ( lightTx . blockNumber ) . to . be . equal ( ckbTx . blockNumber , "light block number not equal ckb tx hash" )
120+ expect ( JSON . stringify ( lightTx . cells ) ) . to . be . equal ( JSON . stringify ( ckbTx . cells ) , "light block number not equal ckb tx hash" )
121+ expect ( lightTx . txIndex ) . to . be . equal ( ckbTx . txIndex , "light block number not equal ckb tx hash" )
120122 }
121123 lightAfterCursor = lightTxs . lastCursor
122124 ckbAfterCursor = ckbTxs . lastCursor
@@ -125,4 +127,4 @@ describe('get_transactions', function () {
125127 }
126128 } )
127129
128- } ) ;
130+ } ) ;
0 commit comments