accounts/abi: handle the "constant" modifier for functions

This commit is contained in:
Péter Szilágyi
2016-03-16 11:19:25 +02:00
parent 2855a93ede
commit 270ea6eec3
2 changed files with 12 additions and 9 deletions

View File

@ -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 {