You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Omit `node_locations` to use random locations (default behavior).
104
+
105
+
#### `node_locations_fn`
106
+
Provide a function that returns `Vec<f64>` (one per node) when locations need to be computed dynamically (for example, based on a contract’s ring location).
107
+
108
+
```rust
109
+
fnmy_locations() ->Vec<f64> {
110
+
// Must return one entry per node in the same order.
111
+
vec![0.1, 0.6, 0.9]
112
+
}
113
+
114
+
#[freenet_test(
115
+
nodes = ["gateway", "peer-a", "peer-b"],
116
+
node_locations_fn=my_locations,
117
+
auto_connect_peers=true
118
+
)]
119
+
```
120
+
121
+
- The function must return exactly as many values as there are nodes; otherwise the test fails early.
122
+
-`node_locations` and `node_locations_fn` are mutually exclusive.
123
+
124
+
#### `node_configs`
125
+
Override configuration for specific nodes using a map (order must still match the `nodes` list for implicit behavior). Currently supports setting explicit locations per node, with additional fields planned as the macro evolves.
0 commit comments