go-waku/cmd/waku/server/rpc/store_test.go

34 lines
664 B
Go
Raw Normal View History

package rpc
import (
"context"
"testing"
"github.com/stretchr/testify/require"
"github.com/waku-org/go-waku/waku/v2/node"
"github.com/waku-org/go-waku/waku/v2/utils"
)
func makeStoreService(t *testing.T) *StoreService {
options := node.WithWakuStore()
2023-01-06 22:37:57 +00:00
n, err := node.New(options)
require.NoError(t, err)
2023-01-06 22:37:57 +00:00
err = n.Start(context.Background())
require.NoError(t, err)
return &StoreService{n, utils.Logger()}
}
2021-11-18 14:20:58 +00:00
func TestStoreGetV1Messages(t *testing.T) {
var reply StoreMessagesReply
s := makeStoreService(t)
err := s.GetV1Messages(
makeRequest(t),
&StoreMessagesArgs{},
&reply,
)
require.NoError(t, err)
require.NotEmpty(t, reply.Error)
}