Fix issue on lum

This commit is contained in:
liangping 2022-10-10 18:09:25 +08:00
parent 657ba8aa85
commit 830a03b02b
2 changed files with 15 additions and 11 deletions

View File

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

View File

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