Skip to content

Commit

Permalink
Merge pull request sphinx-labs#247 from chugsplash/sg/develop
Browse files Browse the repository at this point in the history
fix(pg): throw an error if user tries to fund an unregistered project
  • Loading branch information
sam-goldman authored Nov 22, 2022
2 parents 223ebf3 + 48c938c commit 0485624
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/clean-goats-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chugsplash/plugins': patch
---

Throw an error if user attempts to fund a project that hasn't been registered
8 changes: 8 additions & 0 deletions packages/plugins/src/hardhat/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,14 @@ Please send more ETH to ${await signer.getAddress()} on ${
} then try again.`)
}

if (!(await isProjectRegistered(signer, projectName))) {
errorProjectNotRegistered(
await getChainId(hre.ethers.provider),
hre.network.name,
configPath
)
}

spinner.start(
`Depositing ${ethers.utils.formatEther(
amount
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npx hardhat chugsplash-register --network ${networkName} ${configPath}
throw new Error(`This project has not been registered on the local Hardhat network.
You can register the project locally with the following commands:
npx hardhat node --setup-internals
npx hardhat node
npx hardhat chugsplash-register --network localhost ${configPath}
`)
}
Expand Down

0 comments on commit 0485624

Please sign in to comment.