diff --git a/waku/common/message_hash.go b/waku/common/message_hash.go index 9f2e432..c51e480 100644 --- a/waku/common/message_hash.go +++ b/waku/common/message_hash.go @@ -2,6 +2,7 @@ package common import ( "encoding/hex" + "errors" "fmt" ) @@ -10,11 +11,11 @@ type MessageHash string func ToMessageHash(val string) (MessageHash, error) { if len(val) == 0 { - return "", fmt.Errorf("empty string not allowed") + return "", errors.New("empty string not allowed") } if len(val) < 2 || val[:2] != "0x" { - return "", fmt.Errorf("string must start with 0x") + return "", errors.New("string must start with 0x") } // Remove "0x" prefix for hex decoding diff --git a/waku/common/store.go b/waku/common/store.go index d404f76..32e76ad 100644 --- a/waku/common/store.go +++ b/waku/common/store.go @@ -8,15 +8,15 @@ type StoreQueryRequest struct { TimeStart *int64 `json:"time_start,omitempty"` TimeEnd *int64 `json:"time_end,omitempty"` MessageHashes *[]MessageHash `json:"message_hashes,omitempty"` - PaginationCursor MessageHash `json:"pagination_cursor,omitempty"` + PaginationCursor *MessageHash `json:"pagination_cursor,omitempty"` PaginationForward bool `json:"pagination_forward"` PaginationLimit *uint64 `json:"pagination_limit,omitempty"` } type StoreMessageResponse struct { - WakuMessage tmpWakuMessageJson `json:"message"` - PubsubTopic string `json:"pubsubTopic"` - MessageHash MessageHash `json:"messageHash"` + WakuMessage *tmpWakuMessageJson `json:"message"` + PubsubTopic string `json:"pubsubTopic"` + MessageHash MessageHash `json:"messageHash"` } type StoreQueryResponse struct { diff --git a/waku/nwaku_test.go b/waku/nwaku_test.go index 6bc5683..ba7ed71 100644 --- a/waku/nwaku_test.go +++ b/waku/nwaku_test.go @@ -777,7 +777,7 @@ func TestStore(t *testing.T) { PaginationLimit: proto.Uint64(uint64(paginationLimit)), PaginationForward: true, TimeStart: timeStart, - PaginationCursor: res1.PaginationCursor, + PaginationCursor: &res1.PaginationCursor, } ctx4, cancel4 := context.WithTimeout(context.Background(), requestTimeout)