From 80b65ae7e746645568a1d3b16abcd0e344629be6 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Mon, 18 Mar 2019 18:13:49 -0400 Subject: [PATCH] OP_0 can be an OP but also an empty string, figure this out contextually in parser --- torba/client/basescript.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/torba/client/basescript.py b/torba/client/basescript.py index 3b8b43783..e452a4b3f 100644 --- a/torba/client/basescript.py +++ b/torba/client/basescript.py @@ -158,6 +158,8 @@ class Parser: while self.token_index < len(self.tokens) and self.opcode_index < len(self.opcodes): token = self.tokens[self.token_index] opcode = self.opcodes[self.opcode_index] + if token.value == 0 and isinstance(opcode, PUSH_SINGLE): + token = DataToken(b'') if isinstance(token, DataToken): if isinstance(opcode, (PUSH_SINGLE, PUSH_INTEGER, PUSH_SUBSCRIPT)): self.push_single(opcode, token.value)