From 270ea6eec330962d083fb66453cee563985114c2 Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Wed, 16 Mar 2016 11:19:25 +0200 Subject: accounts/abi: handle the "constant" modifier for functions --- accounts/abi/method.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'accounts/abi/method.go') diff --git a/accounts/abi/method.go b/accounts/abi/method.go index e259c09aa..206c7d408 100644 --- a/accounts/abi/method.go +++ b/accounts/abi/method.go @@ -67,8 +67,11 @@ func (m Method) String() string { } outputs[i] += output.Type.String() } - - return fmt.Sprintf("function %v(%v) returns(%v)", m.Name, strings.Join(inputs, ", "), strings.Join(outputs, ", ")) + constant := "" + if m.Const { + constant = "constant " + } + return fmt.Sprintf("function %v(%v) %sreturns(%v)", m.Name, strings.Join(inputs, ", "), constant, strings.Join(outputs, ", ")) } func (m Method) Id() []byte { -- cgit