Skip to content

Commit 088f89d

Browse files
authored
Merge pull request #6350 from Algo-devops-service/relstable4.1.2
2 parents d7a2182 + 85ed589 commit 088f89d

File tree

32 files changed

+1915
-2056
lines changed

32 files changed

+1915
-2056
lines changed

Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,6 @@ generate: deps
143143

144144
msgp: $(patsubst %,%/msgp_gen.go,$(MSGP_GENERATE))
145145

146-
api:
147-
make -C daemon/algod/api
148-
149-
logic:
150-
make -C data/transactions/logic
151-
152-
153146
%/msgp_gen.go: deps ALWAYS
154147
@set +e; \
155148
printf "msgp: $(@D)..."; \

buildnumber.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1
1+
2

cmd/goal/account.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ var assetDetailsCmd = &cobra.Command{
573573
}
574574

575575
printAccountAssetsInformation(accountAddress, response)
576+
576577
},
577578
}
578579
var infoCmd = &cobra.Command{
@@ -776,7 +777,7 @@ func printAccountAssetsInformation(address string, response model.AccountAssetsI
776777
fmt.Printf("Account: %s\n", address)
777778
fmt.Printf("Round: %d\n", response.Round)
778779
if response.NextToken != nil {
779-
fmt.Printf("NextToken (use with --next to retrieve more account assets): %s\n", *response.NextToken)
780+
fmt.Printf("NextToken (to retrieve more account assets): %s\n", *response.NextToken)
780781
}
781782
fmt.Printf("Assets:\n")
782783
for _, asset := range *response.AssetHoldings {

cmd/goal/box.go

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,11 @@ import (
2020
"bytes"
2121
"strings"
2222

23-
"github.com/algorand/go-algorand/cmd/util/datadir"
2423
"github.com/spf13/cobra"
2524
)
2625

27-
var (
28-
boxName string
29-
// next uint64 // declared in account.go
30-
// limit uint64 // declared in account.go
31-
boxPrefix string
32-
boxValues bool
33-
)
26+
var boxName string
27+
var maxBoxes uint64
3428

3529
func init() {
3630
appCmd.AddCommand(appBoxCmd)
@@ -43,10 +37,7 @@ func init() {
4337
appBoxInfoCmd.Flags().StringVarP(&boxName, "name", "n", "", "Application box name. Use the same form as app-arg to name the box.")
4438
appBoxInfoCmd.MarkFlagRequired("name")
4539

46-
appBoxListCmd.Flags().StringVarP(&boxPrefix, "prefix", "p", "", "Return only boxes that begin with the supplied prefix.")
47-
appBoxListCmd.Flags().StringVarP(&next, "next", "n", "", "The next-token returned from a previous call, used for pagination.")
48-
appBoxListCmd.Flags().Uint64VarP(&limit, "limit", "l", 0, "The maximum number of boxes to list. 0 means no limit.")
49-
appBoxListCmd.Flags().BoolVarP(&boxValues, "values", "v", false, "Request and display box values.")
40+
appBoxListCmd.Flags().Uint64VarP(&maxBoxes, "max", "m", 0, "Maximum number of boxes to list. 0 means no limit.")
5041
}
5142

5243
var appBoxCmd = &cobra.Command{
@@ -98,36 +89,30 @@ var appBoxInfoCmd = &cobra.Command{
9889

9990
var appBoxListCmd = &cobra.Command{
10091
Use: "list",
101-
Short: "List application boxes belonging to an application",
102-
Long: "List application boxes belonging to an application.\n" +
103-
"Printable names and values are formatted as 'str:hello' otherwise 'b64:A=='.",
92+
Short: "List all application boxes belonging to an application",
93+
Long: "List all application boxes belonging to an application.\n" +
94+
"For printable strings, the box name is formatted as 'str:hello'\n" +
95+
"For everything else, the box name is formatted as 'b64:A=='. ",
10496
Args: validateNoPosArgsFn,
10597
Run: func(cmd *cobra.Command, args []string) {
106-
dataDir := datadir.EnsureSingleDataDir()
107-
client := ensureAlgodClient(dataDir)
98+
_, client := getDataDirAndClient()
10899

109-
response, err := client.ApplicationBoxes(appIdx, boxPrefix, &next, limit, boxValues)
100+
// Get app boxes
101+
boxesRes, err := client.ApplicationBoxes(appIdx, maxBoxes)
110102
if err != nil {
111103
reportErrorf(errorRequestFail, err)
112104
}
105+
boxes := boxesRes.Boxes
113106

114-
// Endpoint did not originally report the Round, so don't show it if it's 0
115-
if response.Round != 0 {
116-
reportInfof("Round: %d", response.Round)
117-
}
118-
// There will only be a next-token if there are more boxes to list
119-
if response.NextToken != nil {
120-
encoded := encodeBytesAsAppCallBytes([]byte(*response.NextToken))
121-
reportInfof("NextToken (use with --next to retrieve more boxes): %s", encoded)
107+
// Error if no boxes found
108+
if len(boxes) == 0 {
109+
reportErrorf("No boxes found for appid %d", appIdx)
122110
}
123-
reportInfoln("Boxes:")
124-
for _, descriptor := range response.Boxes {
125-
name := encodeBytesAsAppCallBytes(descriptor.Name)
126-
if boxValues {
127-
reportInfof("%s : %s", name, encodeBytesAsAppCallBytes(descriptor.Value))
128-
} else {
129-
reportInfoln(name)
130-
}
111+
112+
// Print app boxes
113+
for _, descriptor := range boxes {
114+
encodedName := encodeBytesAsAppCallBytes(descriptor.Name)
115+
reportInfof("%s", encodedName)
131116
}
132117
},
133118
}

daemon/algod/api/algod.oas2.json

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,7 +2280,7 @@
22802280
},
22812281
"/v2/applications/{application-id}/boxes": {
22822282
"get": {
2283-
"description": "Given an application ID, return boxes in lexographical order by name. If the results must be truncated, a next-token is supplied to continue the request.",
2283+
"description": "Given an application ID, return all Box names. No particular ordering is guaranteed. Request fails when client or server-side configured limits prevent returning all Box names.",
22842284
"tags": [
22852285
"public",
22862286
"nonparticipating"
@@ -2291,7 +2291,7 @@
22912291
"schemes": [
22922292
"http"
22932293
],
2294-
"summary": "Get boxes for a given application.",
2294+
"summary": "Get all box names for a given application.",
22952295
"operationId": "GetApplicationBoxes",
22962296
"parameters": [
22972297
{
@@ -2303,27 +2303,9 @@
23032303
},
23042304
{
23052305
"type": "integer",
2306-
"description": "Maximum number of boxes to return. Server may impose a lower limit.",
2306+
"description": "Max number of box names to return. If max is not set, or max == 0, returns all box-names.",
23072307
"name": "max",
23082308
"in": "query"
2309-
},
2310-
{
2311-
"type": "string",
2312-
"description": "A box name prefix, in the goal app call arg form 'encoding:value'. For ints, use the form 'int:1234'. For raw bytes, use the form 'b64:A=='. For printable strings, use the form 'str:hello'. For addresses, use the form 'addr:XYZ...'.",
2313-
"name": "prefix",
2314-
"in": "query"
2315-
},
2316-
{
2317-
"type": "string",
2318-
"description": "A box name, in the goal app call arg form 'encoding:value'. When provided, the returned boxes begin (lexographically) with the supplied name. Callers may implement pagination by reinvoking the endpoint with the token from a previous call's next-token.",
2319-
"name": "next",
2320-
"in": "query"
2321-
},
2322-
{
2323-
"type": "boolean",
2324-
"description": "If true, box values will be returned.",
2325-
"name": "values",
2326-
"in": "query"
23272309
}
23282310
],
23292311
"responses": {
@@ -4154,6 +4136,7 @@
41544136
"description": "Box name and its content.",
41554137
"type": "object",
41564138
"required": [
4139+
"round",
41574140
"name",
41584141
"value"
41594142
],
@@ -4163,12 +4146,26 @@
41634146
"type": "integer"
41644147
},
41654148
"name": {
4166-
"description": "The box name, base64 encoded",
4149+
"description": "\\[name\\] box name, base64 encoded",
41674150
"type": "string",
41684151
"format": "byte"
41694152
},
41704153
"value": {
4171-
"description": "The box value, base64 encoded.",
4154+
"description": "\\[value\\] box value, base64 encoded.",
4155+
"type": "string",
4156+
"format": "byte"
4157+
}
4158+
}
4159+
},
4160+
"BoxDescriptor": {
4161+
"description": "Box descriptor describes a Box.",
4162+
"type": "object",
4163+
"required": [
4164+
"name"
4165+
],
4166+
"properties": {
4167+
"name": {
4168+
"description": "Base64 encoded box name",
41724169
"type": "string",
41734170
"format": "byte"
41744171
}
@@ -4193,6 +4190,22 @@
41934190
}
41944191
}
41954192
},
4193+
"KvDelta": {
4194+
"description": "A single Delta containing the key, the previous value and the current value for a single round.",
4195+
"type": "object",
4196+
"properties": {
4197+
"key": {
4198+
"description": "The key, base64 encoded.",
4199+
"type": "string",
4200+
"format": "byte"
4201+
},
4202+
"value": {
4203+
"description": "The new value of the KV store entry, base64 encoded.",
4204+
"type": "string",
4205+
"format": "byte"
4206+
}
4207+
}
4208+
},
41964209
"Version": {
41974210
"description": "algod version information.",
41984211
"type": "object",
@@ -5600,26 +5613,17 @@
56005613
}
56015614
},
56025615
"BoxesResponse": {
5603-
"description": "Boxes of an application",
5616+
"description": "Box names of an application",
56045617
"schema": {
56055618
"type": "object",
56065619
"required": [
5607-
"round",
56085620
"boxes"
56095621
],
56105622
"properties": {
5611-
"round": {
5612-
"description": "The round for which this information is relevant.",
5613-
"type": "integer"
5614-
},
5615-
"next-token": {
5616-
"description": "Used for pagination, when making another request provide this token with the next parameter.",
5617-
"type": "string"
5618-
},
56195623
"boxes": {
56205624
"type": "array",
56215625
"items": {
5622-
"$ref": "#/definitions/Box"
5626+
"$ref": "#/definitions/BoxDescriptor"
56235627
}
56245628
}
56255629
}

0 commit comments

Comments
 (0)