Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardmack committed Sep 18, 2024
1 parent 1f9d339 commit f1b7164
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions dot/parachain/candidate-validation/candidate_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (cv *CandidateValidation) validateFromChainState(msg ValidateFromChainState
if persistedValidationData == nil {
badParent := BadParent
reason := ValidationResult{
InvalidResult: &badParent,
Invalid: &badParent,
}
msg.Ch <- parachaintypes.OverseerFuncRes[ValidationResult]{
Data: reason,
Expand Down Expand Up @@ -205,7 +205,7 @@ func (cv *CandidateValidation) validateFromChainState(msg ValidateFromChainState
return
}
valid, err := runtimeInstance.ParachainHostCheckValidationOutputs(parachaintypes.ParaID(msg.CandidateReceipt.
Descriptor.ParaID), result.ValidResult.CandidateCommitments)
Descriptor.ParaID), result.Valid.CandidateCommitments)
if err != nil {
msg.Ch <- parachaintypes.OverseerFuncRes[ValidationResult]{
Err: fmt.Errorf("check validation outputs: Bad request: %w", err),
Expand All @@ -215,7 +215,7 @@ func (cv *CandidateValidation) validateFromChainState(msg ValidateFromChainState
if !valid {
invalidOutput := InvalidOutputs
reason := &ValidationResult{
InvalidResult: &invalidOutput,
Invalid: &invalidOutput,
}
msg.Ch <- parachaintypes.OverseerFuncRes[ValidationResult]{
Data: *reason,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,20 +456,18 @@ func TestCandidateValidation_processMessageValidateFromChainState(t *testing.T)
msg: ValidateFromChainState{
CandidateReceipt: candidateReceipt6,
Pov: pov,
Ch: sender,
},
want: &ValidationResult{
InvalidResult: &invalidOutputs,
Invalid: &invalidOutputs,
},
},
"bad_parent": {
msg: ValidateFromChainState{
CandidateReceipt: candidateReceipt7,
Pov: pov,
Ch: sender,
},
want: &ValidationResult{
InvalidResult: &badParent,
Invalid: &badParent,
},
},
"happy_path": {
Expand All @@ -478,7 +476,7 @@ func TestCandidateValidation_processMessageValidateFromChainState(t *testing.T)
Pov: pov,
},
want: &ValidationResult{
ValidResult: &Valid{
Valid: &Valid{
CandidateCommitments: validCandidateCommitments,
PersistedValidationData: parachaintypes.PersistedValidationData{
ParentHead: parachaintypes.HeadData{Data: []byte{1, 0, 0, 0, 0, 0, 0, 0, 1,
Expand Down
4 changes: 2 additions & 2 deletions dot/parachain/candidate-validation/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ func (w *worker) executeRequest(task *workerTask) (*ValidationResult, error) {
if validationResultWErr.err != nil {
logger.Errorf("executing validate_block: %w", err)
reasonForInvalidity := ExecutionError
return &ValidationResult{InvalidResult: &reasonForInvalidity}, nil //nolint
return &ValidationResult{Invalid: &reasonForInvalidity}, nil //nolint
}
validationResult = validationResultWErr.result

case <-time.After(timeoutDuration):
logger.Errorf("validation timed out")
reasonForInvalidity := Timeout
return &ValidationResult{InvalidResult: &reasonForInvalidity}, nil
return &ValidationResult{Invalid: &reasonForInvalidity}, nil
}

headDataHash, err := validationResult.HeadData.Hash()
Expand Down
6 changes: 3 additions & 3 deletions dot/parachain/candidate-validation/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func Test_worker_executeRequest(t *testing.T) {
t.Cleanup(ctrl.Finish)

expectedValidationResult := &ValidationResult{
ValidResult: &Valid{
Valid: &Valid{
CandidateCommitments: parachaintypes.CandidateCommitments{
HeadData: parachaintypes.HeadData{Data: []byte{2, 0, 0, 0, 0, 0, 0, 0, 123, 207, 206, 8, 219, 227,
136, 82, 236, 169, 14, 100, 45, 100, 31, 177, 154, 160, 220, 245, 59, 106, 76, 168, 122, 109,
Expand Down Expand Up @@ -108,7 +108,7 @@ func Test_worker_executeRequest(t *testing.T) {
candidateReceipt: &candidateReceiptCommitmentsMismatch,
},
want: &ValidationResult{
InvalidResult: &commitmentsHashMismatch,
Invalid: &commitmentsHashMismatch,
},
},
"execution_timeout": {
Expand All @@ -117,7 +117,7 @@ func Test_worker_executeRequest(t *testing.T) {
candidateReceipt: &candidateReceipt,
},
want: &ValidationResult{
InvalidResult: &timeout,
Invalid: &timeout,
},
},
"long_timeout_ok": {
Expand Down

0 comments on commit f1b7164

Please sign in to comment.