Skip to content

Commit

Permalink
Transaction Group deltas changes (#63)
Browse files Browse the repository at this point in the history
* Change query template generation based on linter

* Change txn delta generation in go sdk

* Update generator to remove custom query for state deltas for round
  • Loading branch information
algochoi committed May 24, 2023
1 parent e5add2d commit 0c7680a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions go_templates/query.vm
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ import (
#end

"github.com/algorand/go-algorand-sdk/v2/client/v2/common"
#if ( $returnType.contains("model") && $queryType != "GetLedgerStateDelta" )
#if ( $returnType.contains("model") && $queryType != "GetLedgerStateDelta" && $queryType != "GetLedgerStateDeltaForTransactionGroup" )
"github.com/algorand/go-algorand-sdk/v2/client/v2/common/models"
#end
#if ( $queryType == "PendingTransactionsByAddress" || $queryType == "PendingTransactionInformationByAddress" || $queryType == "PendingTransactionInformation" || $queryType == "PendingTransactions" || $queryType == "Block" || $queryType == "SuggestedParams" || $queryType == "GetLedgerStateDelta" )
#if ( $queryType == "PendingTransactionsByAddress" || $queryType == "PendingTransactionInformationByAddress" || $queryType == "PendingTransactionInformation" || $queryType == "PendingTransactions" || $queryType == "Block" || $queryType == "SuggestedParams" || $queryType == "GetLedgerStateDelta" || $queryType == "GetLedgerStateDeltaForTransactionGroup" )
"github.com/algorand/go-algorand-sdk/v2/types"
#end
#foreach( $qp in $q.bodyParameters)
Expand Down Expand Up @@ -220,7 +220,7 @@ func (s *SendRawTransaction) Do(ctx context.Context, headers ...*common.Header)
}
}
if addContentType {
headers = append(headers, &common.Header{"Content-Type", "application/x-binary"})
headers = append(headers, &common.Header{Key: "Content-Type", Value: "application/x-binary"})
}
err = s.c.post(ctx, &response, "/v2/transactions", nil, headers, s.rawtxn)
txid = response.Txid
Expand Down Expand Up @@ -271,6 +271,11 @@ func (s *${queryType}) Do(ctx context.Context, headers ...*common.Header) (respo
err = s.c.get(ctx, &response, $processedPath, $queryArg, headers)
return
}
#elseif( $queryType == "GetLedgerStateDeltaForTransactionGroup" )
func (s *${queryType}) Do(ctx context.Context, headers ...*common.Header) (response types.LedgerStateDelta, err error) {
err = s.c.get(ctx, &response, $processedPath, $queryArg, headers)
return
}
#elseif( $queryType == "SetBlockTimeStampOffset" )## TODO: "post" can be generated, there is nothing special here.
func (s *${queryType}) Do(ctx context.Context, headers ...*common.Header) (response $returnType, err error) {
err = s.c.post(ctx, &response, $processedPath, nil, headers, nil)
Expand Down

0 comments on commit 0c7680a

Please sign in to comment.