mirror of
https://github.com/logos-messaging/logos-messaging-go-bindings.git
synced 2026-01-02 14:03:10 +00:00
applying feedback
This commit is contained in:
parent
be664cd6ec
commit
9dd3b09d78
@ -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
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user