MCPcopy Create free account
hub / github.com/encodeous/nylon / nodeToPrefix

Function nodeToPrefix

core/router_test.go:22–28  ·  view source on GitHub ↗

Helper function to convert test node IDs to prefixes Maps single letter IDs to IP addresses in 10.0.0.x/32 range

(nodeId string)

Source from the content-addressed store, hash-verified

20// Helper function to convert test node IDs to prefixes
21// Maps single letter IDs to IP addresses in 10.0.0.x/32 range
22func nodeToPrefix(nodeId string) netip.Prefix {
23 var ipByte byte
24 if len(nodeId) > 0 {
25 ipByte = strings.ToLower(nodeId)[0] - 'a' + 1
26 }
27 return netip.MustParsePrefix(fmt.Sprintf("10.0.0.%d/32", ipByte))
28}
29
30func TestRouterBasicComputeRoutes(t *testing.T) {
31 tunables := ConfigureConstants()

Calls

no outgoing calls

Tested by

no test coverage detected