restore legacy awaits
Signed-off-by: AlienTornadosaurusHex <>
This commit is contained in:
parent
6130c46d90
commit
a65389e901
7 changed files with 15 additions and 15 deletions
|
@ -4,7 +4,7 @@ import Web3 from 'web3'
|
|||
|
||||
import networkConfig from '../../networkConfig'
|
||||
|
||||
export function download({ name, directory }) {
|
||||
export async function download({ name, directory }) {
|
||||
const path = `${directory}${name}.gz`.toLowerCase()
|
||||
|
||||
const data = fs.readFileSync(path, { flag: 'as+' })
|
||||
|
@ -13,9 +13,9 @@ export function download({ name, directory }) {
|
|||
return content
|
||||
}
|
||||
|
||||
export function loadCachedEvents({ name, directory, deployedBlock }) {
|
||||
export async function loadCachedEvents({ name, directory, deployedBlock }) {
|
||||
try {
|
||||
const module = download({ contentType: 'string', directory, name })
|
||||
const module = await download({ contentType: 'string', directory, name })
|
||||
|
||||
if (module) {
|
||||
const events = JSON.parse(module)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import fs from 'fs'
|
||||
import zlib from 'zlib'
|
||||
|
||||
export function save(filePath) {
|
||||
export async function save(filePath) {
|
||||
try {
|
||||
const data = fs.readFileSync(`${filePath}`)
|
||||
|
||||
const payload = zlib.deflateSync(data, {
|
||||
const payload = await zlib.deflateSync(data, {
|
||||
level: zlib.constants.Z_BEST_COMPRESSION,
|
||||
strategy: zlib.constants.Z_FILTERED
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue