Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Web3 1.0 changes #230

Merged
merged 10 commits into from
Oct 16, 2018
Merged

Web3 1.0 changes #230

merged 10 commits into from
Oct 16, 2018

Conversation

justinkchen
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Oct 15, 2018

Pull Request Test Coverage Report for Build 2089

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 99.86%

Totals Coverage Status
Change from base Build 2043: 0.0%
Covered Lines: 518
Relevant Lines: 518

💛 - Coveralls

Copy link
Contributor

@felix2feng felix2feng left a comment

Choose a reason for hiding this comment

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

Took an initial look (need to look again at the mustache templates). See my comments. Major thing is if we can get a type re: contract instance

"sol-trace-set": "^0.0.1",
"solium": "^1.1.7",
"tiny-promisify": "^1.0.0",
"truffle-hdwallet-provider": "^0.0.3",
"truffle-hdwallet-provider": "^1.0.0-web3one.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

That's cool this dep has a web3 1.0 version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is required as part of the truffle 5 migration efforts too i think

"node_modules/*"
]
},
"declaration": true,
"declarationDir": "./dist/typings"
"declarationDir": "./dist/typings",
"esModuleInterop": true
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the benefit / need for esModuleInterop?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Required in order to allow for default imports (so we don't have to do require('...')) for modules that don't explicitly have that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in particular i think web3 and some other package had this problem that this was able to solve

@@ -14,14 +14,14 @@ export class BaseContract {
public abi: any[];
// public abi: Web3.AbiDefinition[];

public web3ContractInstance: Web3.ContractInstance;
public web3ContractInstance: any;
Copy link
Contributor

Choose a reason for hiding this comment

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

I get really nervous when we're moving to an any type. Is there another type we could use?

Copy link
Contributor

Choose a reason for hiding this comment

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

If it doesn't exist, we should consider creating our own type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no other type right now defined at least. web3.eth.Contract is a class that has a constructor to generate classes, but I couldn't get it working as a type yet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i guess same thing should be done for the // public abi: Web3.AbiDefinition[]; comment we have above. not sure why it was commented to be any there as well

"node_modules/*"
]
},
"declaration": true,
"declarationDir": "./dist/typings"
"declarationDir": "./dist/typings",
"esModuleInterop": true
Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -38,7 +38,15 @@ module.exports = {
gas: 0xfffffffffff,
gasPrice: 0x01,
},
}
},
compilers: {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we still need the top level solc: option?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think we may be able to get rid of that

Copy link
Contributor

Choose a reason for hiding this comment

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

still need it, or the lower level option is not getting picked up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

interesting, i know it picks up the compiler version, but maybe the solc is not somehow...or maybe its in your local truffle version not using it properly? Didn't you say you weren't on truffle 5 yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we can also keep for backwards compatibility on older truffle versions

@asoong asoong merged commit 1468207 into master Oct 16, 2018
@asoong asoong deleted the justin_chen-upgrade-web3-1.0 branch October 16, 2018 18:33
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.

4 participants