aboutsummaryrefslogtreecommitdiffstats
path: root/accounts
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-03-26 17:43:09 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-03-26 17:43:09 +0800
commitb813e4d411989a5a1f3606bd69fb888062dbed88 (patch)
treec09a89e94e7ef80e523ad66da85a8471a3c3ef50 /accounts
parent798e4fb4edb1a4a9be24815528b5296df8f5fcb1 (diff)
downloaddexon-b813e4d411989a5a1f3606bd69fb888062dbed88.tar
dexon-b813e4d411989a5a1f3606bd69fb888062dbed88.tar.gz
dexon-b813e4d411989a5a1f3606bd69fb888062dbed88.tar.bz2
dexon-b813e4d411989a5a1f3606bd69fb888062dbed88.tar.lz
dexon-b813e4d411989a5a1f3606bd69fb888062dbed88.tar.xz
dexon-b813e4d411989a5a1f3606bd69fb888062dbed88.tar.zst
dexon-b813e4d411989a5a1f3606bd69fb888062dbed88.zip
accounts/abi/bind, cmd/abigen: dedup structs, exclude patterns
Diffstat (limited to 'accounts')
-rw-r--r--accounts/abi/bind/template.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/accounts/abi/bind/template.go b/accounts/abi/bind/template.go
index 30df66365..01af19248 100644
--- a/accounts/abi/bind/template.go
+++ b/accounts/abi/bind/template.go
@@ -148,8 +148,8 @@ package {{.Package}}
{{range .Calls}}
{{if .Structured}}
- // {{.Normalized.Name}}Result is the result of the {{.Normalized.Name}} invocation."
- type {{.Normalized.Name}}Result struct {
+ // {{$contract.Type}}{{.Normalized.Name}}Result is the result of the {{.Normalized.Name}} invocation.
+ type {{$contract.Type}}{{.Normalized.Name}}Result struct {
{{range .Normalized.Outputs}}{{.Name}} {{bindtype .Type}}
{{end}}
}
@@ -158,9 +158,9 @@ package {{.Package}}
// {{.Normalized.Name}} is a free data retrieval call binding the contract method 0x{{printf "%x" .Original.Id}}.
//
// Solidity: {{.Original.String}}
- func (_{{$contract.Type}} *{{$contract.Type}}Caller) {{.Normalized.Name}}(opts *bind.CallOpts {{range .Normalized.Inputs}}, {{.Name}} {{bindtype .Type}} {{end}}) ({{if .Structured}}{{.Normalized.Name}}Result,{{else}}{{range .Normalized.Outputs}}{{bindtype .Type}},{{end}}{{end}} error) {
+ func (_{{$contract.Type}} *{{$contract.Type}}Caller) {{.Normalized.Name}}(opts *bind.CallOpts {{range .Normalized.Inputs}}, {{.Name}} {{bindtype .Type}} {{end}}) ({{if .Structured}}{{$contract.Type}}{{.Normalized.Name}}Result,{{else}}{{range .Normalized.Outputs}}{{bindtype .Type}},{{end}}{{end}} error) {
var (
- {{if .Structured}}ret = new({{.Normalized.Name}}Result){{else}}{{range $i, $_ := .Normalized.Outputs}}ret{{$i}} = new({{bindtype .Type}})
+ {{if .Structured}}ret = new({{$contract.Type}}{{.Normalized.Name}}Result){{else}}{{range $i, $_ := .Normalized.Outputs}}ret{{$i}} = new({{bindtype .Type}})
{{end}}{{end}}
)
out := {{if .Structured}}ret{{else}}{{if eq (len .Normalized.Outputs) 1}}ret0{{else}}[]interface{}{
@@ -174,14 +174,14 @@ package {{.Package}}
// {{.Normalized.Name}} is a free data retrieval call binding the contract method 0x{{printf "%x" .Original.Id}}.
//
// Solidity: {{.Original.String}}
- func (_{{$contract.Type}} *{{$contract.Type}}Session) {{.Normalized.Name}}({{range $i, $_ := .Normalized.Inputs}}{{if ne $i 0}},{{end}} {{.Name}} {{bindtype .Type}} {{end}}) ({{if .Structured}}{{.Normalized.Name}}Result, {{else}} {{range .Normalized.Outputs}}{{bindtype .Type}},{{end}} {{end}} error) {
+ func (_{{$contract.Type}} *{{$contract.Type}}Session) {{.Normalized.Name}}({{range $i, $_ := .Normalized.Inputs}}{{if ne $i 0}},{{end}} {{.Name}} {{bindtype .Type}} {{end}}) ({{if .Structured}}{{$contract.Type}}{{.Normalized.Name}}Result, {{else}} {{range .Normalized.Outputs}}{{bindtype .Type}},{{end}} {{end}} error) {
return _{{$contract.Type}}.Contract.{{.Normalized.Name}}(&_{{$contract.Type}}.CallOpts {{range .Normalized.Inputs}}, {{.Name}}{{end}})
}
// {{.Normalized.Name}} is a free data retrieval call binding the contract method 0x{{printf "%x" .Original.Id}}.
//
// Solidity: {{.Original.String}}
- func (_{{$contract.Type}} *{{$contract.Type}}CallerSession) {{.Normalized.Name}}({{range $i, $_ := .Normalized.Inputs}}{{if ne $i 0}},{{end}} {{.Name}} {{bindtype .Type}} {{end}}) ({{if .Structured}}{{.Normalized.Name}}Result, {{else}} {{range .Normalized.Outputs}}{{bindtype .Type}},{{end}} {{end}} error) {
+ func (_{{$contract.Type}} *{{$contract.Type}}CallerSession) {{.Normalized.Name}}({{range $i, $_ := .Normalized.Inputs}}{{if ne $i 0}},{{end}} {{.Name}} {{bindtype .Type}} {{end}}) ({{if .Structured}}{{$contract.Type}}{{.Normalized.Name}}Result, {{else}} {{range .Normalized.Outputs}}{{bindtype .Type}},{{end}} {{end}} error) {
return _{{$contract.Type}}.Contract.{{.Normalized.Name}}(&_{{$contract.Type}}.CallOpts {{range .Normalized.Inputs}}, {{.Name}}{{end}})
}
{{end}}