fix: waku2 history query

This commit is contained in:
Richard Ramos 2021-09-01 17:25:31 -04:00 committed by RichΛrd
parent 7d148272e1
commit 71555991db
3 changed files with 6 additions and 6 deletions

View File

@ -188,7 +188,7 @@ func (w *gethWakuV2Wrapper) RequestStoreMessages(peerID []byte, r types.Messages
store.WithPaging(false, uint64(r.Limit)),
}
if r.Cursor != nil {
if r.StoreCursor != nil {
options = append(options, store.WithCursor(&pb.Index{
Digest: r.StoreCursor.Digest,
ReceiverTime: r.StoreCursor.ReceiverTime,
@ -196,9 +196,9 @@ func (w *gethWakuV2Wrapper) RequestStoreMessages(peerID []byte, r types.Messages
}))
}
var topics []types.TopicType
var topics []wakucommon.TopicType
for _, topic := range r.Topics {
topics = append(topics, types.BytesToTopic(topic))
topics = append(topics, wakucommon.BytesToTopic(topic))
}
pbCursor, err := w.waku.Query(topics, uint64(r.From), uint64(r.To), options)

View File

@ -723,7 +723,7 @@ func (w *WakuNode) DialPeerByID(peerID peer.ID) error {
func (w *WakuNode) DialPeerByID(peerID peer.ID) error {
info := w.host.Peerstore().PeerInfo(peerID)
return w.host.Connect(w.ctx, info)
return w.connect(info)
}
func (w *WakuNode) ClosePeerByAddress(address string) error {

View File

@ -566,10 +566,10 @@ func (w *Waku) Send(msg *pb.WakuMessage) ([]byte, error) {
return w.node.Publish(context.Background(), msg, nil)
}
func (w *Waku) Query(topics []types.TopicType, from uint64, to uint64, opts []store.HistoryRequestOption) (cursor *pb.Index, err error) {
func (w *Waku) Query(topics []common.TopicType, from uint64, to uint64, opts []store.HistoryRequestOption) (cursor *pb.Index, err error) {
strTopics := make([]string, len(topics))
for i, t := range topics {
strTopics[i] = t.String()
strTopics[i] = t.ContentTopic()
}
result, err := w.node.Query(context.Background(), strTopics, float64(from), float64(to), opts...)