-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boxes: Support GetApplicationBoxes #344
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
8a230af
Support for Box array transaction field
michaeldiamant 85a345a
Point to go-algorand feature branch
michaeldiamant fcd2fe6
Boxes: Query algod Box by application ID and Box name
michaeldiamant 289f2b4
Remove println
michaeldiamant 273f5c8
Fix typo in Cucumber test references
michaeldiamant 5e4e62a
Update test/docker/run_docker.sh
michaeldiamant 309afb3
Remove unused code intended for child branch
michaeldiamant 459265e
Merge branch 'box_txn_field' into algod_GetApplicationBoxByName
michaeldiamant 0c6a8d0
Re-add Box model
michaeldiamant 9be96ec
Merge branch 'algod_GetApplicationBoxByName' of github.com:algorand/g…
michaeldiamant af2a45d
Merge branch 'feature/box-storage' into algod_GetApplicationBoxByName
michaeldiamant 93887f4
Update stale serialize comment reference
michaeldiamant dcd54a6
Boxes: Add convenience methods for encoding Box names
michaeldiamant a0b9342
Merge branch 'feature/box-storage' into box_encoding_convenience_methods
michaeldiamant 216cd1b
Add missed doc comment
michaeldiamant abdc71a
Boxes: Support GetApplicationBoxes
michaeldiamant a4b33d2
Add convenience method for BoxDescriptor
michaeldiamant 3158dc1
Merge branch 'feature/box-storage' into boxes_response_rework
michaeldiamant 9e79bb0
Fix updated Cucumber unit test
michaeldiamant 18cba69
Revert to feature branch following upstream merge
michaeldiamant File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package algod | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/algorand/go-algorand-sdk/client/v2/common" | ||
"github.com/algorand/go-algorand-sdk/client/v2/common/models" | ||
) | ||
|
||
// GetApplicationBoxesParams contains all of the query parameters for url serialization. | ||
type GetApplicationBoxesParams struct { | ||
|
||
// Max max number of box names to return. If max is not set, or max == 0, returns | ||
// all box-names. | ||
Max uint64 `url:"max,omitempty"` | ||
} | ||
|
||
// GetApplicationBoxes given an application ID, it returns the box names of that | ||
// application. No particular ordering is guaranteed. | ||
type GetApplicationBoxes struct { | ||
c *Client | ||
|
||
applicationId uint64 | ||
|
||
p GetApplicationBoxesParams | ||
} | ||
|
||
// Max max number of box names to return. If max is not set, or max == 0, returns | ||
// all box-names. | ||
func (s *GetApplicationBoxes) Max(Max uint64) *GetApplicationBoxes { | ||
s.p.Max = Max | ||
return s | ||
} | ||
|
||
// Do performs the HTTP request | ||
func (s *GetApplicationBoxes) Do(ctx context.Context, headers ...*common.Header) (response models.BoxesResponse, err error) { | ||
err = s.c.get(ctx, &response, fmt.Sprintf("/v2/applications/%s/boxes", common.EscapeParams(s.applicationId)...), s.p, headers) | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package models | ||
|
||
// BoxDescriptor box descriptor describes a Box. | ||
type BoxDescriptor struct { | ||
// Name base64 encoded box name | ||
Name []byte `json:"name"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package models | ||
|
||
// BoxesResponse box names of an application | ||
type BoxesResponse struct { | ||
// Boxes | ||
Boxes []BoxDescriptor `json:"boxes"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this pattern of passing an anonymous function - it's more similar to the annotations in the other sdks. It might make error messages a little more complicated due to an unnamed function on the call stack but that's not cause for concern imo.