mirror of
https://github.com/status-im/status-go.git
synced 2026-08-31 09:01:16 +00:00
Part of the Go project layout migration, item 31. Pure move plus import-path rewrite across 687 files. No API or behaviour change. The services keep their grouping under pkg/services/<name> rather than being promoted to pkg/<name>: 27 top-level directories in pkg/ would read worse than what we have, and the grouping is what makes "an RPC service" identifiable at a glance. Paths that follow the move: the logosstorage test target and generate step, the two wallet token-list tools, the migration-order check (and the pre-rebase hook symlinked to it), and the storage env helper. refs #7067
38 lines
1.0 KiB
Go
38 lines
1.0 KiB
Go
//go:build use_logos_storage && !lint
|
|
|
|
package logosstorage
|
|
|
|
import "github.com/logos-storage/logos-storage-go-bindings/storage"
|
|
|
|
func toLogosStorageNode(node storage.Node) LogosStorageNode {
|
|
return LogosStorageNode{
|
|
NodeID: node.NodeId,
|
|
PeerID: node.PeerId,
|
|
Record: node.Record,
|
|
Address: node.Address,
|
|
Seen: node.Seen,
|
|
}
|
|
}
|
|
|
|
func toLogosStorageRoutingTable(table storage.RoutingTable) LogosStorageRoutingTable {
|
|
nodes := make([]LogosStorageNode, 0, len(table.Nodes))
|
|
for _, node := range table.Nodes {
|
|
nodes = append(nodes, toLogosStorageNode(node))
|
|
}
|
|
|
|
return LogosStorageRoutingTable{
|
|
LocalNode: toLogosStorageNode(table.LocalNode),
|
|
Nodes: nodes,
|
|
}
|
|
}
|
|
|
|
func toLogosStorageDebugInfo(info storage.DebugInfo) LogosStorageDebugInfo {
|
|
return LogosStorageDebugInfo{
|
|
ID: info.ID,
|
|
Addrs: append([]string(nil), info.Addrs...),
|
|
Spr: info.Spr,
|
|
AnnounceAddresses: append([]string(nil), info.AnnounceAddresses...),
|
|
PeersTable: toLogosStorageRoutingTable(info.PeersTable),
|
|
}
|
|
}
|