@@ -489,6 +489,34 @@ func (s *ValidatorSuite) TestValidateApplicationFailure() {
489489 repo .AssertExpectations (s .T ())
490490 })
491491
492+ s .Run ("NilInputMachineHash" , func () {
493+ input := Input {
494+ EpochApplicationID : app .ID ,
495+ OutputsHash : & validator .pristineRootHash ,
496+ MachineHash : nil , // <- trigger nil guard
497+ }
498+
499+ repo .On ("ListEpochs" ,
500+ mock .Anything , app .IApplicationAddress .String (), mock .Anything , mock .Anything , false ,
501+ ).Return ([]* Epoch {& dummyEpochs [0 ]}, uint64 (1 ), nil ).Once ()
502+
503+ repo .On ("ListOutputs" ,
504+ mock .Anything , mock .Anything , mock .Anything , mock .Anything , false ,
505+ ).Return ([]* Output {}, uint64 (0 ), nil ).Once ()
506+
507+ repo .On ("GetLastInput" ,
508+ mock .Anything , app .IApplicationAddress .String (), dummyEpochs [0 ].Index ,
509+ ).Return (& input , nil ).Once ()
510+
511+ repo .On ("UpdateApplicationStatus" ,
512+ mock .Anything , mock .Anything , mock .Anything , mock .Anything ,
513+ ).Return (nil ).Once ()
514+
515+ err := validator .validateApplication (ctx , & app )
516+ s .NotNil (err )
517+ repo .AssertExpectations (s .T ())
518+ })
519+
492520 s .Run ("ClaimMismatch" , func () {
493521 invalidClaim := common.Hash {}
494522 input := Input {
0 commit comments