Merge branch 'ping-pub:master' into master

This commit is contained in:
Erialos 2022-10-10 06:28:58 -06:00 committed by GitHub
commit 26330fec28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 11 deletions

View File

@ -60,18 +60,20 @@ export default class ChainFetch {
}
async getLatestBlock(config = null) {
// const conf = config || this.getSelectedConfig()
// if (conf.chain_name === 'injective') {
// return ChainFetch.fetch('https://tm.injective.network', '/cosmos/base/tendermint/v1beta1/block').then(data => Block.create(commonProcess(data)))
// }
const conf = config || this.getSelectedConfig()
const ver = conf.sdk_version || '0.41'
if (ver && compareVersions(ver, '0.45') < 1) {
return this.get('/blocks/latest', config).then(data => Block.create(data))
}
return this.get('/cosmos/base/tendermint/v1beta1/blocks/latest', config).then(data => Block.create(data))
}
async getBlockByHeight(height, config = null) {
// const conf = config || this.getSelectedConfig()
// if (conf.chain_name === 'injective') {
// return ChainFetch.fetch('https://tm.injective.network', `/cosmos/base/tendermint/v1beta1/block?height=${height}`).then(data => Block.create(commonProcess(data)))
// }
const conf = config || this.getSelectedConfig()
const ver = conf.sdk_version || '0.41'
if (ver && compareVersions(ver, '0.45') < 1) {
return this.get(`/blocks/${height}`, config).then(data => Block.create(data))
}
return this.get(`/cosmos/base/tendermint/v1beta1/blocks/${height}`, config).then(data => Block.create(data))
}

View File

@ -371,9 +371,11 @@ export default {
return '#'
},
discord() {
const discordLink = this.coinInfo.links.chat_url.filter(x => x.includes('discord'))
if (discordLink) {
return discordLink ? `${discordLink}` : '#'
if (this.coinInfo.links) {
const discordLink = this.coinInfo.links.chat_url.filter(x => x.includes('discord'))
if (discordLink) {
return discordLink ? `${discordLink}` : '#'
}
}
return '#'
},