Skip to content

chore(marketplace): use hardhat ignition #1195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 20 additions & 1 deletion tests/integration/hardhatprocess.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand Down
10 changes: 4 additions & 6 deletions tests/integration/multinodes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion vendor/codex-contracts-eth