@@ -39,7 +39,9 @@ describe('Node HTTP', function() {
3939 } ) ;
4040
4141 it ( 'should get mempool rejection filter' , async ( ) => {
42- const filterInfo = await nclient . get ( '/mempool/invalid' , { verbose : true } ) ;
42+ const filterInfo = await nclient . getMempoolRejectionFilter ( {
43+ verbose : true
44+ } ) ;
4345
4446 assert . ok ( 'items' in filterInfo ) ;
4547 assert . ok ( 'filter' in filterInfo ) ;
@@ -59,10 +61,10 @@ describe('Node HTTP', function() {
5961 const raw = mtx . toHex ( ) ;
6062 const txid = await nclient . execute ( 'sendrawtransaction' , [ raw ] ) ;
6163
62- const json = await nclient . get ( `/mempool/invalid/ ${ txid } ` ) ;
64+ const json = await nclient . checkMempoolRejectionFilter ( txid ) ;
6365 assert . equal ( json . invalid , true ) ;
6466
65- const filterInfo = await nclient . get ( '/mempool/invalid' ) ;
67+ const filterInfo = await nclient . getMempoolRejectionFilter ( ) ;
6668 assert . equal ( filterInfo . entries , 1 ) ;
6769 } ) ;
6870 } ) ;
@@ -90,7 +92,7 @@ describe('Node HTTP', function() {
9092
9193 // fetch corresponding header and block
9294 const height = 7 ;
93- const header = await nclient . get ( `/header/ ${ height } ` ) ;
95+ const header = await nclient . getBlockHeader ( height ) ;
9496 assert . equal ( header . height , height ) ;
9597
9698 const properties = [
@@ -116,7 +118,7 @@ describe('Node HTTP', function() {
116118
117119 it ( 'should fetch null for block header that does not exist' , async ( ) => {
118120 // many blocks in the future
119- const header = await nclient . get ( `/header/ ${ 40000 } ` ) ;
121+ const header = await nclient . getBlockHeader ( 40000 ) ;
120122 assert . equal ( header , null ) ;
121123 } ) ;
122124
@@ -130,7 +132,7 @@ describe('Node HTTP', function() {
130132 let prevBlock = '0000000000000000000000000000000000000000000000000000000000000000' ;
131133
132134 for ( let i = 0 ; i < 10 ; i ++ ) {
133- const header = await nclient . get ( `/header/ ${ i } ` ) ;
135+ const header = await nclient . getBlockHeader ( i ) ;
134136
135137 assert . equal ( prevBlock , header . prevBlock ) ;
136138 prevBlock = header . hash ;
@@ -140,8 +142,8 @@ describe('Node HTTP', function() {
140142 it ( 'should fetch block header by hash' , async ( ) => {
141143 const info = await nclient . getInfo ( ) ;
142144
143- const headerByHash = await nclient . get ( `/header/ ${ info . chain . tip } ` ) ;
144- const headerByHeight = await nclient . get ( `/header/ ${ info . chain . height } ` ) ;
145+ const headerByHash = await nclient . getBlockHeader ( info . chain . tip ) ;
146+ const headerByHeight = await nclient . getBlockHeader ( info . chain . height ) ;
145147
146148 assert . deepEqual ( headerByHash , headerByHeight ) ;
147149 } ) ;
0 commit comments