-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for map of contract addresses in getInstance function #239
base: develop
Are you sure you want to change the base?
Conversation
typescript/base/src/project.ts
Outdated
if (this.network.adapter.isAddress(aliasOrAddress)) { | ||
return this.getInstanceByAddress(aliasOrAddress); | ||
getInstance (target: string | MainContractAddress | ContractAddressMap) { | ||
const isStringAndAddress = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition can be simplified.
getAbiFilename (version: string) { | ||
return `${this.metadata.name}-${version}-abi.json`; | ||
} | ||
|
||
createInstance (address: string): Instance<ContractType> { | ||
createInstance (target: MainContractAddress | ContractAddressMap) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe let it be address
in assumption that ContractAddressMap
is also an "address" in some sense?
For me target
is too confusion because it's not clear what to pass.
…for ContractAddressMap
) { | ||
this.project = project; | ||
this.address = address; | ||
if (typeof address === "string") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace with isContractAddressMap
?
What was done
Motivation
- No main contract address is defined for a specific project.
- Additional or alternative contract configurations are required for different use cases.
No need for QA to test