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

Commit

Permalink
Fix Runtime.Trigger and Transaction.GetType syscalls (#957)
Browse files Browse the repository at this point in the history
* fix syscalls

* update neo-boa commit requirement
  • Loading branch information
ixje committed Jun 5, 2019
1 parent 9d3b4a0 commit 60c8f8c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
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

0 comments on commit 60c8f8c

Please sign in to comment.