automatic vault creation working
This commit is contained in:
10
cache.js
10
cache.js
@@ -13,7 +13,10 @@ export class CacheSet {
|
||||
}
|
||||
|
||||
async contains(chain, key) {
|
||||
return await redis.sIsMember(`${chain}|${this.series}`, key)
|
||||
const series = `${chain}|${this.series}`;
|
||||
const result = await redis.sIsMember(series, key)
|
||||
console.log('contains', series, key, result)
|
||||
return result
|
||||
}
|
||||
|
||||
}
|
||||
@@ -40,12 +43,13 @@ export class CacheObject {
|
||||
}
|
||||
}
|
||||
|
||||
const cache_blocks = {
|
||||
const blockCaches = {
|
||||
'1338': new CacheObject('1338|latest_block'),
|
||||
'42161': new CacheObject('42161|latest_block'),
|
||||
}
|
||||
|
||||
async function latestBlock(chain) {
|
||||
return await cache_blocks[chain].get()
|
||||
return await blockCaches[chain].get()
|
||||
}
|
||||
|
||||
export const vaults = new CacheSet('v')
|
||||
|
||||
Reference in New Issue
Block a user