From f7bf5ef4e77395a52549fd40578d34fc60e79be8 Mon Sep 17 00:00:00 2001 From: ixje Date: Fri, 21 Apr 2023 11:03:16 +0200 Subject: [PATCH] python: fix generated contract methods (#7) --- generators/python.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generators/python.go b/generators/python.go index 816e40d..5732ddd 100644 --- a/generators/python.go +++ b/generators/python.go @@ -27,6 +27,8 @@ import ( const pythonSrcTmpl = ` {{- define "METHOD" }} @staticmethod + {{- if ne .NameABI .Name}} + @display_name("{{.NameABI }}"){{end}} def {{.Name}}({{range $index, $arg := .Arguments -}} {{- if ne $index 0}}, {{end}} {{- .Name}}: {{.Type}} @@ -34,7 +36,7 @@ const pythonSrcTmpl = ` pass {{- end -}} from boa3.builtin.type import UInt160, UInt256, ECPoint -from boa3.builtin.compile_time import contract +from boa3.builtin.compile_time import contract, display_name from typing import cast, Any