Skip to content
Merged
Changes from 5 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
12 changes: 10 additions & 2 deletions go_templates/query.vm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
#break
#end
#end
#if( $str.matches($q.path, ".*\{.*}.*") )
#if( $str.matches($q.path, ".*\{.*}.*") || $queryType == "TealCompile")
"fmt"
#end
#if ( $queryType == "SendRawTransaction" )
Expand All @@ -40,6 +40,9 @@ import (
#if ( $queryType == "PendingTransactionsByAddress" || $queryType == "PendingTransactionInformationByAddress" || $queryType == "PendingTransactionInformation" || $queryType == "PendingTransactions" || $queryType == "Block" || $queryType == "SuggestedParams" )
"github.com/algorand/go-algorand-sdk/types"
#end
#if ( $queryType == "TealCompile")
Comment thread
barnjamin marked this conversation as resolved.
Outdated
"github.com/google/go-querystring/query"
#end
#foreach( $qp in $q.bodyParameters)
#if( $str.matches("#oapiToGo($qp)", "models\..*") )
"github.com/algorand/go-algorand-sdk/encoding/msgpack"
Expand Down Expand Up @@ -238,7 +241,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)
vals, err := query.Values(s.p)
if err != nil {
return
}

err = s.c.post(ctx, &response, fmt.Sprintf("/v2/teal/compile?%s", vals.Encode()), s.source, headers)
Comment thread
barnjamin marked this conversation as resolved.
Outdated
return
}
#elseif( $queryType == "TealDryrun" )## TODO: "post" can be generated, there is nothing special here.
Expand Down