Skip to content

Commit

Permalink
fix: replacing ProxyModule imports with DemoModule imports
Browse files Browse the repository at this point in the history
  • Loading branch information
EnThib authored and zoeyTM committed Feb 19, 2025
1 parent 73ee2b7 commit 5761175
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/src/content/ignition/docs/guides/upgradeable-proxies.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,15 +312,15 @@ Inside our `test` directory, we'll create a file called `ProxyDemo.js` (or `Prox
import { expect } from "chai";
import { ignition, ethers } from "hardhat";

import ProxyModule from "../ignition/modules/ProxyModule";
import DemoModule from "../ignition/modules/ProxyModule";
import UpgradeModule from "../ignition/modules/UpgradeModule";

describe("Demo Proxy", function () {
describe("Proxy interaction", function () {
it("Should be interactable via proxy", async function () {
const [, otherAccount] = await ethers.getSigners();

const { demo } = await ignition.deploy(ProxyModule);
const { demo } = await ignition.deploy(DemoModule);

expect(await demo.connect(otherAccount).version()).to.equal("1.0.0");
});
Expand Down Expand Up @@ -353,15 +353,15 @@ describe("Demo Proxy", function () {
```javascript
const { expect } = require("chai");

const ProxyModule = require("../ignition/modules/ProxyModule");
const DemoModule = require("../ignition/modules/ProxyModule");
const UpgradeModule = require("../ignition/modules/UpgradeModule");

describe("Demo Proxy", function () {
describe("Proxy interaction", function () {
it("Should be interactable via proxy", async function () {
const [, otherAccount] = await ethers.getSigners();

const { demo } = await ignition.deploy(ProxyModule);
const { demo } = await ignition.deploy(DemoModule);

expect(await demo.connect(otherAccount).version()).to.equal("1.0.0");
});
Expand Down Expand Up @@ -391,7 +391,7 @@ describe("Demo Proxy", function () {

::::

Here we use Hardhat Ignition to deploy our imported modules. First, we deploy our base `ProxyModule` that returns the first version of our `Demo` contract and tests it to ensure the proxy worked and retrieves the appropriate version string. Then, we deploy our `UpgradeModule` that returns an upgraded version of our `Demo` contract and tests it to ensure the proxy returns the updated version string. We also test that our initialization function was called, setting the `name` state variable to `"Example Name"`.
Here we use Hardhat Ignition to deploy our imported modules. First, we deploy our base `DemoModule` that returns the first version of our `Demo` contract and tests it to ensure the proxy worked and retrieves the appropriate version string. Then, we deploy our `UpgradeModule` that returns an upgraded version of our `Demo` contract and tests it to ensure the proxy returns the updated version string. We also test that our initialization function was called, setting the `name` state variable to `"Example Name"`.

## Further reading

Expand Down

0 comments on commit 5761175

Please sign in to comment.