Verify paths

This commit is contained in:
stubbsta 2025-06-10 20:14:31 +02:00
parent ed7c75805a
commit 0b15fbef27

View File

@ -172,9 +172,23 @@ proc deployTestToken*(
# All RLN related tests should be run from the root directory of the project # All RLN related tests should be run from the root directory of the project
let submodulePath = absolutePath("./vendor/waku-rlnv2-contract") let submodulePath = absolutePath("./vendor/waku-rlnv2-contract")
# Verify submodule path exists
if not dirExists(submodulePath):
error "Submodule path does not exist", submodulePath = submodulePath
return err("Submodule path does not exist: " & submodulePath)
debug "Submodule path verified", submodulePath = submodulePath
let forgePath = getForgePath() let forgePath = getForgePath()
debug "Forge path", forgePath debug "Forge path", forgePath
# Verify forge executable exists
if not fileExists(forgePath):
error "Forge executable not found", forgePath = forgePath
return err("Forge executable not found: " & forgePath)
debug "Forge executable verified", forgePath = forgePath
let forgeCleanCmd = fmt"""cd {submodulePath} && {forgePath} clean""" let forgeCleanCmd = fmt"""cd {submodulePath} && {forgePath} clean"""
debug "Forge clean command", forgeCleanCmd debug "Forge clean command", forgeCleanCmd
# get current directory # get current directory
@ -315,9 +329,23 @@ proc executeForgeContractDeployScripts*(
# All RLN related tests should be run from the root directory of the project # All RLN related tests should be run from the root directory of the project
let submodulePath = "./vendor/waku-rlnv2-contract" let submodulePath = "./vendor/waku-rlnv2-contract"
# Verify submodule path exists
if not dirExists(submodulePath):
error "Submodule path does not exist", submodulePath = submodulePath
return err("Submodule path does not exist: " & submodulePath)
debug "Submodule path verified", submodulePath = submodulePath
let privateKey = $pk let privateKey = $pk
let forgePath = getForgePath() let forgePath = getForgePath()
debug "Forge path", forgePath debug "Forge path", forgePath
# Verify forge executable exists
if not fileExists(forgePath):
error "Forge executable not found", forgePath = forgePath
return err("Forge executable not found: " & forgePath)
debug "Forge executable verified", forgePath = forgePath
debug "contract deployer account details", account = acc, privateKey = privateKey debug "contract deployer account details", account = acc, privateKey = privateKey
# Build the Foundry project # Build the Foundry project