(t *testing.T, runDir string, name string, cfg state.CentralCfg, key state.NyPrivateKey)
| 318 | } |
| 319 | |
| 320 | func writeRawBundle(t *testing.T, runDir string, name string, cfg state.CentralCfg, key state.NyPrivateKey) string { |
| 321 | t.Helper() |
| 322 | cfgBytes, err := yaml.Marshal(cfg) |
| 323 | if err != nil { |
| 324 | t.Fatal(err) |
| 325 | } |
| 326 | bundle, err := state.SignBundle(cfgBytes, key) |
| 327 | if err != nil { |
| 328 | t.Fatal(err) |
| 329 | } |
| 330 | pub := key.Pubkey() |
| 331 | bundle, err = state.SealBundle(bundle, pub[:]) |
| 332 | if err != nil { |
| 333 | t.Fatal(err) |
| 334 | } |
| 335 | path := filepath.Join(runDir, name) |
| 336 | if err := os.WriteFile(path, []byte(base64.StdEncoding.EncodeToString(bundle)), 0644); err != nil { |
| 337 | t.Fatal(err) |
| 338 | } |
| 339 | return path |
| 340 | } |
| 341 | |
| 342 | func withTimestamp(cfg state.CentralCfg, timestamp int64) state.CentralCfg { |
| 343 | cfg.Timestamp = timestamp |
no test coverage detected