chore(marketplace): use hardhat ignition (#1195)

This commit is contained in:
Arnaud
2025-06-20 15:55:00 +00:00
committed by GitHub
parent c5e424ff1b
commit 7b660e3554
4 changed files with 27 additions and 8 deletions
+2
View File
@@ -61,6 +61,8 @@ jobs:
run: |
npm install
npm start &
# Wait for the contracts to be deployed
sleep 5
## Part 2 Tests ##
- name: Contract tests
+20 -1
View File
@@ -53,6 +53,7 @@ proc openLogFile(node: HardhatProcess, logFilePath: string): IoHandle =
method start*(node: HardhatProcess) {.async.} =
let poptions = node.processOptions + {AsyncProcessOption.StdErrToStdOut}
trace "starting node",
args = node.arguments,
executable = node.executable,
@@ -63,10 +64,28 @@ method start*(node: HardhatProcess) {.async.} =
node.process = await startProcess(
node.executable,
node.workingDir,
@["node", "--export", "deployment-localhost.json"].concat(node.arguments),
@["node"].concat(node.arguments),
options = poptions,
stdoutHandle = AsyncProcess.Pipe,
)
await node.waitUntilStarted()
var execResult = await execCommandEx(
"cd " & node.workingDir() & " && " & node.workingDir() / node.executable() &
" run " & node.workingDir() / "scripts" / "mine.js --network localhost"
)
assert execResult.status == 0
execResult = await execCommandEx(
"cd " & node.workingDir() & " && " & node.workingDir() / node.executable() &
" ignition deploy ignition/modules/marketplace.js --network localhost"
)
assert execResult.status == 0
trace "hardhat post start scripts executed"
except CancelledError as error:
raise error
except CatchableError as e:
+4 -6
View File
@@ -139,14 +139,12 @@ template multinodesuite*(name: string, body: untyped) =
let updatedLogFile = getLogFile(role, none int)
args.add "--log-file=" & updatedLogFile
let node = await HardhatProcess.startNode(args, config.debugEnabled, "hardhat")
try:
await node.waitUntilStarted()
let node = await HardhatProcess.startNode(args, config.debugEnabled, "hardhat")
trace "hardhat node started"
return node
except NodeProcessError as e:
raiseMultiNodeSuiteError "hardhat node not started: " & e.msg
trace "hardhat node started"
return node
raiseMultiNodeSuiteError "cannot start hardhat process: " & e.msg
proc newCodexProcess(
roleIdx: int, conf: CodexConfig, role: Role