Skip to content
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

CLS 109 fix getting genesis block #4

Merged
merged 2 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions .run/requests/block.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### Get blocks list
http://{{host}}/v1/block

### Get blocks count
http://{{host}}/v1/block/count

### Get genesis block
http://{{host}}/v1/block/0

### Get block by height
http://{{host}}/v1/block/12

### Get block events
http://{{host}}/v1/block/20345/events

### Get block stats
http://{{host}}/v1/block/20345/stats

### Get block namespaces
http://{{host}}/v1/block/20345/namespace

### Get block namespaces count
http://{{host}}/v1/block/20345/namespace/count

4 changes: 2 additions & 2 deletions cmd/api/handler/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ func NewBlockHandler(
}

type getBlockByHeightRequest struct {
Height types.Level `param:"height" validate:"required,min=0"`
Height types.Level `param:"height" validate:"min=0"`
}

type getBlockRequest struct {
Height types.Level `param:"height" validate:"required,min=0"`
Height types.Level `param:"height" validate:"min=0"`

Stats bool `query:"stats" validate:"omitempty"`
}
Expand Down
Loading