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

Fix Runtime.Trigger and Transaction.GetType syscalls #957

Merged
merged 2 commits into from
Jun 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ All notable changes to this project are documented in this file.
- Include address aliases in ``wallet`` command output
- Fix ``config maxpeers`` and update tests
- Fix error while parsing list arguments from prompt for smart contract test invocations
- Fix ``Runtime.GetTrigger`` and ``Transaction.GetType`` syscalls pushing wrong StackItem type


[0.8.4] 2019-02-14
Expand Down
4 changes: 2 additions & 2 deletions neo/SmartContract/StateMachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,9 @@ def Transaction_GetType(self, engine: ExecutionEngine):
return False

if isinstance(tx.Type, bytes):
engine.CurrentContext.EvaluationStack.PushT(tx.Type)
engine.CurrentContext.EvaluationStack.PushT(int.from_bytes(tx.Type, 'little'))
else:
engine.CurrentContext.EvaluationStack.PushT(tx.Type.to_bytes(1, 'little'))
engine.CurrentContext.EvaluationStack.PushT(tx.Type)
return True

def Transaction_GetAttributes(self, engine: ExecutionEngine):
Expand Down
2 changes: 1 addition & 1 deletion neo/SmartContract/StateReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def Runtime_Platform(self, engine):

def Runtime_GetTrigger(self, engine):

engine.CurrentContext.EvaluationStack.PushT(engine.Trigger)
engine.CurrentContext.EvaluationStack.PushT(int.from_bytes(engine.Trigger, 'little'))

return True

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mmh3==2.5.1
mock==2.0.0
mpmath==1.1.0
multidict==4.5.2
git+https://github.com/ixje/neo-boa@01ea0207250c8ee96bca673e6e587796888e58d1#egg=neo-boa
git+https://github.com/ixje/neo-boa@6bc33703b80e687d5fb9eed2e1f5e6708221c13d#egg=neo-boa
neo-python-rpc==0.2.1
pbr==5.1.3
peewee==3.9.2
Expand Down