resolve tree caching detection
This commit is contained in:
parent
c1155ed3ad
commit
7787a8d207
1 changed files with 3 additions and 2 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue