Skip to content

Commit

Permalink
wip refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Jun 13, 2023
1 parent ca31d2e commit 44163ac
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions boa/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ def enable_pyevm_verbose_logging():
setup_DEBUG2_logging()
logger.setLevel("DEBUG2")

import copy
import copyreg
import pickle

import lru

def pickle_lru(lru_obj):
return ( lru.LRU, (lru_obj.get_size(),), None, None, iter(lru_obj.items()),)

copyreg.pickle(lru.LRU, pickle_lru)


class VMPatcher:
_exc_patchables = {
Expand Down Expand Up @@ -362,22 +373,6 @@ def apply_message(cls, state, message, tx_ctx):
computation = cls.apply_computation(state, message, tx_ctx)

db = state._account_db
import copy
import copyreg
import pickle

import lru

def pickle_lru(lru_obj):
return (
lru.LRU,
(lru_obj.get_size(),),
None,
None,
iter(lru_obj.items()),
)

copyreg.pickle(lru.LRU, pickle_lru)

computation._restore_state = copy.deepcopy(
(
Expand Down

0 comments on commit 44163ac

Please sign in to comment.