Implement AttestationPool and ListAttestations RPC Functions (#3061)

This commit is contained in:
Raul Jordan
2019-07-26 12:07:20 -05:00
committed by terence tsao
parent 40fca7bb2c
commit 4ebe2fb5b5
13 changed files with 821 additions and 139 deletions

View File

@@ -25,7 +25,7 @@ func StartAndEndPage(pageToken string, pageSize int, totalSize int) (int, int, s
// Start page can not be greater than validator size.
start := token * pageSize
if start >= totalSize {
return 0, 0, "", fmt.Errorf("page start %d >= validator list %d", start, totalSize)
return 0, 0, "", fmt.Errorf("page start %d >= list %d", start, totalSize)
}
// End page can not go out of bound.

View File

@@ -73,7 +73,7 @@ func TestStartAndEndPage_CannotConvertPage(t *testing.T) {
}
func TestStartAndEndPage_ExceedsMaxPage(t *testing.T) {
wanted := "page start 0 >= validator list 0"
wanted := "page start 0 >= list 0"
if _, _, _, err := StartAndEndPage("", 0, 0); !strings.Contains(err.Error(), wanted) {
t.Fatalf("wanted error: %v, got error: %v", wanted, err.Error())
}