Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
Merge branch 'development' of github.com:localhuman/neo-python into d…
Browse files Browse the repository at this point in the history
…evelopment
  • Loading branch information
localhuman committed Oct 21, 2017
2 parents dd0931f + 2023e6d commit 7a2dd77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion neo/SmartContract/StateMachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def CheckStorageContext(self, context):
contract = self._contracts.TryGet(context.ScriptHash.ToBytes())

if contract is not None:
if contract is not None and contract.HasStorage:
if contract.HasStorage:
return True

return False
Expand Down
10 changes: 7 additions & 3 deletions neo/SmartContract/StateReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,15 +705,19 @@ def Storage_Get(self, engine):
return False


if not self.CheckStorageContext(context):
contract = Blockchain.Default().GetContract(context.ScriptHash.ToBytes())

if contract is not None:
if not contract.HasStorage:
return False
else:
return False


key = engine.EvaluationStack.Pop().GetByteArray()
storage_key = StorageKey(script_hash=context.ScriptHash, key = key)

# @TODO Replace _storages in state reader
item = Blockchain.Default().GetStorageItem(storage_key.GetHashCodeBytes())
# item = self._storages.TryGet(storage_key.GetHashCodeBytes())

keystr = key

Expand Down

0 comments on commit 7a2dd77

Please sign in to comment.