@@ -16,9 +16,9 @@ import {
1616 NODE_START_PORT ,
1717 ETH_RPC_ADAPTER_START_PORT ,
1818 MAX_PORT_ATTEMPTS ,
19- TASK_NODE_POLKAVM ,
20- TASK_NODE_POLKAVM_CREATE_SERVER ,
21- TASK_RUN_POLKAVM_NODE_IN_SEPARATE_PROCESS ,
19+ TASK_NODE_POLKADOT ,
20+ TASK_NODE_POLKADOT_CREATE_SERVER ,
21+ TASK_RUN_POLKADOT_NODE_IN_SEPARATE_PROCESS ,
2222} from "./constants"
2323import { JsonRpcServer } from "./server"
2424import {
@@ -28,7 +28,7 @@ import {
2828 getAvailablePort ,
2929 waitForNodeToBeReady ,
3030} from "./utils"
31- import { PolkaVMNodePluginError } from "./errors"
31+ import { PolkadotNodePluginError } from "./errors"
3232import { interceptAndWrapTasksWithNode } from "./core/global-interceptor"
3333import { runScriptWithHardhat } from "./core/script-runner"
3434import { AdapterConfig , NodeConfig , RpcServer } from "./types"
@@ -52,23 +52,23 @@ task(TASK_RUN).setAction(async (args, hre, runSuper) => {
5252 ) ;
5353} ) ;
5454
55- subtask ( TASK_NODE_POLKAVM_CREATE_SERVER , 'Creates a JSON-RPC server for PolkaVM node' )
55+ subtask ( TASK_NODE_POLKADOT_CREATE_SERVER , 'Creates a JSON-RPC server for Polkadot node' )
5656 . addOptionalParam ( 'nodePath' , 'Path to the node binary file' , undefined , types . string )
5757 . addOptionalParam ( 'adapterPath' , 'Path to the Eth Rpc Adapter binary file' , undefined , types . string )
5858 . setAction ( async ( { nodePath, adapterPath } : { nodePath : string ; adapterPath : string } ) => {
5959 const server : JsonRpcServer = new JsonRpcServer ( nodePath , adapterPath ) ;
6060 return server ;
6161 } ) ;
6262
63- task ( TASK_NODE , 'Start a PolkaVM Node' ) . setAction ( async ( args : TaskArguments , { network, run } , runSuper ) => {
63+ task ( TASK_NODE , 'Start a Polkadot Node' ) . setAction ( async ( args : TaskArguments , { network, run } , runSuper ) => {
6464 if ( network . polkavm !== true || network . name !== HARDHAT_NETWORK_NAME ) {
6565 return await runSuper ( ) ;
6666 }
6767
68- await run ( TASK_NODE_POLKAVM , args ) ;
68+ await run ( TASK_NODE_POLKADOT , args ) ;
6969} ) ;
7070
71- task ( TASK_NODE_POLKAVM , 'Starts a JSON-RPC server for PolkaVM node' )
71+ task ( TASK_NODE_POLKADOT , 'Starts a JSON-RPC server for Polkadot node' )
7272 . addOptionalParam ( 'nodeBinaryPath' , 'Path to the substrate node binary' , undefined , types . string )
7373 . addOptionalParam ( 'rpcPort' , 'Port where the node will listen on - default: 8000' , undefined , types . int )
7474 . addOptionalParam ( 'adapterBinaryPath' , 'Path to the eth-rpc-adapter binary' , undefined , types . string )
@@ -133,7 +133,7 @@ task(TASK_NODE_POLKAVM, 'Starts a JSON-RPC server for PolkaVM node')
133133 ? adapterBinaryPath
134134 : userConfig . networks ?. hardhat ?. adapterConfig ?. adapterBinaryPath ;
135135
136- const server : RpcServer = await run ( TASK_NODE_POLKAVM_CREATE_SERVER , {
136+ const server : RpcServer = await run ( TASK_NODE_POLKADOT_CREATE_SERVER , {
137137 nodePath,
138138 adapterPath,
139139 } )
@@ -142,21 +142,21 @@ task(TASK_NODE_POLKAVM, 'Starts a JSON-RPC server for PolkaVM node')
142142 await server . listen ( commandArgs . nodeCommands , commandArgs . adapterCommands )
143143 // eslint-disable-next-line @typescript-eslint/no-explicit-any
144144 } catch ( error : any ) {
145- throw new PolkaVMNodePluginError ( `Failed when running node: ${ error . message } ` )
145+ throw new PolkadotNodePluginError ( `Failed when running node: ${ error . message } ` )
146146 }
147147 } ,
148148 )
149149
150150subtask (
151- TASK_RUN_POLKAVM_NODE_IN_SEPARATE_PROCESS ,
152- "Runs a Hardhat PolkaVM task in a separate process." ,
151+ TASK_RUN_POLKADOT_NODE_IN_SEPARATE_PROCESS ,
152+ "Runs a Hardhat Polkadot task in a separate process." ,
153153)
154- . addVariadicPositionalParam ( "taskArgs" , "Arguments for the Hardhat PolkaVM task." )
154+ . addVariadicPositionalParam ( "taskArgs" , "Arguments for the Hardhat Polkadot task." )
155155 . setAction ( async ( { taskArgs = [ ] } , _hre ) => {
156156 const currentPort = await getAvailablePort ( ETH_RPC_ADAPTER_START_PORT , MAX_PORT_ATTEMPTS )
157157 const adjustedArgs = adjustTaskArgsForPort ( taskArgs , currentPort )
158158
159- const taskProcess = spawn ( "npx" , [ "hardhat" , TASK_NODE_POLKAVM , ...adjustedArgs ] , {
159+ const taskProcess = spawn ( "npx" , [ "hardhat" , TASK_NODE_POLKADOT , ...adjustedArgs ] , {
160160 detached : true ,
161161 } )
162162
@@ -256,7 +256,7 @@ task(
256256 return testFailures
257257 // eslint-disable-next-line @typescript-eslint/no-explicit-any
258258 } catch ( error : any ) {
259- throw new PolkaVMNodePluginError ( `Failed when running node: ${ error . message } ` )
259+ throw new PolkadotNodePluginError ( `Failed when running node: ${ error . message } ` )
260260 }
261261 } ,
262262)
0 commit comments