core,eth: fix TestDeduplication, TestSyncAccountPerformance, TestTraceTransaction

This commit is contained in:
Raneet Debnath 2023-07-04 19:16:19 +05:30
parent 616e33f290
commit b605c3848e
No known key found for this signature in database
GPG key ID: C232FD2D870BCD3D
3 changed files with 5 additions and 4 deletions

View file

@ -2383,7 +2383,7 @@ func TestDeduplication(t *testing.T) {
errs := pool.AddRemotesSync(firsts)
if len(errs) != 0 {
if len(errs) != len(firsts) {
t.Fatalf("first add mismatching result count: have %d, want %d", len(errs), 0)
}
@ -2405,7 +2405,7 @@ func TestDeduplication(t *testing.T) {
// Try to add all of them now and ensure previous ones error out as knowns
errs = pool.AddRemotesSync(txs)
if len(errs) != 0 {
if len(errs) != len(txs) {
t.Fatalf("all add mismatching result count: have %d, want %d", len(errs), 0)
}

View file

@ -1529,10 +1529,9 @@ func makeAccountTrieNoStorage(n int) (string, *trie.Trie, entrySlice) {
var (
db = trie.NewDatabase(rawdb.NewMemoryDatabase())
accTrie = trie.NewEmpty(db)
entries entrySlice
)
entries := make(entrySlice, uint64(n))
for i := uint64(1); i <= uint64(n); i++ {
value, _ := rlp.EncodeToBytes(&types.StateAccount{
Nonce: i,

View file

@ -1193,6 +1193,8 @@ func (api *API) TraceTransaction(ctx context.Context, hash common.Hash, config *
return &ethapi.ExecutionResult{
StructLogs: make([]ethapi.StructLogRes, 0),
}, nil
} else {
return nil, errTxNotFound
}
}