Skip to content

Commit

Permalink
Fix problem with not storing agreement on consumer side after finaliz…
Browse files Browse the repository at this point in the history
…ing negotiation. (#45)
  • Loading branch information
Daniel Swärd authored Aug 4, 2024
1 parent 37bff55 commit 23136cf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dsp/statemachine/contract_transitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,15 @@ func verifyAndTransform(
logger.Error("Could not set state", "err", err)
return ctx, nil, fmt.Errorf("failed to save contract: %w", err)
}

if cn.GetContract().role == DataspaceConsumer && targetState == ContractStates.FINALIZED {
err = cn.GetArchiver().PutAgreement(ctx, &cn.GetContract().Copy().agreement)
if err != nil {
logger.Error("Could not set state", "err", err)
return ctx, nil, fmt.Errorf("failed to save agreement: %w", err)
}
}

ctx, cns := GetContractNegotiation(ctx, cn.GetArchiver(), cn.GetContract(), cn.GetProvider(), cn.GetReconciler())
return ctx, cns, nil
}

0 comments on commit 23136cf

Please sign in to comment.