Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go_templates/client.vm
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ func (c *Client) getRaw(ctx context.Context, path string, body interface{}, head
// post sends a POST request to the given path with the given request object.
// No query parameters will be sent if request is nil.
// response must be a pointer to an object as post writes the response there.
func (c *Client) post(ctx context.Context, response interface{}, path string, body interface{}, headers []*common.Header) error {
return (*common.Client)(c).Post(ctx, response, path, body, headers)
func (c *Client) post(ctx context.Context, response interface{}, path string, params interface{}, headers []*common.Header, body interface{}) error {
return (*common.Client)(c).Post(ctx, response, path, params, headers, body)
}

// MakeClient is the factory for constructing a ClientV2 for a given endpoint.
Expand Down
6 changes: 3 additions & 3 deletions go_templates/query.vm
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func (s *SendRawTransaction) Do(ctx context.Context, headers ...*common.Header)
if addContentType {
headers = append(headers, &common.Header{"Content-Type", "application/x-binary"})
}
err = s.c.post(ctx, &response, "/v2/transactions", s.rawtxn, headers)
err = s.c.post(ctx, &response, "/v2/transactions", nil, headers, s.rawtxn)
txid = response.Txid
return
}
Expand All @@ -238,12 +238,12 @@ func (s *SuggestedParams) Do(ctx context.Context, headers ...*common.Header) (pa
}
#elseif( $queryType == "TealCompile" )## TODO: "post" can be generated, there is nothing special here.
func (s *TealCompile) Do(ctx context.Context, headers ...*common.Header) (response models.CompileResponse, err error) {
err = s.c.post(ctx, &response, "/v2/teal/compile", s.source, headers)
err = s.c.post(ctx, &response, "/v2/teal/compile", s.p, headers, s.source)
return
}
#elseif( $queryType == "TealDryrun" )## TODO: "post" can be generated, there is nothing special here.
func (s *TealDryrun) Do(ctx context.Context, headers ...*common.Header) (response models.DryrunResponse, err error) {
err = s.c.post(ctx, &response, "/v2/teal/dryrun", msgpack.Encode(&s.request), headers)
err = s.c.post(ctx, &response, "/v2/teal/dryrun", nil, headers, msgpack.Encode(&s.request))
return
}
#else## finally... machine generate the rest
Expand Down