resolve tree caching detection

This commit is contained in:
gozzy 2022-10-28 08:09:02 +00:00
parent c1155ed3ad
commit 7787a8d207

@ -5,6 +5,8 @@ import { download } from '@/store/snark'
import networkConfig from '@/networkConfig'
import { mimc, bloomService } from '@/services'
const supportedCaches = ['1', '56', '100', '137', '5']
class MerkleTreeService {
constructor({ netId, amount, currency, commitment, instanceName }) {
this.netId = netId
@ -153,8 +155,7 @@ class MerkleTreeService {
}
async getTree() {
const { nativeCurrency } = networkConfig[`netId${this.netId}`]
const hasCache = nativeCurrency === this.currency && Number(this.netId) === 1
const hasCache = supportedCaches.includes(this.netId.toString())
let cachedTree = await this.getTreeFromDB()