aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/abi/method.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-03-16 19:12:14 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-03-16 19:12:14 +0800
commit8b6ae6bf86091483a7514b272bafcf730def0200 (patch)
treeab961c903c234a8997e24defedd018f9b1157ede /accounts/abi/method.go
parent2855a93ede6e9437d05a82c2397d48744621db9b (diff)
parent270ea6eec330962d083fb66453cee563985114c2 (diff)
downloaddexon-8b6ae6bf86091483a7514b272bafcf730def0200.tar
dexon-8b6ae6bf86091483a7514b272bafcf730def0200.tar.gz
dexon-8b6ae6bf86091483a7514b272bafcf730def0200.tar.bz2
dexon-8b6ae6bf86091483a7514b272bafcf730def0200.tar.lz
dexon-8b6ae6bf86091483a7514b272bafcf730def0200.tar.xz
dexon-8b6ae6bf86091483a7514b272bafcf730def0200.tar.zst
dexon-8b6ae6bf86091483a7514b272bafcf730def0200.zip
Merge pull request #2355 from karalabe/abi-constant-functions-2
accounts/abi: handle the "constant" modifier for functions
Diffstat (limited to 'accounts/abi/method.go')
-rw-r--r--accounts/abi/method.go7
1 files changed, 5 insertions, 2 deletions
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 {