@@ -96,22 +96,7 @@ describe("IncreaseAssetSupply", async function() {
9696 expect ( await node . sdk . rpc . chain . containsTransaction ( hash1 ) ) . be . true ;
9797 expect ( await node . sdk . rpc . chain . getTransaction ( hash1 ) ) . not . null ;
9898
99- await node . sdk . rpc . devel . stopSealing ( ) ;
100- const blockNumber = await node . getBestBlockNumber ( ) ;
101-
102- const pay = await node . sendPayTx ( { seq : seq + 1 , quantity : 1 } ) ;
103- const hash2 = await node . sendAssetTransaction ( tx2 , {
104- seq : seq + 2
105- } ) ;
106-
107- await node . sdk . rpc . devel . startSealing ( ) ;
108- await node . waitBlockNumber ( blockNumber + 1 ) ;
109-
110- expect ( await node . sdk . rpc . chain . containsTransaction ( pay . hash ( ) ) ) . be
111- . true ;
112- expect ( await node . sdk . rpc . chain . containsTransaction ( hash2 ) ) . be . false ;
113- expect ( await node . sdk . rpc . chain . getTransaction ( hash2 ) ) . be . null ;
114- expect ( await node . sdk . rpc . chain . getErrorHint ( hash2 ) ) . be . not . null ;
99+ await node . sendAssetTransactionExpectedToFail ( tx2 , { seq : seq + 1 } ) ;
115100 } ) ;
116101
117102 it ( "cannot increase supply with the same transaction even the asset is moved" , async function ( ) {
@@ -167,22 +152,7 @@ describe("IncreaseAssetSupply", async function() {
167152 expect ( await node . sdk . rpc . chain . getTransaction ( transferHash ) ) . be . not
168153 . null ;
169154
170- await node . sdk . rpc . devel . stopSealing ( ) ;
171- const blockNumber = await node . getBestBlockNumber ( ) ;
172-
173- const pay = await node . sendPayTx ( { seq : seq + 2 , quantity : 1 } ) ;
174- const hash2 = await node . sendAssetTransaction ( tx2 , {
175- seq : seq + 3
176- } ) ;
177-
178- await node . sdk . rpc . devel . startSealing ( ) ;
179- await node . waitBlockNumber ( blockNumber + 1 ) ;
180-
181- expect ( await node . sdk . rpc . chain . containsTransaction ( pay . hash ( ) ) ) . be
182- . true ;
183- expect ( await node . sdk . rpc . chain . containsTransaction ( hash2 ) ) . be . false ;
184- expect ( await node . sdk . rpc . chain . getTransaction ( hash2 ) ) . be . null ;
185- expect ( await node . sdk . rpc . chain . getErrorHint ( hash2 ) ) . be . not . null ;
155+ await node . sendAssetTransactionExpectedToFail ( tx2 , { seq : seq + 2 } ) ;
186156 } ) ;
187157
188158 it ( "can increase supply again" , async function ( ) {
@@ -293,18 +263,7 @@ describe("IncreaseAssetSupply", async function() {
293263 supply : increasedAmount
294264 } ) ;
295265
296- await node . sdk . rpc . devel . stopSealing ( ) ;
297- const seq = await node . sdk . rpc . chain . getSeq ( faucetAddress ) ;
298- const blockNumber = await node . getBestBlockNumber ( ) ;
299- const pay = await node . sendPayTx ( { seq, quantity : 1 } ) ;
300- const hash = await node . sendAssetTransaction ( tx , { seq : seq + 1 } ) ;
301- await node . sdk . rpc . devel . startSealing ( ) ;
302- await node . waitBlockNumber ( blockNumber + 1 ) ;
303- expect ( await node . sdk . rpc . chain . containsTransaction ( hash ) ) . be . false ;
304- expect ( await node . sdk . rpc . chain . containsTransaction ( pay . hash ( ) ) ) . be
305- . true ;
306- expect ( await node . sdk . rpc . chain . getTransaction ( pay . hash ( ) ) ) . not . null ;
307- expect ( await node . sdk . rpc . chain . getErrorHint ( hash ) ) . not . null ;
266+ await node . sendAssetTransactionExpectedToFail ( tx ) ;
308267
309268 const additionalAsset = await node . sdk . rpc . chain . getAsset (
310269 tx . tracker ( ) ,
@@ -328,17 +287,8 @@ describe("IncreaseAssetSupply", async function() {
328287 supply : increasedAmount
329288 } ) ;
330289
331- await node . sdk . rpc . devel . stopSealing ( ) ;
332- const blockNumber = await node . getBestBlockNumber ( ) ;
333- const pay = await node . sendPayTx ( { quantity : 1 } ) ;
334- const hash = await node . sendTransaction ( tx , { account : outsider } ) ;
335- await node . sdk . rpc . devel . startSealing ( ) ;
336- await node . waitBlockNumber ( blockNumber + 1 ) ;
337- expect ( await node . sdk . rpc . chain . containsTransaction ( hash ) ) . be . false ;
338- expect ( await node . sdk . rpc . chain . containsTransaction ( pay . hash ( ) ) ) . be
339- . true ;
340- expect ( await node . sdk . rpc . chain . getTransaction ( pay . hash ( ) ) ) . not . null ;
341- expect ( await node . sdk . rpc . chain . getErrorHint ( hash ) ) . not . null ;
290+ await node . sendTransactionExpectedToFail ( tx , { account : outsider } ) ;
291+
342292 const results = await node . sdk . rpc . chain . getTransactionResultsByTracker (
343293 tx . tracker ( ) ,
344294 {
@@ -367,18 +317,7 @@ describe("IncreaseAssetSupply", async function() {
367317 supply : 1
368318 } ) ;
369319
370- await node . sdk . rpc . devel . stopSealing ( ) ;
371- const blockNumber = await node . getBestBlockNumber ( ) ;
372- const seq = await node . sdk . rpc . chain . getSeq ( faucetAddress ) ;
373- const pay = await node . sendPayTx ( { seq, quantity : 1 } ) ;
374- const hash = await node . sendAssetTransaction ( tx , { seq : seq + 1 } ) ;
375- await node . sdk . rpc . devel . startSealing ( ) ;
376- await node . waitBlockNumber ( blockNumber + 1 ) ;
377- expect ( await node . sdk . rpc . chain . containsTransaction ( hash ) ) . be . false ;
378- expect ( await node . sdk . rpc . chain . containsTransaction ( pay . hash ( ) ) ) . be
379- . true ;
380- expect ( await node . sdk . rpc . chain . getTransaction ( pay . hash ( ) ) ) . not . null ;
381- expect ( await node . sdk . rpc . chain . getErrorHint ( hash ) ) . not . null ;
320+ await node . sendAssetTransactionExpectedToFail ( tx ) ;
382321
383322 const additionalAsset = await node . sdk . rpc . chain . getAsset (
384323 tx . tracker ( ) ,
0 commit comments