Use AbiType
This commit is contained in:
@@ -86,7 +86,7 @@
|
||||
"types-ethereumjs-util": "^0.0.5",
|
||||
"typescript": "^2.4.1",
|
||||
"web3-provider-engine": "^13.0.1",
|
||||
"web3-typescript-typings": "^0.4.1",
|
||||
"web3-typescript-typings": "^0.5.0",
|
||||
"webpack": "^3.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@@ -22,7 +22,7 @@ export class Contract implements Web3.ContractInstance {
|
||||
this.validator = new SchemaValidator();
|
||||
}
|
||||
private populateFunctions(): void {
|
||||
const functionsAbi = _.filter(this.abi, abiPart => abiPart.type === 'function');
|
||||
const functionsAbi = _.filter(this.abi, abiPart => abiPart.type === Web3.AbiType.Function);
|
||||
_.forEach(functionsAbi, (functionAbi: Web3.MethodAbi) => {
|
||||
if (functionAbi.constant) {
|
||||
const cbStyleCallFunction = this.contract[functionAbi.name].call;
|
||||
@@ -40,7 +40,7 @@ export class Contract implements Web3.ContractInstance {
|
||||
});
|
||||
}
|
||||
private populateEvents(): void {
|
||||
const eventsAbi = _.filter(this.abi, abiPart => abiPart.type === 'event');
|
||||
const eventsAbi = _.filter(this.abi, abiPart => abiPart.type === Web3.AbiType.Event);
|
||||
_.forEach(eventsAbi, (eventAbi: Web3.EventAbi) => {
|
||||
this[eventAbi.name] = this.contract[eventAbi.name];
|
||||
});
|
||||
|
@@ -5005,9 +5005,9 @@ web3-provider-engine@^8.4.0:
|
||||
xhr "^2.2.0"
|
||||
xtend "^4.0.1"
|
||||
|
||||
web3-typescript-typings@^0.4.1:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/web3-typescript-typings/-/web3-typescript-typings-0.4.1.tgz#077f5c042c1d2625b4cabedad88b9e9427b38fb3"
|
||||
web3-typescript-typings@^0.5.0:
|
||||
version "0.5.0"
|
||||
resolved "https://registry.yarnpkg.com/web3-typescript-typings/-/web3-typescript-typings-0.5.0.tgz#a598ad5d4600c53d8e865c52e52b62f2ad04ec84"
|
||||
dependencies:
|
||||
bignumber.js "^4.0.2"
|
||||
|
||||
|
Reference in New Issue
Block a user