( ctx sdk.Context, authority string, discrepancyID uint64, vindicatedAuditor string, slashAuditorA bool, slashAuditorB bool, reason vtypes.DiscrepancyResolutionReason, fault vtypes.FaultAttribution, evidenceHash []byte, )
| 1187 | } |
| 1188 | |
| 1189 | func (k *keeper) ResolveDiscrepancy( |
| 1190 | ctx sdk.Context, |
| 1191 | authority string, |
| 1192 | discrepancyID uint64, |
| 1193 | vindicatedAuditor string, |
| 1194 | slashAuditorA bool, |
| 1195 | slashAuditorB bool, |
| 1196 | reason vtypes.DiscrepancyResolutionReason, |
| 1197 | fault vtypes.FaultAttribution, |
| 1198 | evidenceHash []byte, |
| 1199 | ) error { |
| 1200 | if k.authority != "" && authority != k.authority { |
| 1201 | return govtypes.ErrInvalidSigner.Wrapf("invalid authority; expected %s, got %s", k.authority, authority) |
| 1202 | } |
| 1203 | if err := validateHash(evidenceHash, "evidence hash"); err != nil { |
| 1204 | return err |
| 1205 | } |
| 1206 | |
| 1207 | discrepancy, found := k.GetDiscrepancy(ctx, discrepancyID) |
| 1208 | if !found { |
| 1209 | return moduletypes.ErrDiscrepancyNotFound |
| 1210 | } |
| 1211 | if discrepancy.ResolutionStatus != vtypes.DiscrepancyStatusPending && discrepancy.ResolutionStatus != vtypes.DiscrepancyStatusTimedOut { |
| 1212 | return errorsmod.Wrap(moduletypes.ErrInvalidReason, "discrepancy is not pending or timed out") |
| 1213 | } |
| 1214 | if err := validateVindicatedAuditor(discrepancy, vindicatedAuditor, reason); err != nil { |
| 1215 | return err |
| 1216 | } |
| 1217 | if _, err := k.Settle(SettlementInput{ |
| 1218 | Path: SettlementPathDiscrepancyResolved, |
| 1219 | DiscrepancyReason: reason, |
| 1220 | FaultAttribution: fault, |
| 1221 | }); err != nil { |
| 1222 | return err |
| 1223 | } |
| 1224 | |
| 1225 | if discrepancy.ResolutionStatus == vtypes.DiscrepancyStatusPending { |
| 1226 | if err := k.settleDiscrepancyAttestations(ctx, discrepancy, reason); err != nil { |
| 1227 | return err |
| 1228 | } |
| 1229 | } |
| 1230 | |
| 1231 | auditorA, err := sdk.AccAddressFromBech32(discrepancy.AuditorA) |
| 1232 | if err != nil { |
| 1233 | return err |
| 1234 | } |
| 1235 | auditorB, err := sdk.AccAddressFromBech32(discrepancy.AuditorB) |
| 1236 | if err != nil { |
| 1237 | return err |
| 1238 | } |
| 1239 | if err = k.resolveDiscrepancyAuditorBond(ctx, auditorA, discrepancy.ID, slashAuditorA); err != nil { |
| 1240 | return err |
| 1241 | } |
| 1242 | if err = k.resolveDiscrepancyAuditorBond(ctx, auditorB, discrepancy.ID, slashAuditorB); err != nil { |
| 1243 | return err |
| 1244 | } |
| 1245 | |
| 1246 | var endedGrace *vtypes.ProviderVerificationGraceRecord |
nothing calls this directly
no test coverage detected