mirror of
https://github.com/luxfi/consensus.git
synced 2026-10-30 14:45:53 +00:00
- Removed all Snow consensus code and dependencies - Replaced snow.Context with consensuscontext.Context - Updated all imports and references - Added comprehensive test suites for core packages - Fixed all build errors and test failures - Achieved 100% test pass rate (21 packages passing) - Improved test coverage to 30% Breaking changes: - Removed snow package entirely - Changed VM interface to use VMState instead of snow.State - Updated ChainContext structure Tests added: - core/app_error_test.go: 100% coverage - core/bootstrap_test.go: comprehensive concurrent tests - core/health_test.go: full integration tests - validators/validators_test.go: complete interface tests - version/version_test.go: 100% coverage - codec/codec_test.go: marshal/unmarshal tests - context/context_test.go: all functions tested
70 lines
2.0 KiB
TypeScript
70 lines
2.0 KiB
TypeScript
type JsonSchema = boolean | ArraySchema | ObjectSchema | NumberSchema | StringSchema;
|
|
type JsonType = 'array' | 'object' | 'string' | 'number' | 'integer' | 'boolean' | 'null';
|
|
interface CommonSchema {
|
|
type?: JsonType | JsonType[];
|
|
const?: unknown;
|
|
enum?: unknown[];
|
|
format?: string;
|
|
allOf?: JsonSchema[];
|
|
anyOf?: JsonSchema[];
|
|
oneOf?: JsonSchema[];
|
|
not?: JsonSchema;
|
|
if?: JsonSchema;
|
|
then?: JsonSchema;
|
|
else?: JsonSchema;
|
|
$id?: string;
|
|
$defs?: Record<string, JsonSchema>;
|
|
$anchor?: string;
|
|
$dynamicAnchor?: string;
|
|
$ref?: string;
|
|
$dynamicRef?: string;
|
|
$schema?: string;
|
|
$vocabulary?: Record<string, boolean>;
|
|
$comment?: string;
|
|
default?: unknown;
|
|
deprecated?: boolean;
|
|
readOnly?: boolean;
|
|
writeOnly?: boolean;
|
|
title?: string;
|
|
description?: string;
|
|
examples?: unknown[];
|
|
}
|
|
interface ArraySchema extends CommonSchema {
|
|
prefixItems?: JsonSchema[];
|
|
items?: JsonSchema;
|
|
contains?: JsonSchema;
|
|
unevaluatedItems?: JsonSchema;
|
|
maxItems?: number;
|
|
minItems?: number;
|
|
uniqueItems?: boolean;
|
|
maxContains?: number;
|
|
minContains?: number;
|
|
}
|
|
interface ObjectSchema extends CommonSchema {
|
|
properties?: Record<string, JsonSchema>;
|
|
patternProperties?: Record<string, JsonSchema>;
|
|
additionalProperties?: JsonSchema;
|
|
propertyNames?: JsonSchema;
|
|
unevaluatedProperties?: JsonSchema;
|
|
maxProperties?: number;
|
|
minProperties?: number;
|
|
required?: string[];
|
|
dependentRequired?: Record<string, string[]>;
|
|
dependentSchemas?: Record<string, JsonSchema>;
|
|
}
|
|
interface StringSchema extends CommonSchema {
|
|
maxLength?: number;
|
|
minLength?: number;
|
|
patter?: string;
|
|
contentEncoding?: string;
|
|
contentMediaType?: string;
|
|
contentSchema?: JsonSchema;
|
|
}
|
|
interface NumberSchema extends CommonSchema {
|
|
multipleOf?: number;
|
|
maximum?: number;
|
|
exclusiveMaximum?: number;
|
|
minimum?: number;
|
|
exclusiveMinimum?: number;
|
|
}
|