Skip to content

Commit

Permalink
https://github.com/neo-project/neo/pull/1507
Browse files Browse the repository at this point in the history
  • Loading branch information
ixje committed Jan 12, 2021
1 parent 85a37c0 commit 39eeaef
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions neo3/network/payloads/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class Witness(serialization.ISerializable):
"""
An executable verification script that validates a verifiable object like a transaction.
"""

def __init__(self, invocation_script: bytes, verification_script: bytes):
#: A set of VM instructions to setup the stack for verification.
self.invocation_script = invocation_script
Expand Down Expand Up @@ -137,6 +138,17 @@ def script_hash(self) -> types.UInt160:
def _serializable_init(cls):
return cls(b'', b'')

@property
def state_dependent(self):
return len(self.verification_script) == 0


class WitnessFlag(IntFlag):
NONE = 0,
StateIndependent = 0b00000001,
StateDependent = 0b00000010,
All = StateIndependent | StateDependent


class WitnessScope(IntFlag):
"""
Expand Down

0 comments on commit 39eeaef

Please sign in to comment.