Skip to content

Commit d463e3c

Browse files
committed
fix tests
1 parent 034b28e commit d463e3c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

core/rawdb/accessors_skipped_txs_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func newTestTransaction(queueIndex uint64) *types.Transaction {
4444
func TestReadWriteSkippedTransactionNoIndex(t *testing.T) {
4545
tx := newTestTransaction(123)
4646
db := NewMemoryDatabase()
47-
writeSkippedTransaction(db, tx, "random reason", 1, &common.Hash{1})
47+
writeSkippedTransaction(db, tx, nil, "random reason", 1, &common.Hash{1})
4848
got := ReadSkippedTransaction(db, tx.Hash())
4949
if got == nil || got.Tx.Hash() != tx.Hash() || got.Reason != "random reason" || got.BlockNumber != 1 || got.BlockHash == nil || *got.BlockHash != (common.Hash{1}) {
5050
t.Fatal("Skipped transaction mismatch", "got", got)
@@ -54,7 +54,7 @@ func TestReadWriteSkippedTransactionNoIndex(t *testing.T) {
5454
func TestReadWriteSkippedTransaction(t *testing.T) {
5555
tx := newTestTransaction(123)
5656
db := NewMemoryDatabase()
57-
WriteSkippedTransaction(db, tx, "random reason", 1, &common.Hash{1})
57+
WriteSkippedTransaction(db, tx, nil, "random reason", 1, &common.Hash{1})
5858
got := ReadSkippedTransaction(db, tx.Hash())
5959
if got == nil || got.Tx.Hash() != tx.Hash() || got.Reason != "random reason" || got.BlockNumber != 1 || got.BlockHash == nil || *got.BlockHash != (common.Hash{1}) {
6060
t.Fatal("Skipped transaction mismatch", "got", got)
@@ -78,7 +78,7 @@ func TestSkippedTransactionConcurrentUpdate(t *testing.T) {
7878
wg.Add(1)
7979
go func() {
8080
defer wg.Done()
81-
WriteSkippedTransaction(db, tx, "random reason", 1, &common.Hash{1})
81+
WriteSkippedTransaction(db, tx, nil, "random reason", 1, &common.Hash{1})
8282
}()
8383
}
8484
wg.Wait()
@@ -100,12 +100,12 @@ func TestIterateSkippedTransactions(t *testing.T) {
100100
}
101101

102102
for _, tx := range txs {
103-
WriteSkippedTransaction(db, tx, "random reason", 1, &common.Hash{1})
103+
WriteSkippedTransaction(db, tx, nil, "random reason", 1, &common.Hash{1})
104104
}
105105

106106
// simulate skipped L2 tx that's not included in the index
107107
l2tx := newTestTransaction(6)
108-
writeSkippedTransaction(db, l2tx, "random reason", 1, &common.Hash{1})
108+
writeSkippedTransaction(db, l2tx, nil, "random reason", 1, &common.Hash{1})
109109

110110
it := IterateSkippedTransactionsFrom(db, 2)
111111
defer it.Release()

internal/ethapi/api.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ func NewRPCTransaction(tx *types.Transaction, traces *types.BlockTrace, blockHas
13601360
R: (*hexutil.Big)(r),
13611361
S: (*hexutil.Big)(s),
13621362

1363-
Traces: traces,
1363+
Traces: traces,
13641364
}
13651365
if blockHash != (common.Hash{}) {
13661366
result.BlockHash = &blockHash

miner/worker.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ loop:
11371137
if w.config.StoreSkippedTxTraces {
11381138
rawdb.WriteSkippedTransaction(w.eth.ChainDb(), tx, traces, "unknown circuit capacity checker error", w.current.header.Number.Uint64(), nil)
11391139
} else {
1140-
rawdb.WriteSkippedTransaction(w.eth.ChainDb(), tx, nil, "unknown circuit capacity checker error", w.current.header.Number.Uint64(), nil)
1140+
rawdb.WriteSkippedTransaction(w.eth.ChainDb(), tx, nil, "unknown circuit capacity checker error", w.current.header.Number.Uint64(), nil)
11411141
}
11421142
l1TxCccUnknownErrCounter.Inc(1)
11431143

@@ -1155,7 +1155,7 @@ loop:
11551155
if w.config.StoreSkippedTxTraces {
11561156
rawdb.WriteSkippedTransaction(w.eth.ChainDb(), tx, traces, "unknown circuit capacity checker error", w.current.header.Number.Uint64(), nil)
11571157
} else {
1158-
rawdb.WriteSkippedTransaction(w.eth.ChainDb(), tx, nil, "unknown circuit capacity checker error", w.current.header.Number.Uint64(), nil)
1158+
rawdb.WriteSkippedTransaction(w.eth.ChainDb(), tx, nil, "unknown circuit capacity checker error", w.current.header.Number.Uint64(), nil)
11591159
}
11601160
l2TxCccUnknownErrCounter.Inc(1)
11611161

@@ -1177,7 +1177,7 @@ loop:
11771177
if w.config.StoreSkippedTxTraces {
11781178
rawdb.WriteSkippedTransaction(w.eth.ChainDb(), tx, traces, fmt.Sprintf("strange error: %v", err), w.current.header.Number.Uint64(), nil)
11791179
} else {
1180-
rawdb.WriteSkippedTransaction(w.eth.ChainDb(), tx, nil, fmt.Sprintf("strange error: %v", err), w.current.header.Number.Uint64(), nil)
1180+
rawdb.WriteSkippedTransaction(w.eth.ChainDb(), tx, nil, fmt.Sprintf("strange error: %v", err), w.current.header.Number.Uint64(), nil)
11811181
}
11821182
l1TxStrangeErrCounter.Inc(1)
11831183
}

0 commit comments

Comments
 (0)