@@ -197,14 +197,13 @@ func testIssueAtomicTxs(t *testing.T, scheme string) {
197197 utxos := map [ids.ShortID ]uint64 {
198198 vmtest .TestShortIDAddrs [0 ]: importAmount ,
199199 }
200- addUTXOs (tvm .AtomicMemory , vm .Ctx , utxos )
200+ require . NoError ( addUTXOs (tvm .AtomicMemory , vm .Ctx , utxos ) )
201201 defer func () {
202202 require .NoError (vm .Shutdown (t .Context ()))
203203 }()
204204
205205 importTx , err := vm .newImportTx (vm .Ctx .XChainID , vmtest .TestEthAddrs [0 ], vmtest .InitialBaseFee , vmtest .TestKeys [0 :1 ])
206206 require .NoError (err )
207-
208207 require .NoError (vm .AtomicMempool .AddLocalTx (importTx ))
209208
210209 msg , err := vm .WaitForEvent (t .Context ())
@@ -213,11 +212,8 @@ func testIssueAtomicTxs(t *testing.T, scheme string) {
213212
214213 blk , err := vm .BuildBlock (t .Context ())
215214 require .NoError (err )
216-
217215 require .NoError (blk .Verify (t .Context ()))
218-
219216 require .NoError (vm .SetPreference (t .Context (), blk .ID ()))
220-
221217 require .NoError (blk .Accept (t .Context ()))
222218
223219 lastAcceptedID , err := vm .LastAccepted (t .Context ())
@@ -231,7 +227,6 @@ func testIssueAtomicTxs(t *testing.T, scheme string) {
231227 wrappedState := extstate .New (state )
232228 exportTx , err := atomic .NewExportTx (vm .Ctx , vm .CurrentRules (), wrappedState , vm .Ctx .AVAXAssetID , importAmount - (2 * ap0 .AtomicTxFee ), vm .Ctx .XChainID , vmtest .TestShortIDAddrs [0 ], vmtest .InitialBaseFee , vmtest .TestKeys [0 :1 ])
233229 require .NoError (err )
234-
235230 require .NoError (vm .AtomicMempool .AddLocalTx (exportTx ))
236231
237232 msg , err = vm .WaitForEvent (t .Context ())
@@ -240,9 +235,7 @@ func testIssueAtomicTxs(t *testing.T, scheme string) {
240235
241236 blk2 , err := vm .BuildBlock (t .Context ())
242237 require .NoError (err )
243-
244238 require .NoError (blk2 .Verify (t .Context ()))
245-
246239 require .NoError (blk2 .Accept (t .Context ()))
247240
248241 lastAcceptedID , err = vm .LastAccepted (t .Context ())
@@ -842,18 +835,17 @@ func TestConsecutiveAtomicTransactionsRevertSnapshot(t *testing.T) {
842835 blk , err := vm .BuildBlock (t .Context ())
843836 require .NoError (err )
844837 require .NoError (blk .Verify (t .Context ()))
845-
846838 require .NoError (vm .SetPreference (t .Context (), blk .ID ()))
847-
848839 require .NoError (blk .Accept (t .Context ()))
849840
850841 newHead := <- newTxPoolHeadChan
851842 require .Equal (common .Hash (blk .ID ()), newHead .Head .Hash ())
852843
853844 // Add the two conflicting transactions directly to the mempool, so that two consecutive transactions
854845 // will fail verification when build block is called.
855- vm .AtomicMempool .AddRemoteTx (importTxs [1 ])
856- vm .AtomicMempool .AddRemoteTx (importTxs [2 ])
846+ require .NoError (vm .AtomicMempool .ForceAddTx (importTxs [1 ]))
847+ require .NoError (vm .AtomicMempool .ForceAddTx (importTxs [2 ]))
848+ require .Equal (2 , vm .AtomicMempool .Txs .PendingLen ())
857849
858850 _ , err = vm .BuildBlock (t .Context ())
859851 require .ErrorIs (err , ErrEmptyBlock )
@@ -890,7 +882,7 @@ func TestAtomicTxBuildBlockDropsConflicts(t *testing.T) {
890882 err = vm .AtomicMempool .AddLocalTx (conflictTx )
891883 require .ErrorIs (err , txpool .ErrConflict )
892884 // force add the tx
893- vm .AtomicMempool .ForceAddTx (conflictTx )
885+ require . NoError ( vm .AtomicMempool .ForceAddTx (conflictTx ) )
894886 conflictSets [index ].Add (conflictTx .ID ())
895887 }
896888 msg , err := vm .WaitForEvent (t .Context ())
@@ -1637,7 +1629,7 @@ func TestWaitForEvent(t *testing.T) {
16371629 },
16381630 }}}}))
16391631 testCase .testCase (t , vm , address , key )
1640- vm .Shutdown (t .Context ())
1632+ require . NoError ( t , vm .Shutdown (t .Context () ))
16411633 })
16421634 }
16431635}
0 commit comments