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

Commit

Permalink
Merge 915f841 into 467c3ea
Browse files Browse the repository at this point in the history
  • Loading branch information
jseagrave21 committed Jul 15, 2019
2 parents 467c3ea + 915f841 commit eeaa278
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ All notable changes to this project are documented in this file.
- Fix ``BigInteger`` modulo for negative divisor values
- Fix ``GetBoolean()`` for ``Array`` stackitem
- Fix ``BigInteger`` division for negative dividend values
- Add functionality for RawTransaction class
- Fix ``GetPriceForSysCall()`` for a ``Neo.Contract.Create`` syscall with invalid contract properties


Expand Down
6 changes: 5 additions & 1 deletion neo/Core/TX/Transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,16 +688,20 @@ def Verify(self, snapshot, mempool):
# return False
#

def GetScriptHashesForVerifying(self, snapshot):
def GetScriptHashesForVerifying(self, snapshot=None):
"""
Get a list of script hashes for verifying transactions.
Raises:
Exception: if there are no valid assets in the transaction.
ValueError: if a snapshot object is not provided for regular transactions. RawTx is exempt from this check.
Returns:
list: of UInt160 type script hashes.
"""
if snapshot is None and not self.raw_tx:
raise ValueError("Snapshot cannot be None for regular transaction types")

if not self.References and len(self.Attributes) < 1:
return []

Expand Down
5 changes: 4 additions & 1 deletion neo/SmartContract/ContractParameterContext.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ class ContractParametersContext:
def __init__(self, verifiable, isMultiSig=False):

self.Verifiable = verifiable
self.ScriptHashes = verifiable.GetScriptHashesForVerifying(GetBlockchain()._db.createSnapshot())
if verifiable.raw_tx:
self.ScriptHashes = verifiable.GetScriptHashesForVerifying()
else:
self.ScriptHashes = verifiable.GetScriptHashesForVerifying(GetBlockchain()._db.createSnapshot())
self.ContextItems = {}
self.IsMultiSig = isMultiSig

Expand Down

0 comments on commit eeaa278

Please sign in to comment.