@@ -26,7 +26,6 @@ import (
26
26
"math/rand"
27
27
"reflect"
28
28
"testing"
29
- "time"
30
29
31
30
"github.com/ethereum/go-ethereum/common"
32
31
"github.com/ethereum/go-ethereum/crypto"
@@ -360,6 +359,8 @@ func testTransactionPriceNonceSort(t *testing.T, baseFee *big.Int) {
360
359
// Tests that if multiple transactions have the same price, the ones seen earlier
361
360
// are prioritized to avoid network spam attacks aiming for a specific ordering.
362
361
func TestTransactionTimeSort (t * testing.T ) {
362
+ t .Skip ("time field is removed" )
363
+
363
364
// Generate a batch of accounts to start with
364
365
keys := make ([]* ecdsa.PrivateKey , 5 )
365
366
for i := 0 ; i < len (keys ); i ++ {
@@ -369,11 +370,10 @@ func TestTransactionTimeSort(t *testing.T) {
369
370
370
371
// Generate a batch of transactions with overlapping prices, but different creation times
371
372
groups := map [common.Address ]Transactions {}
372
- for start , key := range keys {
373
+ for _ , key := range keys {
373
374
addr := crypto .PubkeyToAddress (key .PublicKey )
374
375
375
376
tx , _ := SignTx (NewTransaction (0 , common.Address {}, big .NewInt (100 ), 100 , big .NewInt (1 ), nil ), signer , key )
376
- tx .time = time .Unix (0 , int64 (len (keys )- start ))
377
377
378
378
groups [addr ] = append (groups [addr ], tx )
379
379
}
@@ -398,8 +398,8 @@ func TestTransactionTimeSort(t *testing.T) {
398
398
t .Errorf ("invalid gasprice ordering: tx #%d (A=%x P=%v) < tx #%d (A=%x P=%v)" , i , fromi [:4 ], txi .GasPrice (), i + 1 , fromNext [:4 ], next .GasPrice ())
399
399
}
400
400
// Make sure time order is ascending if the txs have the same gas price
401
- if txi .GasPrice ().Cmp (next .GasPrice ()) == 0 && txi . time . After ( next . time ) {
402
- t .Errorf ("invalid received time ordering: tx #%d (A=%x T=%v ) > tx #%d (A=%x T=%v )" , i , fromi [:4 ], txi . time , i + 1 , fromNext [:4 ], next . time )
401
+ if txi .GasPrice ().Cmp (next .GasPrice ()) == 0 {
402
+ t .Errorf ("invalid received time ordering: tx #%d (A=%x) > tx #%d (A=%x)" , i , fromi [:4 ], i + 1 , fromNext [:4 ])
403
403
}
404
404
}
405
405
}
0 commit comments