@@ -214,18 +214,23 @@ describe('NodeConnection', () => {
214
214
: ( isTestnet ? testnetRejectedTx : mainnetRejectedTx ) ;
215
215
}
216
216
217
- it ( 'should return accepted for a valid tx ID' , async ( ) => {
217
+ it ( 'should return confirmed transaction data for an accepted tx ID' , async ( ) => {
218
218
const connection = new AleoNetworkClient ( host ) ;
219
219
const txId = getTxId ( connection , "accepted" ) ;
220
- const status = await connection . waitForTransactionConfirmation ( txId ) ;
221
- expect ( status ) . to . equal ( "accepted" ) ;
220
+ const data = await connection . waitForTransactionConfirmation ( txId ) ;
221
+ expect ( data . status ) . to . equal ( "accepted" ) ;
222
+ expect ( data . type ) . to . be . a ( "string" ) ;
222
223
} ) ;
223
224
224
- it ( 'should return rejected for a rejected tx ID' , async ( ) => {
225
+ it ( 'should throw for a rejected tx ID' , async ( ) => {
225
226
const connection = new AleoNetworkClient ( host ) ;
226
227
const txId = getTxId ( connection , "rejected" ) ;
227
- const status = await connection . waitForTransactionConfirmation ( txId ) ;
228
- expect ( status ) . to . equal ( "rejected" ) ;
228
+ try {
229
+ await connection . waitForTransactionConfirmation ( txId ) ;
230
+ throw new Error ( "Expected waitForTransactionConfirmation to throw for rejected tx" ) ;
231
+ } catch ( err : any ) {
232
+ expect ( err . message ) . to . include ( "was rejected by the network" ) ;
233
+ }
229
234
} ) ;
230
235
231
236
it ( 'should throw for a malformed tx ID' , async ( ) => {
0 commit comments