Пример #1
0
 def _get_account(self, address):
     rlp_account = self._journaltrie.get(address, b'')
     if rlp_account:
         account = rlp.decode(rlp_account, sedes=Account)
     else:
         account = Account()
     return account
Пример #2
0
 def _get_account(self, address):
     if address in self.state:
         account = rlp.decode(self.state[address], sedes=Account)
         account._mutable = True
     else:
         account = Account()
     return account
Пример #3
0
 def _get_account(self, address):
     rlp_account = self._trie[address]
     if rlp_account:
         account = rlp.decode(rlp_account, sedes=Account)
         account._mutable = True
     else:
         account = Account()
     return account
Пример #4
0
    def _get_account(self, address):
        cache_key = (id(self._unwrapped_db), self.state_root, address)
        if cache_key not in account_cache:
            account_cache[cache_key] = self._trie[address]

        rlp_account = account_cache[cache_key]
        if rlp_account:
            account = rlp.decode(rlp_account, sedes=Account)
        else:
            account = Account()
        return account
Пример #5
0
    def _get_account(self, address):
        cache_key = (self._unwrapped_db, self.root_hash, address)
        if cache_key not in account_cache:
            account_cache[cache_key] = self._trie[address]

        rlp_account = account_cache[cache_key]
        if rlp_account:
            account = rlp.decode(rlp_account, sedes=Account)
            account._mutable = True
        else:
            account = Account()
        return account
Пример #6
0
 def touch_account(self, address):
     if not self.account_exists(address):
         self._set_account(address, Account())