Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
573a1fd
Commit diff of oapi-codegen update
Eric-Warehime Oct 27, 2022
25818d8
Fix git stash issues
Eric-Warehime Oct 27, 2022
e2d8c33
Rerun generation with skip-prune
Eric-Warehime Oct 27, 2022
337bf9e
Rerun generate w/ GenerateEnums patch
Eric-Warehime Oct 28, 2022
39723df
Update to oapi-codegen v1.11.0-prerelease.2
Eric-Warehime Oct 28, 2022
a3d3c29
Update handlers based on new Enum types
Eric-Warehime Oct 28, 2022
fda1f97
Update to oapi-codegen v1.11.0-algorand.0
Eric-Warehime Oct 28, 2022
f66b3c9
Fix type renaming/tests
Eric-Warehime Oct 28, 2022
582471f
Further update types changed in generated code
Eric-Warehime Oct 28, 2022
f617d87
We now ignore invalid query params
Eric-Warehime Oct 28, 2022
0b41dc3
Another AssetId=>AssetID error
Eric-Warehime Oct 28, 2022
e45b98b
Update to oapi-codegen v1.12.0-algorand.0
Eric-Warehime Oct 31, 2022
0009b0c
Fix type changes
Eric-Warehime Oct 31, 2022
d2048d6
Fix test type error
Eric-Warehime Oct 31, 2022
27bdd45
Merge remote-tracking branch 'upstream/master' into oapi-v1.11.0-back…
Eric-Warehime Oct 31, 2022
5cbe20f
Merge remote-tracking branch 'upstream/master' into oapi-v1.11.0-back…
Eric-Warehime Nov 1, 2022
c4a3f8a
Remove comment
Eric-Warehime Nov 1, 2022
120a92b
Merge remote-tracking branch 'upstream/master' into oapi-v1.11.0-back…
Eric-Warehime Nov 4, 2022
4722698
Fix AssetID change
Eric-Warehime Nov 4, 2022
7189ff0
Another AssetID fix
Eric-Warehime Nov 4, 2022
d919d68
Merge remote-tracking branch 'upstream/master' into oapi-v1.11.0-back…
Eric-Warehime Nov 7, 2022
809c935
Merge remote-tracking branch 'upstream/master' into oapi-v1.11.0-back…
Eric-Warehime Nov 7, 2022
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: 6 additions & 6 deletions cmd/goal/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ func printAccountInfo(client libgoal.Client, address string, onlyShowAssetIds bo
heldAssets = make([]generatedV2.AssetHolding, len(*account.Assets))
copy(heldAssets, *account.Assets)
sort.Slice(heldAssets, func(i, j int) bool {
return heldAssets[i].AssetId < heldAssets[j].AssetId
return heldAssets[i].AssetID < heldAssets[j].AssetID
})
}

Expand Down Expand Up @@ -608,14 +608,14 @@ func printAccountInfo(client libgoal.Client, address string, onlyShowAssetIds bo
}
for _, assetHolding := range heldAssets {
if onlyShowAssetIds {
fmt.Fprintf(report, "\tID %d\n", assetHolding.AssetId)
fmt.Fprintf(report, "\tID %d\n", assetHolding.AssetID)
continue
}
assetParams, err := client.AssetInformationV2(assetHolding.AssetId)
assetParams, err := client.AssetInformationV2(assetHolding.AssetID)
if err != nil {
hasError = true
fmt.Fprintf(errorReport, "Error: Unable to retrieve asset information for asset %d referred to by account %s: %v\n", assetHolding.AssetId, address, err)
fmt.Fprintf(report, "\tID %d, error\n", assetHolding.AssetId)
fmt.Fprintf(errorReport, "Error: Unable to retrieve asset information for asset %d referred to by account %s: %v\n", assetHolding.AssetID, address, err)
fmt.Fprintf(report, "\tID %d, error\n", assetHolding.AssetID)
}

amount := assetDecimalsFmt(assetHolding.Amount, assetParams.Params.Decimals)
Expand All @@ -635,7 +635,7 @@ func printAccountInfo(client libgoal.Client, address string, onlyShowAssetIds bo
frozen = " (frozen)"
}

fmt.Fprintf(report, "\tID %d, %s, balance %s %s%s\n", assetHolding.AssetId, assetName, amount, unitName, frozen)
fmt.Fprintf(report, "\tID %d, %s, balance %s %s%s\n", assetHolding.AssetID, assetName, amount, unitName, frozen)
}

fmt.Fprintln(report, "Created Apps:")
Expand Down
2 changes: 1 addition & 1 deletion cmd/goal/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ var infoAssetCmd = &cobra.Command{
var res generated.AssetHolding
if reserve.Assets != nil {
for _, reserveAsset := range *reserve.Assets {
if assetID == reserveAsset.AssetId {
if assetID == reserveAsset.AssetID {
res = reserveAsset
break
}
Expand Down
8 changes: 4 additions & 4 deletions daemon/algod/api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ all: server/v2/generated/types.go server/v2/generated/routes.go server/v2/genera
generate: oapi-codegen all

server/v2/generated/types.go: algod.oas3.yml
$(GOPATH1)/bin/oapi-codegen -package generated -type-mappings integer=uint64 -generate types -exclude-tags=private,common -o ./server/v2/generated/types.go algod.oas3.yml
$(GOPATH1)/bin/oapi-codegen -config ./generated_types.yml algod.oas3.yml

server/v2/generated/routes.go: algod.oas3.yml
$(GOPATH1)/bin/oapi-codegen -package generated -type-mappings integer=uint64 -generate server,spec -exclude-tags=private,common -o ./server/v2/generated/routes.go algod.oas3.yml
$(GOPATH1)/bin/oapi-codegen -config ./generated_server.yml algod.oas3.yml

server/v2/generated/private/types.go: algod.oas3.yml
$(GOPATH1)/bin/oapi-codegen -package private -type-mappings integer=uint64 -generate types -include-tags=private -o ./server/v2/generated/private/types.go algod.oas3.yml
$(GOPATH1)/bin/oapi-codegen -config ./private_types.yml algod.oas3.yml

server/v2/generated/private/routes.go: algod.oas3.yml
$(GOPATH1)/bin/oapi-codegen -package private -type-mappings integer=uint64 -generate server,spec -include-tags=private -o ./server/v2/generated/private/routes.go algod.oas3.yml
$(GOPATH1)/bin/oapi-codegen -config ./private_server.yml algod.oas3.yml

algod.oas3.yml: algod.oas2.json
curl -s -X POST "https://converter.swagger.io/api/convert" -H "accept: application/json" -H "Content-Type: application/json" -d @./algod.oas2.json -o .3tmp.json
Expand Down
12 changes: 12 additions & 0 deletions daemon/algod/api/generated_server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package: generated
generate:
echo-server: true
embedded-spec: true
output-options:
exclude-tags:
- private
- common
type-mappings:
integer: uint64
skip-prune: true
output: ./server/v2/generated/routes.go
11 changes: 11 additions & 0 deletions daemon/algod/api/generated_types.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package: generated
generate:
models: true
output-options:
exclude-tags:
- private
- common
type-mappings:
integer: uint64
skip-prune: true
output: ./server/v2/generated/types.go
11 changes: 11 additions & 0 deletions daemon/algod/api/private_server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package: private
generate:
echo-server: true
embedded-spec: true
output-options:
include-tags:
- private
type-mappings:
integer: uint64
skip-prune: true
output: ./server/v2/generated/private/routes.go
10 changes: 10 additions & 0 deletions daemon/algod/api/private_types.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package: private
generate:
models: true
output-options:
include-tags:
- private
type-mappings:
integer: uint64
skip-prune: true
output: ./server/v2/generated/private/types.go
6 changes: 3 additions & 3 deletions daemon/algod/api/server/v2/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ func AccountDataToAccount(
// longer fetch the creator
holding := generated.AssetHolding{
Amount: holding.Amount,
AssetId: uint64(curid),
AssetID: uint64(curid),
IsFrozen: holding.Frozen,
}

assets = append(assets, holding)
}
sort.Slice(assets, func(i, j int) bool {
return assets[i].AssetId < assets[j].AssetId
return assets[i].AssetID < assets[j].AssetID
})

createdAssets := make([]generated.Asset, 0, len(record.AssetParams))
Expand Down Expand Up @@ -281,7 +281,7 @@ func AccountToAccountData(a *generated.Account) (basics.AccountData, error) {
if a.Assets != nil && len(*a.Assets) > 0 {
assets = make(map[basics.AssetIndex]basics.AssetHolding, len(*a.Assets))
for _, h := range *a.Assets {
assets[basics.AssetIndex(h.AssetId)] = basics.AssetHolding{
assets[basics.AssetIndex(h.AssetID)] = basics.AssetHolding{
Amount: h.Amount,
Frozen: h.IsFrozen,
}
Expand Down
Loading