Skip to content

Commit

Permalink
Modify list parameters handling to remove useless OpCodes and reduce …
Browse files Browse the repository at this point in the history
…fees.
  • Loading branch information
Valentin DocTeller committed Mar 28, 2023
1 parent bcb1ef1 commit ad3f136
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Changelog

All notable changes to this project are documented in this file.

[1.1.1] 2023-03-28
------------------
- Modify list parameters handling to remove useless OpCodes and reduce fees.

[0.9.4] 2021-11-30
------------------
- Fixes as a result of Auditing the latest blocks on the network.
Expand Down
2 changes: 1 addition & 1 deletion neo3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

__version__ = "1.1.0"
__version__ = "1.1.1"

core_logger = logging.getLogger("neo3.core")
network_logger = logging.getLogger("neo3.network")
12 changes: 7 additions & 5 deletions neo3/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,13 @@ def emit_push(self, value) -> ScriptBuilder:
self.emit_raw(value)
return self
elif isinstance(value, Sequence):
self.emit(OpCode.NEWARRAY0)
for v in value:
self.emit(OpCode.DUP)
self.emit_push(v)
self.emit(OpCode.APPEND)
for item in reversed(value):
if isinstance(item, Sequence):
self.emit_push(item)
continue
self.emit_push(item)
self.emit_push(len(value))
self.emit(OpCode.PACK)
return self
elif isinstance(value, dict):
for k, v in value.items():
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.1.0
current_version = 1.1.1
commit = True
tag = True

Expand Down

0 comments on commit ad3f136

Please sign in to comment.