@@ -37,7 +37,6 @@ spec = do
37
37
, expectTxStatusEventually [InNewestBlocks ]
38
38
]
39
39
40
-
41
40
scenario " not enough fragmentation of utxo forbids multi-output transaction" $ do
42
41
fixtureSource <- setup $ defaultSetup
43
42
& initialCoins .~ [100000 ]
@@ -64,6 +63,44 @@ spec = do
64
63
[ expectWalletError (UtxoNotEnoughFragmented (Client. ErrUtxoNotEnoughFragmented 1 Client. msgUtxoNotEnoughFragmented))
65
64
]
66
65
66
+ scenario " cannot send subsequent transaction when the first one is pending" $ do
67
+ fixtureSource <- setup $ defaultSetup
68
+ & initialCoins .~ [10000000 ]
69
+ & rawPassword .~ " raw password"
70
+
71
+ fixtureDest <- setup $ defaultSetup
72
+
73
+ -- Running two transactions one after another. Not waiting for the first transaction to be "completed".
74
+ -- The second transaction returns UtxoNotEnoughFragmented because the first one is still "pending"
75
+ resp1 <- request $ Client. postTransaction $- Payment
76
+ (defaultSource fixtureSource)
77
+ (defaultDistribution 1 fixtureDest)
78
+ defaultGroupingPolicy
79
+ (Just $ fixtureDest ^. spendingPassword)
80
+ verify resp1
81
+ [ expectSuccess
82
+ ]
83
+
84
+ resp2 <- request $ Client. postTransaction $- Payment
85
+ (defaultSource fixtureSource)
86
+ (defaultDistribution 1 fixtureDest)
87
+ defaultGroupingPolicy
88
+ (Just $ fixtureDest ^. spendingPassword)
89
+ verify resp2
90
+ [ expectWalletError (UtxoNotEnoughFragmented (Client. ErrUtxoNotEnoughFragmented 1 Client. msgUtxoNotEnoughFragmented))
91
+ ]
92
+
93
+ -- only after the first transaction completes the next one can be successfully sent
94
+ expectTxStatusEventually [InNewestBlocks , Persisted ] resp1
95
+
96
+ resp3 <- request $ Client. postTransaction $- Payment
97
+ (defaultSource fixtureSource)
98
+ (defaultDistribution 1 fixtureDest)
99
+ defaultGroupingPolicy
100
+ (Just $ fixtureDest ^. spendingPassword)
101
+ verify resp3
102
+ [ expectTxStatusEventually [InNewestBlocks , Persisted ]
103
+ ]
67
104
68
105
scenario " successful payment appears in the history" $ do
69
106
fixture <- setup $ defaultSetup
0 commit comments