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

This commit is contained in:
Arnaud 2025-06-20 17:55:00 +02:00 committed by GitHub
parent c5e424ff1b
commit 7b660e3554
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 27 additions and 8 deletions

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

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:

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

@ -1 +1 @@
Subproject commit 2dddc260152b6e9c24ae372397f9b9b2d27ce8e4
Subproject commit dee3d7b654de02db2e8a023e37120b51150ff6cb