mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-11 22:43:47 +00:00
abigen: replace space-prefixed lines with tabs
This commit is contained in:
parent
868e3c6552
commit
6868cd49d9
1 changed files with 13 additions and 13 deletions
|
|
@ -112,14 +112,14 @@ var (
|
||||||
}
|
}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
// Unpack{{.Normalized.Name}} is the Go binding that unpacks the parameters returned
|
// Unpack{{.Normalized.Name}} is the Go binding that unpacks the parameters returned
|
||||||
// from invoking the contract method with ID 0x{{printf "%x" .Original.ID}}.
|
// from invoking the contract method with ID 0x{{printf "%x" .Original.ID}}.
|
||||||
//
|
//
|
||||||
// Solidity: {{.Original.String}}
|
// Solidity: {{.Original.String}}
|
||||||
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) Unpack{{.Normalized.Name}}(data []byte) (
|
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) Unpack{{.Normalized.Name}}(data []byte) (
|
||||||
{{- if .Structured}} {{.Normalized.Name}}Output,{{else}}
|
{{- if .Structured}} {{.Normalized.Name}}Output,{{else}}
|
||||||
{{- range .Normalized.Outputs}} {{bindtype .Type $structs}},{{- end }}
|
{{- range .Normalized.Outputs}} {{bindtype .Type $structs}},{{- end }}
|
||||||
{{- end }} error) {
|
{{- end }} error) {
|
||||||
out, err := {{ decapitalise $contract.Type}}.abi.Unpack("{{.Original.Name}}", data)
|
out, err := {{ decapitalise $contract.Type}}.abi.Unpack("{{.Original.Name}}", data)
|
||||||
{{- if .Structured}}
|
{{- if .Structured}}
|
||||||
outstruct := new({{.Normalized.Name}}Output)
|
outstruct := new({{.Normalized.Name}}Output)
|
||||||
|
|
@ -201,12 +201,12 @@ var (
|
||||||
// UnpackError attempts to decode the provided error data using user-defined
|
// UnpackError attempts to decode the provided error data using user-defined
|
||||||
// error definitions.
|
// error definitions.
|
||||||
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) UnpackError(raw []byte) (any, error) {
|
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) UnpackError(raw []byte) (any, error) {
|
||||||
{{- range $k, $v := .Errors}}
|
{{- range $k, $v := .Errors}}
|
||||||
if bytes.Equal(raw[:4], {{ decapitalise $contract.Type}}.abi.Errors["{{.Normalized.Name}}"].ID.Bytes()[:4]) {
|
if bytes.Equal(raw[:4], {{ decapitalise $contract.Type}}.abi.Errors["{{.Normalized.Name}}"].ID.Bytes()[:4]) {
|
||||||
return {{ decapitalise $contract.Type}}.Unpack{{.Normalized.Name}}Error(raw[4:])
|
return {{ decapitalise $contract.Type}}.Unpack{{.Normalized.Name}}Error(raw[4:])
|
||||||
}
|
}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
return nil, errors.New("Unknown error")
|
return nil, errors.New("Unknown error")
|
||||||
}
|
}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue