@@ -907,6 +907,57 @@ describe('TransactionsTracker', () => {
907
907
} ) ;
908
908
} ) ;
909
909
910
+ // TODO: Will be useful for LW-12394 investigation
911
+ it ( 'emits timeout for transactions outside of the validity interval as failed$' , async ( ) => {
912
+ const outgoingTx = toOutgoingTx ( queryTransactionsResult . pageResults [ 0 ] ) ;
913
+
914
+ createTestScheduler ( ) . run ( ( { cold, hot, expectObservable } ) => {
915
+ const tip$ = hot < Cardano . Tip > ( '-a---|' , {
916
+ a : {
917
+ blockNo : Cardano . BlockNo ( 1 ) ,
918
+ hash : '' as Cardano . BlockId ,
919
+ slot : Cardano . Slot ( outgoingTx . body . validityInterval ! . invalidHereafter ! * 2 )
920
+ }
921
+ } ) ;
922
+ const failedTx = { ...outgoingTx , id : 'x' as Cardano . TransactionId } ;
923
+ const submitting$ = cold ( '-a---|' , { a : failedTx } ) ;
924
+ const pending$ = cold ( '-----|' , { a : failedTx } ) ;
925
+ const transactionsSource$ = cold < Cardano . HydratedTx [ ] > ( 'a--b-|' , { a : [ ] , b : [ queryTransactionsResult . pageResults [ 0 ] ] } ) ;
926
+ const failedToSubmit$ = hot < FailedTx > ( '-----|' , { a : { ...failedTx , reason : TransactionFailure . FailedToSubmit } } ) ;
927
+ const signed$ = hot < WitnessedTx > ( '----|' , { } ) ;
928
+ const transactionsTracker = createTransactionsTracker (
929
+ {
930
+ addresses$,
931
+ chainHistoryProvider,
932
+ historicalTransactionsFetchLimit,
933
+ inFlightTransactionsStore,
934
+ logger,
935
+ newTransactions : {
936
+ failedToSubmit$,
937
+ pending$,
938
+ signed$,
939
+ submitting$
940
+ } ,
941
+ retryBackoffConfig,
942
+ signedTransactionsStore,
943
+ tip$,
944
+ transactionsHistoryStore : transactionsStore
945
+ } ,
946
+ {
947
+ rollback$ : NEVER ,
948
+ transactionsSource$
949
+ }
950
+ ) ;
951
+ expectObservable ( transactionsTracker . outgoing . submitting$ ) . toBe ( '-a---|' , { a : failedTx } ) ;
952
+ expectObservable ( transactionsTracker . outgoing . pending$ ) . toBe ( '-----|' ) ;
953
+ expectObservable ( transactionsTracker . outgoing . inFlight$ ) . toBe ( 'a(bc)|' , { a : [ ] , b : [ failedTx ] , c : [ ] } ) ;
954
+ expectObservable ( transactionsTracker . outgoing . onChain$ ) . toBe ( '-----|' , { a : [ failedTx ] } ) ;
955
+ expectObservable ( transactionsTracker . outgoing . failed$ ) . toBe ( '-a---|' , {
956
+ a : { reason : TransactionFailure . Timeout , ...failedTx }
957
+ } ) ;
958
+ } ) ;
959
+ } ) ;
960
+
910
961
it ( 'emits at all relevant observable properties on transaction that failed to submit and merges reemit failures' , async ( ) => {
911
962
const outgoingTx = toOutgoingTx ( queryTransactionsResult . pageResults [ 0 ] ) ;
912
963
const outgoingTxReemit = toOutgoingTx ( queryTransactionsResult . pageResults [ 1 ] ) ;
0 commit comments