@@ -199,78 +199,6 @@ func TestTransactionsHeapItem_detectLowerNonce(t *testing.T) {
199
199
})
200
200
}
201
201
202
- func TestTransactionsHeapItem_detectBadlyGuarded (t * testing.T ) {
203
- txGasHandler := txcachemocks .NewTxGasHandlerMock ()
204
-
205
- a := createTx ([]byte ("tx-1" ), "alice" , 42 )
206
- b := createTx ([]byte ("tx-7" ), "bob" , 43 ).withGuardian ([]byte ("heidi" ))
207
-
208
- a .precomputeFields (txGasHandler )
209
- b .precomputeFields (txGasHandler )
210
-
211
- t .Run ("unknown" , func (t * testing.T ) {
212
- item , err := newTransactionsHeapItem (bunchOfTransactions {a })
213
- require .NoError (t , err )
214
-
215
- require .False (t , item .detectBadlyGuarded ())
216
- })
217
-
218
- t .Run ("transaction has no guardian, account has no guardian" , func (t * testing.T ) {
219
- item , err := newTransactionsHeapItem (bunchOfTransactions {a })
220
- require .NoError (t , err )
221
-
222
- item .senderState = & types.AccountState {
223
- Guardian : nil ,
224
- }
225
-
226
- require .False (t , item .detectBadlyGuarded ())
227
- })
228
-
229
- t .Run ("transaction has guardian, account has guardian, they match" , func (t * testing.T ) {
230
- item , err := newTransactionsHeapItem (bunchOfTransactions {b })
231
- require .NoError (t , err )
232
-
233
- item .senderState = & types.AccountState {
234
- Guardian : []byte ("heidi" ),
235
- }
236
-
237
- require .False (t , item .detectBadlyGuarded ())
238
- })
239
-
240
- t .Run ("transaction has guardian, account has guardian, they don't match" , func (t * testing.T ) {
241
- item , err := newTransactionsHeapItem (bunchOfTransactions {b })
242
- require .NoError (t , err )
243
-
244
- item .senderState = & types.AccountState {
245
- Guardian : []byte ("grace" ),
246
- }
247
-
248
- require .True (t , item .detectBadlyGuarded ())
249
- })
250
-
251
- t .Run ("transaction has guardian, account does not" , func (t * testing.T ) {
252
- item , err := newTransactionsHeapItem (bunchOfTransactions {b })
253
- require .NoError (t , err )
254
-
255
- item .senderState = & types.AccountState {
256
- Guardian : nil ,
257
- }
258
-
259
- require .True (t , item .detectBadlyGuarded ())
260
- })
261
-
262
- t .Run ("transaction has no guardian, account has guardian" , func (t * testing.T ) {
263
- item , err := newTransactionsHeapItem (bunchOfTransactions {a })
264
- require .NoError (t , err )
265
-
266
- item .senderState = & types.AccountState {
267
- Guardian : []byte ("heidi" ),
268
- }
269
-
270
- require .True (t , item .detectBadlyGuarded ())
271
- })
272
- }
273
-
274
202
func TestTransactionsHeapItem_detectNonceDuplicate (t * testing.T ) {
275
203
a := createTx ([]byte ("tx-1" ), "alice" , 42 )
276
204
b := createTx ([]byte ("tx-2" ), "alice" , 43 )
0 commit comments