Skip to content

Commit

Permalink
Fixed toInstance in Truffle Adapter (#47)
Browse files Browse the repository at this point in the history
* Returned unused parameter

* Updated README

* Updated version

* Fixed await this._overrideConnectMethod(contract);
  • Loading branch information
KyrylR authored Oct 28, 2023
1 parent 6c82505 commit b2bad04
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ It is also **mandatory** to specify the naming convention for migrations such as
## Tasks

- `migrate` task, which allows you to deploy and automatically verify contracts.
<!-- - `migrate:verify` task, which helps you verify already deployed contracts. -->
- `migrate:verify` task, which helps you verify already deployed contracts.

> :warning: **Hardhat Config**: Make sure they are follow the docs from `@nomicfoundation/hardhat-verify`.
Expand Down Expand Up @@ -80,7 +80,8 @@ module.exports = {
skip: -1,
wait: 1,
verify: false,
attempts: 0,
verifyParallel: 1,
verifyAttempts: 3,
pathToMigrations: "./deploy",
force: false,
continue: false,
Expand All @@ -96,7 +97,8 @@ module.exports = {
- `skip`: The number of migration to skip. **Overrides only parameter.**
- `wait` : The number of confirmations to wait for after the transaction is mined.
- `verify` : The flag indicating whether the contracts should be verified.
- `attempts`: The number of attempts to verify the contract.
- `verifyParallel` : The size of the batch for verification.
- `verifyAttempts` : The number of attempts to verify the contract.
- `pathToMigrations` : The path to the folder with the specified migrations.
- `force` : The flag indicating whether the contracts compilation is forced.
- `continue` : The flag indicating whether the deployment should restore the state from the previous deployment.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@solarity/hardhat-migrate",
"version": "2.0.0-alpha.4",
"version": "2.0.0-alpha.5",
"description": "Automatic deployment and verification of smart contracts",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
5 changes: 3 additions & 2 deletions src/deployer/adapters/TruffleAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ export class TruffleAdapter extends Adapter {
);
}

public async toInstance<I>(instance: TruffleFactory<I>, address: string): Promise<I> {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public async toInstance<I>(instance: TruffleFactory<I>, address: string, _: OverridesAndMisc): Promise<I> {
const contract = this._hre.artifacts.require(instance.contractName!);

await this._overrideConnectMethod(instance);
await this._overrideConnectMethod(contract);

return contract.at(address);
}
Expand Down

0 comments on commit b2bad04

Please sign in to comment.