Skip to content

Commit bcc305d

Browse files
jwasingerfjl
authored andcommitted
remove unused comment. add method description for RawCreationTransact
1 parent 1dd531a commit bcc305d

File tree

3 files changed

+35
-35
lines changed

3 files changed

+35
-35
lines changed

accounts/abi/bind/base.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ func (c *BoundContract) RawTransact(opts *TransactOpts, calldata []byte) (*types
266266
return c.transact(opts, &c.address, calldata)
267267
}
268268

269+
// RawTransact initiates a contract-creation transaction with the given raw calldata as the input.
269270
func (c *BoundContract) RawCreationTransact(opts *TransactOpts, calldata []byte) (*types.Transaction, error) {
270271
return c.transact(opts, nil, calldata)
271272
}

accounts/abi/bind/dep_tree.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ func (d *depTreeDeployer) result() *DeploymentResult {
122122
// libraries. If an error occurs, only contracts which were successfully
123123
// deployed are returned in the result.
124124
func LinkAndDeploy(deployParams *DeploymentParams, deploy DeployFn) (res *DeploymentResult, err error) {
125-
//deployParams.inputs = make(map[string][]byte)
126125
deployer := newDepTreeDeployer(deployParams, deploy)
127126
for _, contract := range deployParams.contracts {
128127
if _, err := deployer.linkAndDeploy(contract); err != nil {

accounts/abi/bind/source2.go.tpl

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var (
4444
{{if .Libraries -}}
4545
Deps: []*bind.MetaData{
4646
{{- range $name, $pattern := .Libraries}}
47-
{{$name}}MetaData,
47+
{{$name}}MetaData,
4848
{{- end}}
4949
},
5050
{{end}}
@@ -79,12 +79,12 @@ var (
7979

8080
{{/* Unpack method is needed only when there are return args */}}
8181
{{if .Normalized.Outputs }}
82-
{{ if .Structured }}
83-
type {{.Normalized.Name}}Output struct {
84-
{{range .Normalized.Outputs}}
85-
{{.Name}} {{bindtype .Type $structs}}{{end}}
86-
}
87-
{{ end }}
82+
{{ if .Structured }}
83+
type {{.Normalized.Name}}Output struct {
84+
{{range .Normalized.Outputs}}
85+
{{.Name}} {{bindtype .Type $structs}}{{end}}
86+
}
87+
{{ end }}
8888
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) Unpack{{.Normalized.Name}}(data []byte) ({{if .Structured}} {{.Normalized.Name}}Output,{{else}}{{range .Normalized.Outputs}}{{bindtype .Type $structs}},{{end}}{{end}} error) {
8989
out, err := {{ decapitalise $contract.Type}}.abi.Unpack("{{.Original.Name}}", data)
9090
{{if .Structured}}
@@ -94,9 +94,9 @@ var (
9494
}
9595
{{range $i, $t := .Normalized.Outputs}}
9696
{{if ispointertype .Type}}
97-
outstruct.{{.Name}} = abi.ConvertType(out[{{$i}}], new({{underlyingbindtype .Type }})).({{bindtype .Type $structs}})
97+
outstruct.{{.Name}} = abi.ConvertType(out[{{$i}}], new({{underlyingbindtype .Type }})).({{bindtype .Type $structs}})
9898
{{ else }}
99-
outstruct.{{.Name}} = *abi.ConvertType(out[{{$i}}], new({{bindtype .Type $structs}})).(*{{bindtype .Type $structs}})
99+
outstruct.{{.Name}} = *abi.ConvertType(out[{{$i}}], new({{bindtype .Type $structs}})).(*{{bindtype .Type $structs}})
100100
{{ end }}{{end}}
101101

102102
return *outstruct, err
@@ -125,7 +125,7 @@ var (
125125
Raw *types.Log // Blockchain specific contextual infos
126126
}
127127

128-
const {{$contract.Type}}{{.Normalized.Name}}EventName = "{{.Original.Name}}"
128+
const {{$contract.Type}}{{.Normalized.Name}}EventName = "{{.Original.Name}}"
129129

130130
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) Unpack{{.Normalized.Name}}Event(log *types.Log) (*{{$contract.Type}}{{.Normalized.Name}}, error) {
131131
event := "{{.Original.Name}}"
@@ -152,25 +152,25 @@ var (
152152
}
153153
{{end}}
154154

155-
{{ if .Errors }}
156-
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) UnpackError(raw []byte) any {
157-
{{$i := 0}}
158-
{{range $k, $v := .Errors}}
159-
{{ if eq $i 0 }}
160-
if val, err := {{ decapitalise $contract.Type}}.Unpack{{.Normalized.Name}}Error(raw); err == nil {
161-
return val
162-
{{ else }}
163-
} else if val, err := {{ decapitalise $contract.Type}}.Unpack{{.Normalized.Name}}Error(raw); err == nil {
164-
return val
165-
{{ end -}}
166-
{{$i = add $i 1}}
167-
{{end -}}
168-
}
169-
return nil
170-
}
171-
{{ end -}}
172-
173-
{{range .Errors}}
155+
{{ if .Errors }}
156+
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) UnpackError(raw []byte) any {
157+
{{$i := 0}}
158+
{{range $k, $v := .Errors}}
159+
{{ if eq $i 0 }}
160+
if val, err := {{ decapitalise $contract.Type}}.Unpack{{.Normalized.Name}}Error(raw); err == nil {
161+
return val
162+
{{ else }}
163+
} else if val, err := {{ decapitalise $contract.Type}}.Unpack{{.Normalized.Name}}Error(raw); err == nil {
164+
return val
165+
{{ end -}}
166+
{{$i = add $i 1}}
167+
{{end -}}
168+
}
169+
return nil
170+
}
171+
{{ end -}}
172+
173+
{{range .Errors}}
174174
// {{$contract.Type}}{{.Normalized.Name}} represents a {{.Normalized.Name}} error raised by the {{$contract.Type}} contract.
175175
type {{$contract.Type}}{{.Normalized.Name}} struct { {{range .Normalized.Inputs}}
176176
{{capitalise .Name}} {{if .Indexed}}{{bindtopictype .Type $structs}}{{else}}{{bindtype .Type $structs}}{{end}}; {{end}}
@@ -183,10 +183,10 @@ var (
183183
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) Unpack{{.Normalized.Name}}Error(raw []byte) (*{{$contract.Type}}{{.Normalized.Name}}, error) {
184184
errName := "{{.Normalized.Name}}"
185185
out := new({{$contract.Type}}{{.Normalized.Name}})
186-
if err := {{ decapitalise $contract.Type}}.abi.UnpackIntoInterface(out, errName, raw); err != nil {
187-
return nil, err
188-
}
186+
if err := {{ decapitalise $contract.Type}}.abi.UnpackIntoInterface(out, errName, raw); err != nil {
187+
return nil, err
188+
}
189189
return out, nil
190190
}
191-
{{end}}
192-
{{end}}
191+
{{end}}
192+
{{end}}

0 commit comments

Comments
 (0)