Merge: QA Agent type fixes
This commit is contained in:
commit
20e33bea18
2 changed files with 6 additions and 6 deletions
|
|
@ -14,8 +14,8 @@ import { BaseAgent } from './BaseAgent';
|
||||||
import { AgentConfig, AgentTask, QualityReport } from './types';
|
import { AgentConfig, AgentTask, QualityReport } from './types';
|
||||||
import { getBlockchain } from '../blockchain/manager';
|
import { getBlockchain } from '../blockchain/manager';
|
||||||
import { getTransportChain } from '../transport/tracker';
|
import { getTransportChain } from '../transport/tracker';
|
||||||
import { PlantBlock } from '../blockchain/types';
|
import { PlantBlock } from '../blockchain/PlantBlock';
|
||||||
import crypto from 'crypto';
|
import * as crypto from 'crypto';
|
||||||
|
|
||||||
interface IntegrityCheck {
|
interface IntegrityCheck {
|
||||||
chainId: string;
|
chainId: string;
|
||||||
|
|
@ -131,7 +131,7 @@ export class QualityAssuranceAgent extends BaseAgent {
|
||||||
*/
|
*/
|
||||||
private async verifyPlantChain(): Promise<IntegrityCheck> {
|
private async verifyPlantChain(): Promise<IntegrityCheck> {
|
||||||
const blockchain = getBlockchain();
|
const blockchain = getBlockchain();
|
||||||
const chain = blockchain.getChain();
|
const chain = blockchain.chain;
|
||||||
|
|
||||||
let hashMismatches = 0;
|
let hashMismatches = 0;
|
||||||
let linkBroken = 0;
|
let linkBroken = 0;
|
||||||
|
|
@ -205,7 +205,7 @@ export class QualityAssuranceAgent extends BaseAgent {
|
||||||
const issues: DataQualityIssue[] = [];
|
const issues: DataQualityIssue[] = [];
|
||||||
|
|
||||||
const blockchain = getBlockchain();
|
const blockchain = getBlockchain();
|
||||||
const chain = blockchain.getChain().slice(1);
|
const chain = blockchain.chain.slice(1);
|
||||||
|
|
||||||
const seenIds = new Set<string>();
|
const seenIds = new Set<string>();
|
||||||
|
|
||||||
|
|
@ -390,7 +390,7 @@ export class QualityAssuranceAgent extends BaseAgent {
|
||||||
*/
|
*/
|
||||||
private calculateStatistics(): DataStatistics {
|
private calculateStatistics(): DataStatistics {
|
||||||
const blockchain = getBlockchain();
|
const blockchain = getBlockchain();
|
||||||
const chain = blockchain.getChain().slice(1);
|
const chain = blockchain.chain.slice(1);
|
||||||
|
|
||||||
let completeRecords = 0;
|
let completeRecords = 0;
|
||||||
let partialRecords = 0;
|
let partialRecords = 0;
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ export interface QualityReport {
|
||||||
blockIndex: number;
|
blockIndex: number;
|
||||||
issueType: string;
|
issueType: string;
|
||||||
description: string;
|
description: string;
|
||||||
severity: 'low' | 'medium' | 'high';
|
severity: 'low' | 'medium' | 'high' | 'critical';
|
||||||
}[];
|
}[];
|
||||||
lastVerifiedAt: string;
|
lastVerifiedAt: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue