1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 14:07:02 +09:00
This commit is contained in:
mcrakhman 2024-06-18 22:14:26 +02:00
parent b3d3b3ea92
commit fd27cf8650
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B

View file

@ -38,6 +38,7 @@ import (
"github.com/anyproto/any-sync/net/rpc/rpctest"
"github.com/anyproto/any-sync/net/streampool"
"github.com/anyproto/any-sync/net/streampool/streamopener"
"github.com/anyproto/any-sync/node/nodeclient"
"github.com/anyproto/any-sync/nodeconf"
"github.com/anyproto/any-sync/testutil/accounttest"
"github.com/anyproto/any-sync/util/crypto"
@ -150,6 +151,27 @@ func (m *mockConf) NodeTypes(nodeId string) []nodeconf.NodeType {
return nil
}
var _ nodeclient.NodeClient = (*mockNodeClient)(nil)
type mockNodeClient struct {
}
func (m mockNodeClient) Init(a *app.App) (err error) {
return
}
func (m mockNodeClient) Name() (name string) {
return nodeclient.CName
}
func (m mockNodeClient) AclGetRecords(ctx context.Context, spaceId, aclHead string) (recs []*consensusproto.RawRecordWithId, err error) {
return
}
func (m mockNodeClient) AclAddRecord(ctx context.Context, spaceId string, rec *consensusproto.RawRecord) (recWithId *consensusproto.RawRecordWithId, err error) {
return
}
//
// Mock PeerManager
//
@ -615,6 +637,7 @@ func newFixture(t *testing.T) *spaceFixture {
Register(credentialprovider.NewNoOp()).
Register(&mockStatusServiceProvider{}).
Register(mockCoordinatorClient{}).
Register(mockNodeClient{}).
Register(fx.configurationService).
Register(fx.storageProvider).
Register(fx.peerManagerProvider).
@ -654,6 +677,7 @@ func newFixtureWithData(t *testing.T, spaceId string, keys *accountdata.AccountK
Register(credentialprovider.NewNoOp()).
Register(&mockStatusServiceProvider{}).
Register(mockCoordinatorClient{}).
Register(mockNodeClient{}).
Register(fx.configurationService).
Register(fx.storageProvider).
Register(fx.peerManagerProvider).