2021-11-09 14:15:45 +00:00
|
|
|
package rpc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
2022-11-09 19:53:01 +00:00
|
|
|
"github.com/waku-org/go-waku/waku/v2/node"
|
|
|
|
"github.com/waku-org/go-waku/waku/v2/utils"
|
2021-11-09 14:15:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func makeStoreService(t *testing.T) *StoreService {
|
2022-12-09 18:28:08 +00:00
|
|
|
options := node.WithWakuStore(false)
|
2021-11-09 14:15:45 +00:00
|
|
|
n, err := node.New(context.Background(), options)
|
|
|
|
require.NoError(t, err)
|
|
|
|
err = n.Start()
|
|
|
|
require.NoError(t, err)
|
2022-05-30 15:55:30 +00:00
|
|
|
return &StoreService{n, utils.Logger()}
|
2021-11-09 14:15:45 +00:00
|
|
|
}
|
|
|
|
|
2021-11-18 14:20:58 +00:00
|
|
|
func TestStoreGetV1Messages(t *testing.T) {
|
2021-11-09 14:15:45 +00:00
|
|
|
var reply StoreMessagesReply
|
|
|
|
|
|
|
|
s := makeStoreService(t)
|
|
|
|
|
|
|
|
err := s.GetV1Messages(
|
|
|
|
makeRequest(t),
|
|
|
|
&StoreMessagesArgs{},
|
|
|
|
&reply,
|
|
|
|
)
|
|
|
|
require.NoError(t, err)
|
|
|
|
require.NotEmpty(t, reply.Error)
|
|
|
|
}
|