2021-04-22 13:36:18 +00:00
|
|
|
package transport
|
2020-01-13 19:17:30 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2023-10-02 09:28:42 +00:00
|
|
|
"github.com/status-im/status-go/appdatabase"
|
2020-01-13 19:17:30 +00:00
|
|
|
"github.com/status-im/status-go/protocol/sqlite"
|
2023-10-02 09:28:42 +00:00
|
|
|
"github.com/status-im/status-go/t/helpers"
|
2020-01-13 19:17:30 +00:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
|
|
|
"github.com/status-im/status-go/protocol/tt"
|
|
|
|
)
|
|
|
|
|
2021-04-22 13:36:18 +00:00
|
|
|
func TestNewTransport(t *testing.T) {
|
2023-10-02 09:28:42 +00:00
|
|
|
db, err := helpers.SetupTestMemorySQLDB(appdatabase.DbInitializer{})
|
2020-01-13 19:17:30 +00:00
|
|
|
require.NoError(t, err)
|
2023-10-02 09:28:42 +00:00
|
|
|
err = sqlite.Migrate(db)
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
2020-01-13 19:17:30 +00:00
|
|
|
require.NoError(t, err)
|
|
|
|
|
|
|
|
logger := tt.MustCreateTestLogger()
|
|
|
|
require.NoError(t, err)
|
|
|
|
defer func() { _ = logger.Sync() }()
|
|
|
|
|
2021-06-16 20:19:45 +00:00
|
|
|
_, err = NewTransport(nil, nil, db, "waku_keys", nil, nil, logger)
|
2020-01-13 19:17:30 +00:00
|
|
|
require.NoError(t, err)
|
|
|
|
}
|