Skip to content

Commit

Permalink
fix rebase conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
jangko committed Aug 4, 2023
1 parent 79425e5 commit b92acf2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 33 deletions.
15 changes: 4 additions & 11 deletions nimbus/db/accounts_cache.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@

import
std/[tables, hashes, sets],
eth/[common, rlp], eth/trie/[hexary, db, trie_defs],
../constants, ../utils/[utils, eof], storage_types,
eth/[common, rlp],
../constants, ../utils/[utils, eof],
../../stateless/multi_keys,
../constants,
../utils/utils,
./access_list as ac_access_list,
"."/[core_db, distinct_tries, storage_types, transient_storage]

Expand Down Expand Up @@ -384,9 +382,9 @@ proc loadCode(acc: RefAccount, ac: AccountsCache) =
return

when defined(geth):
let data = ac.db.get(acc.account.codeHash.data)
let data = ac.kvt.get(acc.account.codeHash.data)
else:
let data = ac.db.get(contractHashKey(acc.account.codeHash).toOpenArray)
let data = ac.kvt.get(contractHashKey(acc.account.codeHash).toOpenArray)

acc.code = data
acc.flags.incl CodeLoaded
Expand All @@ -395,10 +393,6 @@ proc getCode*(ac: AccountsCache, address: EthAddress): seq[byte] =
let acc = ac.getAccount(address, false)
if acc.isNil:
return
<<<<<<< HEAD
acc.loadCode(ac)
acc.code
=======

if CodeLoaded in acc.flags or CodeChanged in acc.flags:
result = acc.code
Expand All @@ -411,7 +405,6 @@ proc getCode*(ac: AccountsCache, address: EthAddress): seq[byte] =
acc.code = data
acc.flags.incl CodeLoaded
result = acc.code
>>>>>>> master

proc getCodeSize*(ac: AccountsCache, address: EthAddress): int {.inline.} =
let acc = ac.getAccount(address, false)
Expand Down
2 changes: 1 addition & 1 deletion nimbus/evm/computation.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import
".."/[db/accounts_cache, constants],
"."/[code_stream, memory, message, stack, state],
"."/[transaction_tracer, types, validate],
"."/[types, validate],
./interpreter/[gas_meter, gas_costs, op_codes],
../common/[common, evmforks],
../utils/[utils, eof],
Expand Down
19 changes: 0 additions & 19 deletions nimbus/evm/types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,6 @@ type
minerAddress* : EthAddress
asyncFactory* : AsyncOperationFactory

<<<<<<< HEAD
TracerFlags* {.pure.} = enum
EnableTracing
DisableStorage
DisableMemory
DisableStack
DisableState
DisableStateDiff
EnableAccount
DisableReturnData
GethCompatibility

TransactionTracer* = object
trace*: JsonNode
flags*: set[TracerFlags]
accounts*: HashSet[EthAddress]
storageKeys*: seq[HashSet[UInt256]]
gasUsed*: GasInt

# EIP-4750
ReturnContext* = object
section*: int
Expand Down
4 changes: 2 additions & 2 deletions tests/test_eof.nim
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ proc initEnv(): TestEnv =

let
com = CommonRef.new(
newMemoryDb(),
newCoreDbRef LegacyDbMemory,
conf.pruneMode == PruneMode.Full,
conf.networkId,
conf.networkParams
Expand Down Expand Up @@ -315,7 +315,7 @@ proc eofMain*() =

test "check flags and various deployment mechanisms":
var state = AccountsCache.init(
com.db.db,
com.db,
stateRoot,
com.pruneTrie)

Expand Down

0 comments on commit b92acf2

Please sign in to comment.