mirror of
https://github.com/logos-messaging/logos-messaging-go-bindings.git
synced 2026-01-05 23:43:05 +00:00
applying feedback
This commit is contained in:
parent
be664cd6ec
commit
9dd3b09d78
@ -2,6 +2,7 @@ package common
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -10,11 +11,11 @@ type MessageHash string
|
|||||||
|
|
||||||
func ToMessageHash(val string) (MessageHash, error) {
|
func ToMessageHash(val string) (MessageHash, error) {
|
||||||
if len(val) == 0 {
|
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" {
|
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
|
// Remove "0x" prefix for hex decoding
|
||||||
|
|||||||
@ -8,15 +8,15 @@ type StoreQueryRequest struct {
|
|||||||
TimeStart *int64 `json:"time_start,omitempty"`
|
TimeStart *int64 `json:"time_start,omitempty"`
|
||||||
TimeEnd *int64 `json:"time_end,omitempty"`
|
TimeEnd *int64 `json:"time_end,omitempty"`
|
||||||
MessageHashes *[]MessageHash `json:"message_hashes,omitempty"`
|
MessageHashes *[]MessageHash `json:"message_hashes,omitempty"`
|
||||||
PaginationCursor MessageHash `json:"pagination_cursor,omitempty"`
|
PaginationCursor *MessageHash `json:"pagination_cursor,omitempty"`
|
||||||
PaginationForward bool `json:"pagination_forward"`
|
PaginationForward bool `json:"pagination_forward"`
|
||||||
PaginationLimit *uint64 `json:"pagination_limit,omitempty"`
|
PaginationLimit *uint64 `json:"pagination_limit,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type StoreMessageResponse struct {
|
type StoreMessageResponse struct {
|
||||||
WakuMessage tmpWakuMessageJson `json:"message"`
|
WakuMessage *tmpWakuMessageJson `json:"message"`
|
||||||
PubsubTopic string `json:"pubsubTopic"`
|
PubsubTopic string `json:"pubsubTopic"`
|
||||||
MessageHash MessageHash `json:"messageHash"`
|
MessageHash MessageHash `json:"messageHash"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type StoreQueryResponse struct {
|
type StoreQueryResponse struct {
|
||||||
|
|||||||
@ -777,7 +777,7 @@ func TestStore(t *testing.T) {
|
|||||||
PaginationLimit: proto.Uint64(uint64(paginationLimit)),
|
PaginationLimit: proto.Uint64(uint64(paginationLimit)),
|
||||||
PaginationForward: true,
|
PaginationForward: true,
|
||||||
TimeStart: timeStart,
|
TimeStart: timeStart,
|
||||||
PaginationCursor: res1.PaginationCursor,
|
PaginationCursor: &res1.PaginationCursor,
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx4, cancel4 := context.WithTimeout(context.Background(), requestTimeout)
|
ctx4, cancel4 := context.WithTimeout(context.Background(), requestTimeout)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user