@@ -67,32 +67,31 @@ method start*(node: HardhatProcess) {.async.} =
6767 options = poptions,
6868 stdoutHandle = AsyncProcess .Pipe ,
6969 )
70-
71- discard await startProcess (
72- node.executable,
73- node.workingDir,
74- @ [" node" , " run" , " scripts/mine.js" , " --network" , " localhost" ].concat (
75- node.arguments
76- ),
77- options = poptions,
78- stdoutHandle = AsyncProcess .Pipe ,
79- )
80-
81- discard await startProcess (
82- node.executable,
83- node.workingDir,
84- @ [
85- " node" , " ignition" , " deploy" , " ignition/modules/marketplace.js" , " --network" ,
86- " localhost" ,
87- ].concat (node.arguments),
88- options = poptions,
89- stdoutHandle = AsyncProcess .Pipe ,
90- )
9170 except CancelledError as error:
9271 raise error
9372 except CatchableError as e:
9473 error " failed to start hardhat process" , error = e.msg
9574
75+ proc postStart * (
76+ node: HardhatProcess
77+ ): Future [void ] {.async : (raises: [CancelledError , NodeProcessError ]).} =
78+ try :
79+ var execResult = await execCommandEx (
80+ " cd " & node.workingDir () & " && " & node.workingDir () / node.executable () &
81+ " run " & node.workingDir () / " scripts" / " mine.js --network localhost"
82+ )
83+ assert execResult.status == 0
84+
85+ execResult = await execCommandEx (
86+ " cd " & node.workingDir () & " && " & node.workingDir () / node.executable () &
87+ " ignition deploy ignition/modules/marketplace.js --network localhost"
88+ )
89+ assert execResult.status == 0
90+ except CancelledError as e:
91+ raise e
92+ except Exception as e:
93+ raise newException (NodeProcessError , e.msg)
94+
9695proc startNode * (
9796 _: type HardhatProcess ,
9897 args: seq [string ],
0 commit comments