| 350 | + | // deadline fires, so this budget only needs to outlast the pre-submission |
| 351 | + | // path, not the submission itself. |
| 352 | + | g.config.PeerTimeout = 500 * time.Millisecond |
| 347 | 353 | | tx, _ := observerTestXMRPlan(t) |
| 348 | 354 | | key := secp256k1.GenPrivKey() |
| 349 | 355 | | batch := signedCancellationBatch(t, tx, key) |
| 350 | 356 | | g.activeVals = map[peer.ID]bool{"one-validator": true} |
| 351 | 357 | | var submissionErr error |
| 352 | 358 | | client.sendQuorumTxFunc = func(ctx context.Context, _ *common.QuorumTx, _ ...grpc.CallOption) (*ebifrost.SendQuorumTxResult, error) { |
| 353 | 359 | | <-ctx.Done() |
| 354 | 360 | | submissionErr = ctx.Err() |
| 355 | 361 | | return nil, submissionErr |
| 356 | 362 | | } |
| 357 | 363 | | data, err := batch.Marshal() |
| 358 | 364 | | require.NoError(t, err) |
| 359 | 365 | | result := g.askStreamForState(stateSyncImportStream(t, "peer", data)) |
| 360 | 366 | | require.ErrorIs(t, submissionErr, context.DeadlineExceeded) |
| 361 | 367 | | require.True(t, result.completed) |
| 362 | 368 | | require.NoError(t, result.err) |
| 363 | 369 | | require.Equal(t, 1, result.items) |
| 364 | 370 | | state := g.observedTxs[observedTxKey(tx, false, false)] |
| 365 | 371 | | require.Len(t, state.UnsentAttestations(), 1) |
| 366 | 372 | | require.False(t, state.spentRefsApplied) |