forked from cerc-io/cosmos-explorer
fixed issue: display moniker on blocks
This commit is contained in:
parent
12fde18e75
commit
9fc2328ab6
@ -491,19 +491,21 @@ export function getCachedValidators(chainName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isHexAddress(v) {
|
export function isHexAddress(v) {
|
||||||
const re = /^[A-Z\d]{40}$/
|
// const re = /^[A-Z\d]{40}$/
|
||||||
return re.test(v)
|
// return re.test(v)
|
||||||
|
return v.length === 28
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getStakingValidatorByHex(chainName, hex) {
|
export function getStakingValidatorByHex(chainName, textBase64) {
|
||||||
const locals = localStorage.getItem(`validators-${chainName}`)
|
const locals = localStorage.getItem(`validators-${chainName}`)
|
||||||
if (locals) {
|
if (locals) {
|
||||||
const val = JSON.parse(locals).find(x => consensusPubkeyToHexAddress(x.consensus_pubkey) === hex)
|
const val = JSON.parse(locals)
|
||||||
|
.find(x => toBase64(fromHex(consensusPubkeyToHexAddress(x.consensus_pubkey))) === textBase64)
|
||||||
if (val) {
|
if (val) {
|
||||||
return val.description.moniker
|
return val.description.moniker
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return abbr(hex)
|
return abbr(textBase64)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getStakingValidatorByAccount(chainName, addr) {
|
export function getStakingValidatorByAccount(chainName, addr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user