@@ -359,13 +359,40 @@ func TestGenerateLivePayment_StateValidationErrors(t *testing.T) {
359359 }()
360360
361361 tests := []struct {
362- name string
363- stateBytes []byte
364- stateSig []byte
365- orchInfo * net.OrchestratorInfo
366- wantStatus int
367- wantMsg string
362+ name string
363+ stateBytes []byte
364+ stateSig []byte
365+ orchInfo * net.OrchestratorInfo
366+ omitManifestID bool
367+ wantStatus int
368+ wantMsg string
368369 }{
370+ {
371+ name : "missing manifest id with state" ,
372+ stateBytes : func () []byte {
373+ state , err := json .Marshal (RemotePaymentState {
374+ StateID : "state" ,
375+ OrchestratorAddress : ethcommon .BytesToAddress (orchInfo .Address ),
376+ InitialPricePerUnit : 1 ,
377+ InitialPixelsPerUnit : 1 ,
378+ })
379+ require .NoError (err )
380+ return state
381+ }(),
382+ stateSig : func () []byte {
383+ state , err := json .Marshal (RemotePaymentState {
384+ StateID : "state" ,
385+ OrchestratorAddress : ethcommon .BytesToAddress (orchInfo .Address ),
386+ InitialPricePerUnit : 1 ,
387+ InitialPixelsPerUnit : 1 ,
388+ })
389+ require .NoError (err )
390+ return sign (state )
391+ }(),
392+ omitManifestID : true ,
393+ wantStatus : http .StatusBadRequest ,
394+ wantMsg : "missing manifestID" ,
395+ },
369396 {
370397 name : "invalid state signature" ,
371398 stateBytes : []byte (`{"stateID":"state","orchestratorAddress":"0x1"}` ),
@@ -459,8 +486,14 @@ func TestGenerateLivePayment_StateValidationErrors(t *testing.T) {
459486 orchBlob , err := proto .Marshal (oInfo )
460487 require .NoError (err )
461488
489+ var manifestID string
490+ if ! tt .omitManifestID {
491+ manifestID = "manifest"
492+ }
493+
462494 reqBody , err := json .Marshal (RemotePaymentRequest {
463495 Orchestrator : orchBlob ,
496+ ManifestID : manifestID ,
464497 InPixels : 1 ,
465498 State : RemotePaymentStateSig {State : tt .stateBytes , Sig : tt .stateSig },
466499 })
0 commit comments