Skip to content

Commit

Permalink
feat: update validator in story
Browse files Browse the repository at this point in the history
  • Loading branch information
fibonacci998 committed Nov 7, 2024
1 parent 1fdd7db commit 6760569
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/services/evm/story/crawl-validator/crawl_validator.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ export default class CrawlValidatorService extends BullableService {
// mark this offchain validator is mapped with onchain
offchainMapped.set(validator.operator_address, true);
const unCompressPubKey = Secp256k1.uncompressPubkey(
fromBase64(validator.consensus_pubkey.value)
fromBase64(
validator.consensus_pubkey.value.compressed_base64_pubkey.toString()
)
);
const evmAddress = `0x${keccak256(unCompressPubKey.slice(1)).slice(
-40
Expand Down Expand Up @@ -191,13 +193,17 @@ export default class CrawlValidatorService extends BullableService {
`${config.networkPrefixAddress}${config.consensusPrefixAddress}`,
pubkeyToRawAddress(
'secp256k1',
fromBase64(validator.consensus_pubkey.value.toString())
fromBase64(
validator.consensus_pubkey.value.compressed_base64_pubkey.toString()
)
)
);
const consensusHexAddress: string = toHex(
pubkeyToRawAddress(
'secp256k1',
fromBase64(validator.consensus_pubkey.value.toString())
fromBase64(
validator.consensus_pubkey.value.compressed_base64_pubkey.toString()
)
)
).toUpperCase();
const accountAddress = toBech32(
Expand All @@ -206,7 +212,8 @@ export default class CrawlValidatorService extends BullableService {
);
const consensusPubkey = {
type: validator.consensus_pubkey.type,
value: validator.consensus_pubkey.value,
value:
validator.consensus_pubkey.value.compressed_base64_pubkey.toString(),
};

const unCompressPubKey = Secp256k1.uncompressPubkey(
Expand Down

0 comments on commit 6760569

Please sign in to comment.