Skip to content
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

Fix web3 and ethers types #158

Merged
merged 10 commits into from
Jan 28, 2022
Merged

Fix web3 and ethers types #158

merged 10 commits into from
Jan 28, 2022

Conversation

germartinez
Copy link
Member

@germartinez germartinez commented Jan 26, 2022

What it solves

Resolves #138

How this PR fixes it

  • Removes any type from web3 and ethers variables
  • Removes AbiItem local type
  • Fixes tests by removing the deterministicDeployment property from ERC20Mintable contract deployment (hardhat)
  • Updates deps

@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@germartinez germartinez marked this pull request as ready for review January 26, 2022 16:45
@germartinez germartinez requested a review from iamacook January 26, 2022 16:45
Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any is not your friend 🤣

@@ -99,15 +98,15 @@ class Web3Adapter implements EthAdapter {
return getGnosisSafeProxyFactoryContractInstance(safeVersion, proxyFactoryContract)
}

getContract(address: string, abi: AbiItem[]): any {
return new this.#web3.eth.Contract(abi, address)
getContract(address: string, abi: AbiItem | AbiItem[], options?: ContractOptions): any {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this really return any? 👀

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like the type is 'TODO:' on web3's end. It's possible to use ReturnType<typeof this.#web3.eth.Contract> to infer it I think. I'll resolve this, however, as it is not properly typed by a third party.

packages/safe-web3-lib/src/Web3Adapter.ts Outdated Show resolved Hide resolved
germartinez and others added 3 commits January 27, 2022 21:28
Remove --stream

Try compiling hardhat in postinstall

Restore --stream
Chore: use yarn cache in the CI script
Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for discussing the remaining issues with me. Looks great!

@germartinez germartinez merged commit 6e98ef6 into fix-deps Jan 28, 2022
@germartinez germartinez deleted the fix-types branch January 28, 2022 14:20
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants