FetchNetMapForTest fetches the netmap once.
(ctx context.Context)
| 991 | |
| 992 | // FetchNetMapForTest fetches the netmap once. |
| 993 | func (c *Direct) FetchNetMapForTest(ctx context.Context) (*netmap.NetworkMap, error) { |
| 994 | var nu rememberLastNetmapUpdater |
| 995 | nu.done = make(chan any, 1) |
| 996 | err := c.sendMapRequest(ctx, false, &nu) |
| 997 | if err != nil { |
| 998 | return nil, err |
| 999 | } |
| 1000 | if nu.last == nil { |
| 1001 | return nil, errors.New("[unexpected] sendMapRequest success without callback") |
| 1002 | } |
| 1003 | <-nu.done |
| 1004 | return nu.last, err |
| 1005 | } |
| 1006 | |
| 1007 | // SendUpdate makes a /map request to update the server of our latest state, but |
| 1008 | // does not fetch anything. It returns an error if the server did not return a |
nothing calls this directly
no test coverage detected