Replaces zip library with status-im/zippy library (which supports zip and tar)
This commit is contained in:
parent
0d26b19ab2
commit
2c74fddf55
|
@ -7,12 +7,12 @@ import ../../integration/marketplacesuite
|
|||
|
||||
marketplacesuite "tools/cirdl":
|
||||
const
|
||||
cirdl = "tools/cirdl/cirdl"
|
||||
cirdl = "build" / "cirdl"
|
||||
workdir = "."
|
||||
|
||||
test "circuit download tool":
|
||||
let
|
||||
circuitPath = "testcircuitpath"
|
||||
circuitPath = "." / "testcircuitpath"
|
||||
rpcEndpoint = "ws://localhost:8545"
|
||||
marketplaceAddress = $marketplace.address
|
||||
|
||||
|
@ -21,7 +21,8 @@ marketplacesuite "tools/cirdl":
|
|||
let process = osproc.startProcess(
|
||||
cirdl,
|
||||
workdir,
|
||||
args
|
||||
args,
|
||||
options={poParentStreams}
|
||||
)
|
||||
|
||||
let returnCode = process.waitForExit()
|
||||
|
|
|
@ -5,7 +5,7 @@ import pkg/chronos
|
|||
import pkg/ethers
|
||||
import pkg/questionable
|
||||
import pkg/questionable/results
|
||||
# import pkg/zippy/ziparchives
|
||||
import pkg/zippy/ziparchives
|
||||
import pkg/chronos/apps/http/httpclient
|
||||
import ../../codex/contracts/marketplace
|
||||
|
||||
|
@ -60,10 +60,10 @@ proc downloadZipfile(url: string, filepath: string): Future[?!void] {.async.} =
|
|||
success()
|
||||
|
||||
proc unzip(zipfile:string, targetPath: string): ?!void =
|
||||
# try:
|
||||
# extractAll(zipfile, targetPath)
|
||||
# except Exception as exc:
|
||||
# return failure(exc.msg)
|
||||
try:
|
||||
extractAll(zipfile, targetPath)
|
||||
except Exception as exc:
|
||||
return failure(exc.msg)
|
||||
success()
|
||||
|
||||
proc main() {.async.} =
|
||||
|
@ -77,11 +77,13 @@ proc main() {.async.} =
|
|||
circuitPath = args[0]
|
||||
rpcEndpoint = args[1]
|
||||
marketplaceAddress = args[2]
|
||||
zipfile = circuitPath / "circuit.zip"
|
||||
zipfile = "circuit.zip"
|
||||
|
||||
debug "Starting", circuitPath, rpcEndpoint, marketplaceAddress
|
||||
|
||||
discard existsOrCreateDir(circuitPath)
|
||||
if (dirExists(circuitPath)):
|
||||
info "Removing previous circuit path"
|
||||
removeDir(circuitPath)
|
||||
|
||||
without circuitHash =? (await getCircuitHash(rpcEndpoint, marketplaceAddress)), err:
|
||||
error "Failed to get circuit hash", msg = err.msg
|
||||
|
|
Loading…
Reference in New Issue