From 7d340f715dd272136f248bc230437cfffa00b9b6 Mon Sep 17 00:00:00 2001 From: gozzy Date: Fri, 9 Sep 2022 03:36:14 +0000 Subject: [PATCH] resolve dependency & findEvent conflicts --- package.json | 5 +++-- services/events.js | 7 ++++--- yarn.lock | 15 ++++++++++----- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index b983a3d..2fa6f63 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "update:encrypted": "node -r esm scripts/updateEncryptedEvents.js --network", "update:tree": "node -r esm scripts/updateTree.js --network", "generate": "NODE_OPTIONS='--max-old-space-size=8192' nuxt generate && cp dist/404.html dist/ipfs-404.html", + "check:sync": "node -r esm scripts/checkEventsSync.js", "ipfsUpload": "node scripts/ipfsUpload.js", "deploy:ipfs": "yarn generate && yarn ipfsUpload" }, @@ -51,13 +52,13 @@ "nuxt-web3-provider": "0.1.4", "push-dir": "^0.4.1", "recursive-fs": "^2.1.0", - "snarkjs": "git+https://github.com/tornadocash/snarkjs.git#869181cfaf7526fe8972073d31655493a04326d5", + "snarkjs": "git+https://development.tornadocash.community/tornadocash/snarkjs.git#869181cfaf7526fe8972073d31655493a04326d5", "v-idle": "^0.2.0", "vue-clipboard2": "^0.3.1", "vue-i18n": "^8.15.4", "vuex-persistedstate": "^2.7.0", "web3": "1.5.2", - "websnark": "git+https://github.com/tornadocash/websnark.git#4c0af6a8b65aabea3c09f377f63c44e7a58afa6d" + "websnark": "git+https://development.tornadocash.community/tornadocash/websnark.git#master" }, "devDependencies": { "@nuxtjs/eslint-config": "^1.1.2", diff --git a/services/events.js b/services/events.js index 02517e5..7ee1495 100644 --- a/services/events.js +++ b/services/events.js @@ -1,18 +1,20 @@ import Web3 from 'web3' +import graph from '@/services/graph' import { download } from '@/store/snark' import networkConfig from '@/networkConfig' import InstanceABI from '@/abis/Instance.abi.json' import { CONTRACT_INSTANCES, eventsType } from '@/constants' import { sleep, formatEvents, capitalizeFirstLetter } from '@/utils' -const supportedNetworkCaches = [ '1', '56', '100', '137' ] +const supportedCaches = ['1', '56', '100', '137'] class EventService { constructor({ netId, amount, currency, factoryMethods }) { this.idb = window.$nuxt.$indexedDB(netId) const { nativeCurrency } = networkConfig[`netId${netId}`] + const hasCache = supportedCaches.indexOf(Number(this.netId)) !== 0 this.netId = netId this.amount = amount @@ -22,8 +24,7 @@ class EventService { this.contract = this.getContract({ netId, amount, currency }) this.isNative = nativeCurrency === this.currency - this.hasCache = this.isNative - && supportedNetworkCaches.indexOf(this.netId) !== 0 + this.hasCache = this.isNative && hasCache } getInstanceName(type) { diff --git a/yarn.lock b/yarn.lock index 88bb8c4..bd04110 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4011,6 +4011,11 @@ big-integer@1.6.36: resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.36.tgz#78631076265d4ae3555c04f85e7d9d2f3a071a36" integrity sha512-t70bfa7HYEA1D9idDbmuv7YbsbVkQ+Hp+8KFSul4aE5e/i1bjCNIRYJZlA8Q8p0r9T8cF/RVvwUgRA//FydEyg== +big-integer@1.6.42: + version "1.6.42" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.42.tgz#91623ae5ceeff9a47416c56c9440a66f12f534f1" + integrity sha512-3UQFKcRMx+5Z+IK5vYTMYK2jzLRJkt+XqyDdacgWgtMjjuifKpKTFneJLEgeBElOE2/lXZ1LcMcb5s8pwG2U8Q== + big-integer@^1.6.42, big-integer@^1.6.43, big-integer@^1.6.48: version "1.6.51" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" @@ -14444,9 +14449,9 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -"snarkjs@git+https://github.com/tornadocash/snarkjs.git#869181cfaf7526fe8972073d31655493a04326d5": +"snarkjs@git+https://development.tornadocash.community/tornadocash/snarkjs.git#869181cfaf7526fe8972073d31655493a04326d5": version "0.1.20" - resolved "git+https://github.com/tornadocash/snarkjs.git#869181cfaf7526fe8972073d31655493a04326d5" + resolved "git+https://development.tornadocash.community/tornadocash/snarkjs.git#869181cfaf7526fe8972073d31655493a04326d5" dependencies: big-integer "^1.6.43" chai "^4.2.0" @@ -16556,11 +16561,11 @@ webpackbar@^4.0.0: text-table "^0.2.0" wrap-ansi "^6.0.0" -"websnark@git+https://github.com/tornadocash/websnark.git#4c0af6a8b65aabea3c09f377f63c44e7a58afa6d": +"websnark@git+https://development.tornadocash.community/tornadocash/websnark.git#master": version "0.0.4" - resolved "git+https://github.com/tornadocash/websnark.git#4c0af6a8b65aabea3c09f377f63c44e7a58afa6d" + resolved "git+https://development.tornadocash.community/tornadocash/websnark.git#f30d3cb98cf0de7ea34c16620365cbaf61fb0351" dependencies: - big-integer "^1.6.42" + big-integer "1.6.42" websocket@^1.0.32: version "1.0.34"