diff --git a/src/models/validator.ts b/src/models/validator.ts index 8b1f3eccf..40d850931 100644 --- a/src/models/validator.ts +++ b/src/models/validator.ts @@ -8,8 +8,10 @@ import { PowerEvent } from './power_event'; import { Delegator } from './delegator'; export interface IConsensusPubkey { - type: string; - key: string; + type?: string; + key?: string; + value?: string; + original_value?: any; } export class Validator extends BaseModel { diff --git a/src/services/evm/story/crawl-validator/crawl_validator.service.ts b/src/services/evm/story/crawl-validator/crawl_validator.service.ts index 1b364f0c8..48f3ee2d1 100644 --- a/src/services/evm/story/crawl-validator/crawl_validator.service.ts +++ b/src/services/evm/story/crawl-validator/crawl_validator.service.ts @@ -141,7 +141,11 @@ export default class CrawlValidatorService extends BullableService { )}`; validatorEntity = foundValidator; validatorEntity.evm_address = evmAddress; - validatorEntity.consensus_pubkey = validator.consensus_pubkey; + validatorEntity.consensus_pubkey = { + type: validator.consensus_pubkey.type, + value: validator.consensus_pubkey.value.compressed_base64_pubkey, + original_value: validator.consensus_pubkey, + }; validatorEntity.jailed = validator.jailed ?? false; validatorEntity.status = validator.status; validatorEntity.tokens = validator.tokens; @@ -214,6 +218,7 @@ export default class CrawlValidatorService extends BullableService { type: validator.consensus_pubkey.type, value: validator.consensus_pubkey.value.compressed_base64_pubkey.toString(), + original_value: validator.consensus_pubkey.value, }; const unCompressPubKey = Secp256k1.uncompressPubkey(