From 8a2edad2c6d2a5a33bee54260c39288a82000e0d Mon Sep 17 00:00:00 2001 From: Erik van den Brink Date: Wed, 5 Jun 2019 17:25:05 +0200 Subject: [PATCH 1/2] fix syscalls --- CHANGELOG.rst | 1 + neo/SmartContract/StateMachine.py | 4 ++-- neo/SmartContract/StateReader.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index acd75f1f3..fe697bd05 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 diff --git a/neo/SmartContract/StateMachine.py b/neo/SmartContract/StateMachine.py index 8b1e263fe..b2cf9ef64 100644 --- a/neo/SmartContract/StateMachine.py +++ b/neo/SmartContract/StateMachine.py @@ -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): diff --git a/neo/SmartContract/StateReader.py b/neo/SmartContract/StateReader.py index a3c20d61a..1e791c5dc 100644 --- a/neo/SmartContract/StateReader.py +++ b/neo/SmartContract/StateReader.py @@ -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 From 8b4b89445885166bcd9b5197d21e8af1791f0230 Mon Sep 17 00:00:00 2001 From: Erik van den Brink Date: Wed, 5 Jun 2019 19:25:59 +0200 Subject: [PATCH 2/2] update neo-boa commit requirement --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d90709e59..71224d30e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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