mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
propagate handshake error + NetworkCompatibilityStatus method
This commit is contained in:
parent
698507d363
commit
d04e55bc9c
12 changed files with 289 additions and 38 deletions
|
@ -4,8 +4,6 @@ import (
|
|||
accountService "github.com/anytypeio/any-sync/accountservice"
|
||||
"github.com/anytypeio/any-sync/app"
|
||||
"github.com/anytypeio/any-sync/commonspace/object/accountdata"
|
||||
"github.com/anytypeio/any-sync/nodeconf"
|
||||
"github.com/anytypeio/any-sync/nodeconf/nodeconfstore"
|
||||
"github.com/anytypeio/any-sync/util/crypto"
|
||||
)
|
||||
|
||||
|
@ -47,11 +45,3 @@ func (s *AccountTestService) Name() (name string) {
|
|||
func (s *AccountTestService) Account() *accountdata.AccountKeys {
|
||||
return s.acc
|
||||
}
|
||||
|
||||
func (s *AccountTestService) NodeConf(addrs []string) nodeconfstore.NodeConfig {
|
||||
return nodeconfstore.NodeConfig{
|
||||
PeerId: s.acc.PeerId,
|
||||
Addresses: addrs,
|
||||
Types: []nodeconf.NodeType{nodeconf.NodeTypeTree},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package testnodeconf
|
|||
import (
|
||||
"github.com/anytypeio/any-sync/accountservice"
|
||||
"github.com/anytypeio/any-sync/app"
|
||||
"github.com/anytypeio/any-sync/nodeconf/nodeconfstore"
|
||||
"github.com/anytypeio/any-sync/nodeconf"
|
||||
"github.com/anytypeio/any-sync/testutil/accounttest"
|
||||
)
|
||||
|
||||
|
@ -17,14 +17,17 @@ func GenNodeConfig(num int) (conf *Config) {
|
|||
if err := ac.Init(nil); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
conf.nodes = append(conf.nodes, ac.NodeConf(nil))
|
||||
conf.nodes.Nodes = append(conf.nodes.Nodes, nodeconf.Node{
|
||||
PeerId: ac.Account().PeerId,
|
||||
Types: []nodeconf.NodeType{nodeconf.NodeTypeTree},
|
||||
})
|
||||
conf.configs = append(conf.configs, ac)
|
||||
}
|
||||
return conf
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
nodes []nodeconfstore.NodeConfig
|
||||
nodes nodeconf.Configuration
|
||||
configs []*accounttest.AccountTestService
|
||||
}
|
||||
|
||||
|
@ -35,7 +38,7 @@ func (c *Config) GetNodesConfId() string {
|
|||
return "test"
|
||||
}
|
||||
|
||||
func (c *Config) GetNodes() []nodeconfstore.NodeConfig {
|
||||
func (c *Config) GetNodeConf() nodeconf.Configuration {
|
||||
return c.nodes
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue