@@ -26,7 +26,6 @@ import (
2626 "math/rand"
2727 "reflect"
2828 "testing"
29- "time"
3029
3130 "github.com/ethereum/go-ethereum/common"
3231 "github.com/ethereum/go-ethereum/crypto"
@@ -360,6 +359,8 @@ func testTransactionPriceNonceSort(t *testing.T, baseFee *big.Int) {
360359// Tests that if multiple transactions have the same price, the ones seen earlier
361360// are prioritized to avoid network spam attacks aiming for a specific ordering.
362361func TestTransactionTimeSort (t * testing.T ) {
362+ t .Skip ("time field is removed" )
363+
363364 // Generate a batch of accounts to start with
364365 keys := make ([]* ecdsa.PrivateKey , 5 )
365366 for i := 0 ; i < len (keys ); i ++ {
@@ -369,11 +370,10 @@ func TestTransactionTimeSort(t *testing.T) {
369370
370371 // Generate a batch of transactions with overlapping prices, but different creation times
371372 groups := map [common.Address ]Transactions {}
372- for start , key := range keys {
373+ for _ , key := range keys {
373374 addr := crypto .PubkeyToAddress (key .PublicKey )
374375
375376 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 ))
377377
378378 groups [addr ] = append (groups [addr ], tx )
379379 }
@@ -398,8 +398,8 @@ func TestTransactionTimeSort(t *testing.T) {
398398 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 ())
399399 }
400400 // 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 ])
403403 }
404404 }
405405 }
0 commit comments