Skip to content

Commit 8e3b243

Browse files
authored
Merge pull request #82 from paritytech/anp-docs
chore(docs): fix docs and update references
2 parents fc8d7a4 + e8d5f30 commit 8e3b243

File tree

17 files changed

+68
-70
lines changed

17 files changed

+68
-70
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@ Overview of currently available plugins and those on the roadmap.
2121

2222
| 🔌 Plugin | 📄 Description |
2323
|-------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
24-
| [hardhat-polkadot-resolc](https://github.com/paritytech/hardhat-revive/tree/main/packages/hardhat-resolc) | Compiles solidity smart contracts for the Polkadot network, creating PolkaVM compatible hardhat artifacts. |
25-
| [hardhat-polkadot-node](https://github.com/paritytech/hardhat-revive/blob/main/packages/hardhat-revive-node/README.md) | Run a Polkadot node locally
24+
| [hardhat-polkadot](https://github.com/paritytech/hardhat-polkadot/tree/main/packages/hardhat-polkadot) | Umbrella plugin that provides full functionality and a convenient cli. |
25+
| [hardhat-polkadot-resolc](https://github.com/paritytech/hardhat-polkadot/tree/main/packages/hardhat-polkadot-resolc) | Compiles solidity smart contracts for the Polkadot network, creating PolkaVM compatible hardhat artifacts. |
26+
| [hardhat-polkadot-node](https://github.com/paritytech/hardhat-polkadot/blob/main/packages/hardhat-polkadot-node/README.md) | Run a Polkadot node locally
2627

2728
## Getting Started
2829

2930
* Find instructions in [Develop -> Smart Contracts -> Dev Environments -> Hardhat](https://papermoonio.github.io/polkadot-mkdocs/develop/smart-contracts/dev-environments/hardhat/)
3031

3132
## Usage
3233

33-
* See [Examples](https://github.com/paritytech/hardhat-revive/tree/main/examples)
34-
* Get started from a boilerplate with [create-polkadot-dapp](https://github.com/paritytech/create-polkadot-dapp).
34+
* See [Examples](https://github.com/paritytech/hardhat-polkadot/tree/main/examples)
35+
* Get started from a boilerplate by running `npx hardhat-polkadot init`.
3536

3637
## Getting Help
3738

examples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ configuration for different environments. This is not meant to be an extensive
55
combination rather than a guide to kick start plugin usage.
66

77
To know more about how to configure the compiler, take a look at the configuration
8-
[type](/packages/hardhat-resolc/src/types.ts) and the `resolc` compiler's
8+
[type](/packages/hardhat-polkadot-resolc/src/types.ts) and the `resolc` compiler's
99
`--help` section.
1010

1111
To know more about how to configure the node, take a look at the configuration
12-
[type](/packages/hardhat-revive-node/src/types.ts) andor run `npx hardhat node-polkavm --help`.
12+
[type](/packages/hardhat-polkadot-node/src/types.ts) andor run `npx hardhat node-polkadot --help`.

examples/forkWithAdapter.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { HardhatUserConfig } from "hardhat/config"
2-
import "hardhat-resolc"
3-
import "hardhat-revive-node"
2+
import "@parity/hardhat-polkadot"
43

54
const config: HardhatUserConfig = {
65
solidity: "0.8.26",

examples/forkWithoutAdapter.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { HardhatUserConfig } from "hardhat/config"
2-
import "hardhat-resolc"
3-
import "hardhat-revive-node"
2+
import "@parity/hardhat-polkadot"
43

54
const config: HardhatUserConfig = {
65
solidity: "0.8.26",

examples/localNode.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { HardhatUserConfig } from "hardhat/config"
2-
import "../hardhat-revive/packages/hardhat-resolc/src/index"
3-
import "../hardhat-revive/packages/hardhat-revive-node/src/index"
2+
import "@parity/hardhat-polkadot"
43

54
const config: HardhatUserConfig = {
65
solidity: "0.8.28",

examples/npm.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { HardhatUserConfig } from "hardhat/config"
2-
import "hardhat-resolc"
2+
import "@parity/hardhat-polkadot"
33

44
const config: HardhatUserConfig = {
55
solidity: "0.8.28",

examples/npmWithoutOptimization.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { HardhatUserConfig } from "hardhat/config"
2-
import "@parity/hardhat-polkadot-resolc"
2+
import "@parity/hardhat-polkadot"
33

44
const config: HardhatUserConfig = {
55
solidity: "0.8.28",

packages/hardhat-polkadot-node/src/constants.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
export const PLUGIN_NAME = "hardhat-revive-node"
1+
export const PLUGIN_NAME = "hardhat-polkadot-node"
22

3-
export const TASK_NODE_POLKAVM = "node-polkavm"
4-
export const TASK_NODE_POLKAVM_CREATE_SERVER = "node-polkavm:create-server"
5-
export const TASK_NODE_POLKAVM_CREATE_ETH_ADAPTER = "node-polkavm:create-eth-adapter"
6-
export const TASK_RUN_POLKAVM_NODE_IN_SEPARATE_PROCESS = "node-polkavm:run-in-separate-process"
3+
export const TASK_NODE_POLKADOT = "node-polkadot"
4+
export const TASK_NODE_POLKADOT_CREATE_SERVER = "node-polkadot:create-server"
5+
export const TASK_NODE_POLKADOT_CREATE_ETH_ADAPTER = "node-polkadot:create-eth-adapter"
6+
export const TASK_RUN_POLKADOT_NODE_IN_SEPARATE_PROCESS = "node-polkadot:run-in-separate-process"
77

88
export const PROCESS_TERMINATION_SIGNALS = ["SIGINT", "SIGTERM", "SIGKILL"]
99

@@ -13,12 +13,12 @@ export const MAX_PORT_ATTEMPTS = 10
1313
export const PORT_CHECK_DELAY = 500
1414
export const RPC_ENDPOINT_PATH = "eth_chainId"
1515

16-
export const POLKAVM_TEST_NODE_NETWORK_NAME = "Kitchensink"
16+
export const POLKADOT_TEST_NODE_NETWORK_NAME = "Kitchensink"
1717

1818
export const BASE_URL = `http://127.0.0.1`
1919
export const NETWORK_ACCOUNTS = {
2020
REMOTE: "remote",
21-
POLKAVM: [
21+
POLKADOT: [
2222
"0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133",
2323
"0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5b0000a702133",
2424
"0x5fb92c48bebcd6e98884f76de468fa3f6278f880713595d45af5b0000a702133",

packages/hardhat-polkadot-node/src/core/global-interceptor.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,33 @@ import { HardhatRuntimeEnvironment, RunSuperFunction, TaskArguments } from "hard
22
import { GlobalWithHardhatContext } from "hardhat/src/internal/context"
33
import { HARDHAT_NETWORK_NAME } from "hardhat/plugins"
44
import { configureNetwork, startServer, waitForNodeToBeReady } from "../utils"
5-
import { PolkaVMTasksWithWrappedNode } from "./global-task"
5+
import { PolkadotTasksWithWrappedNode } from "./global-task"
66
import { Environment } from "hardhat/internal/core/runtime-environment"
77

88
export function interceptAndWrapTasksWithNode() {
9-
const polkaVMGlobal = global as PolkaVMTasksWithWrappedNode & GlobalWithHardhatContext
10-
const taskMap = polkaVMGlobal.__hardhatContext.tasksDSL.getTaskDefinitions()
9+
const polkadotGlobal = global as PolkadotTasksWithWrappedNode & GlobalWithHardhatContext
10+
const taskMap = polkadotGlobal.__hardhatContext.tasksDSL.getTaskDefinitions()
1111

12-
if (!polkaVMGlobal._polkaVMTasksForWrapping) {
12+
if (!polkadotGlobal._polkadotTasksForWrapping) {
1313
return
1414
}
1515

16-
polkaVMGlobal._polkaVMTasksForWrapping.taskNames.forEach((taskName) => {
16+
polkadotGlobal._polkadotTasksForWrapping.taskNames.forEach((taskName) => {
1717
const foundTask = taskMap[taskName]
1818

1919
if (!foundTask) {
2020
return
2121
}
2222

2323
if (foundTask.isSubtask) {
24-
polkaVMGlobal.__hardhatContext.tasksDSL.subtask(
24+
polkadotGlobal.__hardhatContext.tasksDSL.subtask(
2525
foundTask.name,
2626
foundTask.description,
2727
wrapTaskWithNode,
2828
)
2929
}
3030

31-
polkaVMGlobal.__hardhatContext.tasksDSL.task(
31+
polkadotGlobal.__hardhatContext.tasksDSL.task(
3232
foundTask.name,
3333
foundTask.description,
3434
wrapTaskWithNode,
@@ -44,7 +44,7 @@ async function wrapTaskWithNode(
4444
if (env.network.polkavm !== true || env.network.name !== HARDHAT_NETWORK_NAME) {
4545
return await runSuper(taskArgs)
4646
}
47-
const polkaVMGlobal = global as PolkaVMTasksWithWrappedNode;
47+
const polkadotGlobal = global as PolkadotTasksWithWrappedNode;
4848

4949
const { commandArgs, server, port } = await startServer({
5050
forking: env.config.networks.hardhat.forking,
@@ -58,10 +58,10 @@ async function wrapTaskWithNode(
5858
const oldNetwork = env.network;
5959
await configureNetwork(env.config, env.network, port);
6060
(env as unknown as Environment).injectToGlobal();
61-
polkaVMGlobal._polkaVMNodeNetwork = env.network;
61+
polkadotGlobal._polkadotNodeNetwork = env.network;
6262
const result = await runSuper(taskArgs);
6363
(env as unknown as Environment).network = oldNetwork;
64-
delete polkaVMGlobal._polkaVMNodeNetwork;
64+
delete polkadotGlobal._polkadotNodeNetwork;
6565
(env as unknown as Environment).injectToGlobal();
6666
return result
6767
} finally {

packages/hardhat-polkadot-node/src/core/global-task.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Network } from "hardhat/types"
22

3-
export type PolkaVMTasksWithWrappedNode = typeof global & {
4-
_polkaVMTasksForWrapping: PolkaVMTasksForWrapping
5-
_polkaVMNodeNetwork?: Network
3+
export type PolkadotTasksWithWrappedNode = typeof global & {
4+
_polkadotTasksForWrapping: PolkadotTasksForWrapping
5+
_polkadotNodeNetwork?: Network
66
}
77

8-
export class PolkaVMTasksForWrapping {
8+
export class PolkadotTasksForWrapping {
99
public taskNames: string[] = []
1010

1111
constructor() {

0 commit comments

Comments
 (0)