Skip to content

Commit

Permalink
Rename proposer parameter to proposers
Browse files Browse the repository at this point in the history
In `GET /v2/block-headers`, rename the `proposer` parameter to `proposers` to follow conventions through the rest of the API.
  • Loading branch information
agodnic committed Dec 5, 2024
1 parent 8924c97 commit dff12aa
Show file tree
Hide file tree
Showing 7 changed files with 387 additions and 387 deletions.
10 changes: 5 additions & 5 deletions api/converter_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ func (si *ServerImplementation) blockParamsToBlockFilter(params generated.Search
{
// Make sure at most one of the participation parameters is set
numParticipationFilters := 0
if params.Proposer != nil {
if params.Proposers != nil {
numParticipationFilters++
}
if params.Expired != nil {
Expand All @@ -899,8 +899,8 @@ func (si *ServerImplementation) blockParamsToBlockFilter(params generated.Search
}

// Validate the number of items in the participation account lists
if params.Proposer != nil && uint64(len(*params.Proposer)) > si.opts.MaxAccountListSize {
errs = append(errs, fmt.Errorf("proposer list too long, max size is %d", si.opts.MaxAccountListSize))
if params.Proposers != nil && uint64(len(*params.Proposers)) > si.opts.MaxAccountListSize {
errs = append(errs, fmt.Errorf("proposers list too long, max size is %d", si.opts.MaxAccountListSize))
}
if params.Expired != nil && uint64(len(*params.Expired)) > si.opts.MaxAccountListSize {
errs = append(errs, fmt.Errorf("expired list too long, max size is %d", si.opts.MaxAccountListSize))
Expand All @@ -910,8 +910,8 @@ func (si *ServerImplementation) blockParamsToBlockFilter(params generated.Search
}

filter.Proposers = make(map[sdk.Address]struct{}, 0)
if params.Proposer != nil {
for _, s := range *params.Proposer {
if params.Proposers != nil {
for _, s := range *params.Proposers {
addr, err := sdk.DecodeAddress(s)
if err != nil {
errs = append(errs, fmt.Errorf("unable to parse proposer address `%s`: %w", s, err))
Expand Down
324 changes: 162 additions & 162 deletions api/generated/common/routes.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions api/generated/common/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

416 changes: 208 additions & 208 deletions api/generated/v2/routes.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions api/generated/v2/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions api/indexer.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@
"$ref": "#/parameters/after-time"
},
{
"$ref": "#/parameters/proposer"
"$ref": "#/parameters/proposers"
},
{
"$ref": "#/parameters/expired"
Expand Down Expand Up @@ -2732,14 +2732,14 @@
}
},
"parameters": {
"proposer": {
"proposers": {
"type": "array",
"items": {
"type": "string",
"x-algorand-format": "Address"
},
"description": "Accounts marked as proposer in the block header's participation updates. This parameter accepts a comma separated list of addresses.",
"name": "proposer",
"name": "proposers",
"in": "query",
"required": false
},
Expand Down
6 changes: 3 additions & 3 deletions api/indexer.oas3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@
},
"x-algorand-format": "base64"
},
"proposer": {
"proposers": {
"description": "Accounts marked as proposer in the block header's participation updates. This parameter accepts a comma separated list of addresses.",
"explode": false,
"in": "query",
"name": "proposer",
"name": "proposers",
"schema": {
"items": {
"type": "string",
Expand Down Expand Up @@ -4898,7 +4898,7 @@
"description": "Accounts marked as proposer in the block header's participation updates. This parameter accepts a comma separated list of addresses.",
"explode": false,
"in": "query",
"name": "proposer",
"name": "proposers",
"schema": {
"items": {
"type": "string",
Expand Down

0 comments on commit dff12aa

Please sign in to comment.