@@ -29,33 +29,57 @@ describe("Pay", async function() {
2929
3030 it ( "Allow zero pay" , async function ( ) {
3131 const pay = await node . sendPayTx ( { quantity : 0 } ) ;
32- expect ( await node . sdk . rpc . chain . containsTransaction ( pay . hash ( ) ) ) . be
33- . true ;
34- expect ( await node . sdk . rpc . chain . getTransaction ( pay . hash ( ) ) ) . not . null ;
32+ expect (
33+ await node . rpc . chain . containsTransaction ( {
34+ transactionHash : `0x${ pay . hash ( ) . toString ( ) } `
35+ } )
36+ ) . be . true ;
37+ expect (
38+ await node . rpc . chain . getTransaction ( {
39+ transactionHash : `0x${ pay . hash ( ) . toString ( ) } `
40+ } )
41+ ) . not . null ;
3542 } ) ;
3643
3744 it ( "Allow pay to itself" , async function ( ) {
3845 const pay = await node . sendPayTx ( {
3946 quantity : 100 ,
4047 recipient : faucetAddress
4148 } ) ;
42- expect ( await node . sdk . rpc . chain . containsTransaction ( pay . hash ( ) ) ) . be
43- . true ;
44- expect ( await node . sdk . rpc . chain . getTransaction ( pay . hash ( ) ) ) . not . null ;
49+ expect (
50+ await node . rpc . chain . containsTransaction ( {
51+ transactionHash : `0x${ pay . hash ( ) . toString ( ) } `
52+ } )
53+ ) . be . true ;
54+ expect (
55+ await node . rpc . chain . getTransaction ( {
56+ transactionHash : `0x${ pay . hash ( ) . toString ( ) } `
57+ } )
58+ ) . not . null ;
4559 } ) ;
4660
4761 it ( "Cannot pay to regular key" , async function ( ) {
4862 const charge = await node . sendPayTx ( {
4963 quantity : 100000 ,
5064 recipient : aliceAddress
5165 } ) ;
52- expect ( await node . sdk . rpc . chain . containsTransaction ( charge . hash ( ) ) ) . be
53- . true ;
54- expect ( await node . sdk . rpc . chain . getTransaction ( charge . hash ( ) ) ) . not . null ;
66+ expect (
67+ await node . rpc . chain . containsTransaction ( {
68+ transactionHash : `0x${ charge . hash ( ) . toString ( ) } `
69+ } )
70+ ) . be . true ;
71+ expect (
72+ await node . rpc . chain . getTransaction ( {
73+ transactionHash : `0x${ charge . hash ( ) . toString ( ) } `
74+ } )
75+ ) . not . null ;
5576
5677 const privKey = node . sdk . util . generatePrivateKey ( ) ;
5778 const pubKey = node . sdk . util . getPublicFromPrivate ( privKey ) ;
58- const aliceSeq = await node . sdk . rpc . chain . getSeq ( aliceAddress ) ;
79+ const aliceSeq = ( await node . rpc . chain . getSeq ( {
80+ address : aliceAddress . toString ( ) ,
81+ blockNumber : null
82+ } ) ) ! ;
5983 await node . setRegularKey ( pubKey , {
6084 seq : aliceSeq ,
6185 secret : aliceSecret
@@ -64,10 +88,13 @@ describe("Pay", async function() {
6488 networkId : node . sdk . networkId
6589 } ) ;
6690
67- const seq = await node . sdk . rpc . chain . getSeq ( faucetAddress ) ;
91+ const seq = ( await node . rpc . chain . getSeq ( {
92+ address : faucetAddress . toString ( ) ,
93+ blockNumber : null
94+ } ) ) ! ;
6895 const blockNumber = await node . getBestBlockNumber ( ) ;
6996
70- await node . sdk . rpc . devel . stopSealing ( ) ;
97+ await node . rpc . devel ! . stopSealing ( ) ;
7198
7299 const pay = await node . sendPayTx ( { quantity : 0 , seq } ) ;
73100 const fail = await node . sendPayTx ( {
@@ -76,16 +103,30 @@ describe("Pay", async function() {
76103 seq : seq + 1
77104 } ) ;
78105
79- await node . sdk . rpc . devel . startSealing ( ) ;
106+ await node . rpc . devel ! . startSealing ( ) ;
80107 await node . waitBlockNumber ( blockNumber + 1 ) ;
81108
82- expect ( await node . sdk . rpc . chain . containsTransaction ( pay . hash ( ) ) ) . be
83- . true ;
84- expect ( await node . sdk . rpc . chain . getTransaction ( pay . hash ( ) ) ) . not . null ;
109+ expect (
110+ await node . rpc . chain . containsTransaction ( {
111+ transactionHash : `0x${ charge . hash ( ) . toString ( ) } `
112+ } )
113+ ) . be . true ;
114+ expect (
115+ await node . rpc . chain . getTransaction ( {
116+ transactionHash : `0x${ pay . hash ( ) . toString ( ) } `
117+ } )
118+ ) . not . null ;
85119
86- expect ( await node . sdk . rpc . chain . containsTransaction ( fail . hash ( ) ) ) . be
87- . false ;
88- expect ( await node . sdk . rpc . chain . getTransaction ( fail . hash ( ) ) ) . null ;
120+ expect (
121+ await node . rpc . chain . containsTransaction ( {
122+ transactionHash : `0x${ fail . hash ( ) . toString ( ) } `
123+ } )
124+ ) . be . false ;
125+ expect (
126+ await node . rpc . chain . getTransaction ( {
127+ transactionHash : `0x${ fail . hash ( ) . toString ( ) } `
128+ } )
129+ ) . null ;
89130 expect ( await node . sdk . rpc . chain . getErrorHint ( fail . hash ( ) ) ) . not . null ;
90131 } ) ;
91132
0 commit comments