Skip to content

Commit e37b4c1

Browse files
committed
Remove embedded field Agent from selector.
1 parent f4d0b76 commit e37b4c1

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

gen/generator_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func ExampleNewGenerator() {
4848
// // Inc calls the "inc" method on the "test" canister.
4949
// func (a TestAgent) Inc() (*idl.Nat, error) {
5050
// var r0 idl.Nat
51-
// if err := a.Agent.Call(
51+
// if err := a.Call(
5252
// a.CanisterId,
5353
// "inc",
5454
// []any{},
@@ -102,7 +102,7 @@ func ExampleNewGenerator_indirect() {
102102
// // Inc calls the "inc" method on the "test" canister.
103103
// func (a TestAgent) Inc() (*idl.Nat, error) {
104104
// var r0 idl.Nat
105-
// if err := a.Agent.Call(
105+
// if err := a.Call(
106106
// a.CanisterId,
107107
// "inc",
108108
// []any{},
@@ -115,7 +115,7 @@ func ExampleNewGenerator_indirect() {
115115
//
116116
// // IncCall creates an indirect representation of the "inc" method on the "test" canister.
117117
// func (a TestAgent) IncCall() (*agent.CandidAPIRequest, error) {
118-
// return a.Agent.CreateCandidAPIRequest(
118+
// return a.CreateCandidAPIRequest(
119119
// agent.RequestTypeCall,
120120
// a.CanisterId,
121121
// "inc",
@@ -173,7 +173,7 @@ func ExampleNewGenerator_tags() {
173173
// // Test calls the "test" method on the "test" canister.
174174
// func (a TestAgent) Test() (*[]Resp, error) {
175175
// var r0 []Resp
176-
// if err := a.Agent.Call(
176+
// if err := a.Call(
177177
// a.CanisterId,
178178
// "test",
179179
// []any{},

gen/templates/agent.gotmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (a {{ $.AgentName }}Agent) {{ .Name }}({{ range $i, $e := .ArgumentTypes }}
4040
{{ range $i, $e := .ReturnTypes -}}
4141
var r{{ $i }} {{ $e }}
4242
{{ end -}}
43-
if err := a.Agent.{{ .Type }}(
43+
if err := a.{{ .Type }}(
4444
a.CanisterId,
4545
"{{ .RawName }}",
4646
[]any{{ "{" }}{{ range $i, $e := .ArgumentTypes }}{{ if $i }}, {{ end }}{{ $e.Name }}{{ end }}{{ "}" }},

gen/templates/agent_indirect.gotmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (a {{ $.AgentName }}Agent) {{ .Name }}({{ range $i, $e := .ArgumentTypes }}
4040
{{ range $i, $e := .ReturnTypes -}}
4141
var r{{ $i }} {{ $e }}
4242
{{ end -}}
43-
if err := a.Agent.{{ .Type }}(
43+
if err := a.{{ .Type }}(
4444
a.CanisterId,
4545
"{{ .RawName }}",
4646
[]any{{ "{" }}{{ range $i, $e := .ArgumentTypes }}{{ if $i }}, {{ end }}{{ $e.Name }}{{ end }}{{ "}" }},
@@ -53,7 +53,7 @@ func (a {{ $.AgentName }}Agent) {{ .Name }}({{ range $i, $e := .ArgumentTypes }}
5353

5454
// {{ .Name }}{{ .Type }} creates an indirect representation of the "{{ .RawName }}" method on the "{{ $.CanisterName }}" canister.
5555
func (a {{ $.AgentName }}Agent) {{ .Name }}{{ .Type }}({{ range $i, $e := .ArgumentTypes }}{{ if $i }}, {{ end }}{{ $e.Name }} {{ $e.Type }}{{ end }}) (*agent.CandidAPIRequest, error) {
56-
return a.Agent.CreateCandidAPIRequest(
56+
return a.CreateCandidAPIRequest(
5757
agent.RequestType{{ .Type }},
5858
a.CanisterId,
5959
"{{ .RawName }}",{{ range $i, $e := .ArgumentTypes }}

0 commit comments

Comments
 (0)