mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 00:14:00 +00:00
fix: bind rated result to durable receipt
This commit is contained in:
@@ -94,6 +94,9 @@ func CompleteResult(ctx context.Context, db *sql.DB, receipt domain.ResultReceip
|
||||
}
|
||||
|
||||
func CompleteResultWithResult(ctx context.Context, db *sql.DB, receipt domain.ResultReceipt, serverID, eventID string, payload []byte, result domain.MatchResult, now time.Time) error {
|
||||
if result.MatchID != receipt.MatchID || result.ServerID != serverID || result.ResultNonce != receipt.ResultNonce || result.IntegrityState != receipt.IntegrityState || domain.ResultDigest(result) != receipt.PayloadDigest {
|
||||
return fmt.Errorf("result does not match receipt")
|
||||
}
|
||||
return completeResult(ctx, db, receipt, serverID, eventID, payload, now, &result)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user