mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-21 16:52:04 -07:00
fix(token data): Returning CID and not actual content
This commit is contained in:
@@ -271,7 +271,8 @@ class PsfSlpIndexer {
|
|||||||
|
|
||||||
// try to get immutable data
|
// try to get immutable data
|
||||||
try {
|
try {
|
||||||
const immutableData = await _this.getCIDData(tokenStats.documentUri)
|
// const immutableData = await _this.getCIDData(tokenStats.documentUri)
|
||||||
|
const immutableData = tokenStats.documentUri
|
||||||
tokenData.immutableData = immutableData
|
tokenData.immutableData = immutableData
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
tokenData.immutableData = ''
|
tokenData.immutableData = ''
|
||||||
@@ -367,8 +368,9 @@ class PsfSlpIndexer {
|
|||||||
if (!cid) {
|
if (!cid) {
|
||||||
throw new Error('CID could not be found in OP_RETURN data')
|
throw new Error('CID could not be found in OP_RETURN data')
|
||||||
}
|
}
|
||||||
|
const result = cid
|
||||||
|
|
||||||
const result = await _this.getCIDData(cid)
|
// const result = await _this.getCIDData(cid)
|
||||||
// console.log(`response.data: ${JSON.stringify(response.data, null, 2)}`)
|
// console.log(`response.data: ${JSON.stringify(response.data, null, 2)}`)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -706,8 +706,8 @@ describe('#PsfSlpIndexer', () => {
|
|||||||
assert.property(result, 'mutableData')
|
assert.property(result, 'mutableData')
|
||||||
|
|
||||||
assert.isObject(result.genesisData)
|
assert.isObject(result.genesisData)
|
||||||
assert.isObject(result.immutableData)
|
// assert.isObject(result.immutableData)
|
||||||
assert.isObject(result.mutableData)
|
// assert.isObject(result.mutableData)
|
||||||
|
|
||||||
const genesisData = result.genesisData
|
const genesisData = result.genesisData
|
||||||
assert.property(genesisData, 'ticker')
|
assert.property(genesisData, 'ticker')
|
||||||
@@ -745,7 +745,7 @@ describe('#PsfSlpIndexer', () => {
|
|||||||
|
|
||||||
assert.isObject(result.genesisData)
|
assert.isObject(result.genesisData)
|
||||||
assert.isObject(result.mutableData)
|
assert.isObject(result.mutableData)
|
||||||
assert.equal(result.immutableData, '')
|
// assert.equal(result.immutableData, '')
|
||||||
|
|
||||||
const genesisData = result.genesisData
|
const genesisData = result.genesisData
|
||||||
assert.property(genesisData, 'ticker')
|
assert.property(genesisData, 'ticker')
|
||||||
@@ -782,8 +782,8 @@ describe('#PsfSlpIndexer', () => {
|
|||||||
assert.property(result, 'mutableData')
|
assert.property(result, 'mutableData')
|
||||||
|
|
||||||
assert.isObject(result.genesisData)
|
assert.isObject(result.genesisData)
|
||||||
assert.isObject(result.immutableData)
|
// assert.isObject(result.immutableData)
|
||||||
assert.equal(result.mutableData, '')
|
// assert.equal(result.mutableData, '')
|
||||||
|
|
||||||
const genesisData = result.genesisData
|
const genesisData = result.genesisData
|
||||||
assert.property(genesisData, 'ticker')
|
assert.property(genesisData, 'ticker')
|
||||||
@@ -904,7 +904,7 @@ describe('#PsfSlpIndexer', () => {
|
|||||||
const documentHash = 'c37ba29f40ecc61662ea56324fdb72a5f1e66add2078854c2144765b9030358a'
|
const documentHash = 'c37ba29f40ecc61662ea56324fdb72a5f1e66add2078854c2144765b9030358a'
|
||||||
|
|
||||||
const result = await uut.getMutableData(documentHash)
|
const result = await uut.getMutableData(documentHash)
|
||||||
assert.isObject(result)
|
assert.isString(result)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user