-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an ability to change signer during the migration (#79)
* Added an ability to change signer during the migration * Updated CHANGELOG.md * Updated package version * Updated README.md
- Loading branch information
Showing
14 changed files
with
127 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...fixture-projects/hardhat-project-typechain-ethers/deploy/4_different.signers.migration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Deployer } from "../../../../src/deployer/Deployer"; | ||
|
||
import { GovToken__factory } from "../typechain-types"; | ||
|
||
export = async (deployer: Deployer) => { | ||
await deployer.setSigner("0x70997970C51812dc3A010C7d01b50e0d17dc79C8"); | ||
|
||
await deployer.deploy(GovToken__factory, ["Token", "TKN"], { name: "Governance Token #12" }); | ||
|
||
const govToken5 = await deployer.deployed(GovToken__factory, "Governance Token #12"); | ||
|
||
if ((await govToken5.owner()) !== "0x70997970C51812dc3A010C7d01b50e0d17dc79C8") { | ||
console.error("Owner is not set correctly"); | ||
process.exit(1); | ||
} | ||
|
||
await deployer.setSigner(); | ||
|
||
const newToken = await deployer.deploy(GovToken__factory, ["Token", "TKN"], { name: "Governance Token #13" }); | ||
|
||
if ((await newToken.owner()) !== "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266") { | ||
console.error("Owner is not set correctly"); | ||
process.exit(1); | ||
} | ||
}; |
27 changes: 27 additions & 0 deletions
27
...ixture-projects/hardhat-project-typechain-truffle/deploy/4_different.signers.migration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Deployer } from "../../../../src/deployer/Deployer"; | ||
|
||
export = async (deployer: Deployer) => { | ||
// Moved here for testing reasons, before it was initialized globally once and failed on the second test on the .link function. | ||
// Because Truffle throws an error if attempting to link the same object twice to the same library. | ||
const GovToken = artifacts.require("GovToken"); | ||
|
||
await deployer.setSigner("0x70997970C51812dc3A010C7d01b50e0d17dc79C8"); | ||
|
||
await deployer.deploy(GovToken, ["Token", "TKN"], { name: "Governance Token #12" }); | ||
|
||
const govToken5 = await deployer.deployed(GovToken, "Governance Token #12"); | ||
|
||
if ((await govToken5.owner()) !== "0x70997970C51812dc3A010C7d01b50e0d17dc79C8") { | ||
console.error("Owner is not set correctly"); | ||
process.exit(1); | ||
} | ||
|
||
await deployer.setSigner(); | ||
|
||
const newToken = await deployer.deploy(GovToken, ["Token", "TKN"], { name: "Governance Token #13" }); | ||
|
||
if ((await newToken.owner()) !== "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266") { | ||
console.error("Owner is not set correctly"); | ||
process.exit(1); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters