-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: GetDelegatedStakersForOperator rpc
- Loading branch information
1 parent
13cdf2d
commit accde56
Showing
5 changed files
with
116 additions
and
15 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,23 @@ | ||
package types | ||
|
||
type Pagination struct { | ||
Page int `json:"page"` | ||
PageSize int `json:"page_size"` | ||
Page uint32 `json:"page"` | ||
PageSize uint32 `json:"page_size"` | ||
} | ||
|
||
const DefaultPageSize = 100 | ||
const DefaultPage = 0 | ||
|
||
func NewDefaultPagination() *Pagination { | ||
return &Pagination{ | ||
Page: DefaultPage, | ||
PageSize: DefaultPageSize, | ||
} | ||
} | ||
|
||
func (p *Pagination) Load(pageNumber uint32, pageSize uint32) { | ||
p.Page = pageNumber | ||
if pageSize > 0 { | ||
p.PageSize = pageSize | ||
} | ||
} |