web3-eth-contract
Advanced tools
Comparing version 1.2.4 to 1.2.5-rc.0
{ | ||
"name": "web3-eth-contract", | ||
"version": "1.2.4", | ||
"version": "1.2.5-rc.0", | ||
"description": "Web3 module to interact with Ethereum smart contracts.", | ||
@@ -18,9 +18,9 @@ "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-eth-contract", | ||
"underscore": "1.9.1", | ||
"web3-core": "1.2.4", | ||
"web3-core-helpers": "1.2.4", | ||
"web3-core-method": "1.2.4", | ||
"web3-core-promievent": "1.2.4", | ||
"web3-core-subscriptions": "1.2.4", | ||
"web3-eth-abi": "1.2.4", | ||
"web3-utils": "1.2.4" | ||
"web3-core": "1.2.5-rc.0", | ||
"web3-core-helpers": "1.2.5-rc.0", | ||
"web3-core-method": "1.2.5-rc.0", | ||
"web3-core-promievent": "1.2.5-rc.0", | ||
"web3-core-subscriptions": "1.2.5-rc.0", | ||
"web3-eth-abi": "1.2.5-rc.0", | ||
"web3-utils": "1.2.5-rc.0" | ||
}, | ||
@@ -31,3 +31,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "341015ab24efc3ea1e5d8afd07e8c92a7c738536" | ||
"gitHead": "e919f81ccf7fee23a2d9075fa141bec0ff4a087a" | ||
} |
108
src/index.js
@@ -183,9 +183,82 @@ /* | ||
var defaultBlock = this.constructor.defaultBlock || 'latest'; | ||
this.transactionBlockTimeout = this.constructor.transactionBlockTimeout; | ||
this.transactionConfirmationBlocks = this.constructor.transactionConfirmationBlocks; | ||
this.transactionPollingTimeout = this.constructor.transactionPollingTimeout; | ||
this.defaultChain = this.constructor.defaultChain; | ||
this.defaultHardfork = this.constructor.defaultHardfork; | ||
this.defaultCommon = this.constructor.defaultCommon; | ||
Object.defineProperty(this, 'handleRevert', { | ||
get: function () { | ||
if (_this.options.handleRevert === false || _this.options.handleRevert === true) { | ||
return _this.options.handleRevert; | ||
} | ||
return this.constructor.handleRevert; | ||
}, | ||
set: function (val) { | ||
_this.options.handleRevert = val; | ||
}, | ||
enumerable: true | ||
}); | ||
Object.defineProperty(this, 'defaultCommon', { | ||
get: function () { | ||
return _this.options.common || this.constructor.defaultCommon; | ||
}, | ||
set: function (val) { | ||
_this.options.common = val; | ||
}, | ||
enumerable: true | ||
}); | ||
Object.defineProperty(this, 'defaultHardfork', { | ||
get: function () { | ||
return _this.options.hardfork || this.constructor.defaultHardfork; | ||
}, | ||
set: function (val) { | ||
_this.options.hardfork = val; | ||
}, | ||
enumerable: true | ||
}); | ||
Object.defineProperty(this, 'defaultChain', { | ||
get: function () { | ||
return _this.options.chain || this.constructor.defaultChain; | ||
}, | ||
set: function (val) { | ||
_this.options.chain = val; | ||
}, | ||
enumerable: true | ||
}); | ||
Object.defineProperty(this, 'transactionPollingTimeout', { | ||
get: function () { | ||
if (_this.options.transactionPollingTimeout === 0) { | ||
return _this.options.transactionPollingTimeout; | ||
} | ||
return _this.options.transactionPollingTimeout || this.constructor.transactionPollingTimeout; | ||
}, | ||
set: function (val) { | ||
_this.options.transactionPollingTimeout = val; | ||
}, | ||
enumerable: true | ||
}); | ||
Object.defineProperty(this, 'transactionConfirmationBlocks', { | ||
get: function () { | ||
if (_this.options.transactionConfirmationBlocks === 0) { | ||
return _this.options.transactionConfirmationBlocks; | ||
} | ||
return _this.options.transactionConfirmationBlocks || this.constructor.transactionConfirmationBlocks; | ||
}, | ||
set: function (val) { | ||
_this.options.transactionConfirmationBlocks = val; | ||
}, | ||
enumerable: true | ||
}); | ||
Object.defineProperty(this, 'transactionBlockTimeout', { | ||
get: function () { | ||
if (_this.options.transactionBlockTimeout === 0) { | ||
return _this.options.transactionBlockTimeout; | ||
} | ||
return _this.options.transactionBlockTimeout || this.constructor.transactionBlockTimeout; | ||
}, | ||
set: function (val) { | ||
_this.options.transactionBlockTimeout = val; | ||
}, | ||
enumerable: true | ||
}); | ||
Object.defineProperty(this, 'defaultAccount', { | ||
@@ -238,3 +311,3 @@ get: function () { | ||
/** | ||
* Get the callback and modiufy the array if necessary | ||
* Get the callback and modify the array if necessary | ||
* | ||
@@ -382,3 +455,16 @@ * @method _getCallback | ||
// Handle case where an event signature shadows the current ABI with non-identical | ||
// arg indexing. If # of topics doesn't match, event is anon. | ||
if (!event.anonymous){ | ||
let indexedInputs = 0; | ||
event.inputs.forEach(input => input.indexed ? indexedInputs++ : null); | ||
if (indexedInputs > 0 && (data.topics.length !== indexedInputs + 1)){ | ||
event = { | ||
anonymous: true, | ||
inputs: [] | ||
}; | ||
} | ||
} | ||
var argTopics = event.anonymous ? data.topics : data.topics.slice(1); | ||
@@ -832,3 +918,5 @@ | ||
defaultAccount: _this._parent.defaultAccount, | ||
defaultBlock: _this._parent.defaultBlock | ||
defaultBlock: _this._parent.defaultBlock, | ||
handleRevert: _this._parent.handleRevert, | ||
abiCoder: abi | ||
})).createFunction(); | ||
@@ -910,3 +998,5 @@ | ||
defaultHardfork: _this._parent.defaultHardfork, | ||
extraFormatters: extraFormatters | ||
handleRevert: _this._parent.handleRevert, | ||
extraFormatters: extraFormatters, | ||
abiCoder: abi | ||
})).createFunction(); | ||
@@ -913,0 +1003,0 @@ |
@@ -34,3 +34,3 @@ /* | ||
defaultAccount: string | null; | ||
defaultBlock: string | number; | ||
defaultBlock: BlockNumber; | ||
defaultCommon: Common; | ||
@@ -37,0 +37,0 @@ defaultHardfork: hardfork; |
@@ -28,3 +28,3 @@ /* | ||
// $ExpectType string | number | ||
// $ExpectType BlockNumber | ||
contract.defaultBlock; | ||
@@ -31,0 +31,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45707
1124
2
+ Addedweb3-core@1.2.5-rc.0(transitive)
+ Addedweb3-core-helpers@1.2.5-rc.0(transitive)
+ Addedweb3-core-method@1.2.5-rc.0(transitive)
+ Addedweb3-core-promievent@1.2.5-rc.0(transitive)
+ Addedweb3-core-requestmanager@1.2.5-rc.0(transitive)
+ Addedweb3-core-subscriptions@1.2.5-rc.0(transitive)
+ Addedweb3-eth-abi@1.2.5-rc.0(transitive)
+ Addedweb3-eth-iban@1.2.5-rc.0(transitive)
+ Addedweb3-providers-http@1.2.5-rc.0(transitive)
+ Addedweb3-providers-ipc@1.2.5-rc.0(transitive)
+ Addedweb3-providers-ws@1.2.5-rc.0(transitive)
+ Addedweb3-utils@1.2.5-rc.0(transitive)
- Removed@types/bignumber.js@5.0.4(transitive)
- Removedbignumber.js@9.1.2(transitive)
- Removedweb3-core@1.2.4(transitive)
- Removedweb3-core-helpers@1.2.4(transitive)
- Removedweb3-core-method@1.2.4(transitive)
- Removedweb3-core-promievent@1.2.4(transitive)
- Removedweb3-core-requestmanager@1.2.4(transitive)
- Removedweb3-core-subscriptions@1.2.4(transitive)
- Removedweb3-eth-abi@1.2.4(transitive)
- Removedweb3-eth-iban@1.2.4(transitive)
- Removedweb3-providers-http@1.2.4(transitive)
- Removedweb3-providers-ipc@1.2.4(transitive)
- Removedweb3-providers-ws@1.2.4(transitive)
- Removedweb3-utils@1.2.4(transitive)
Updatedweb3-core@1.2.5-rc.0
Updatedweb3-core-helpers@1.2.5-rc.0
Updatedweb3-core-method@1.2.5-rc.0
Updatedweb3-eth-abi@1.2.5-rc.0
Updatedweb3-utils@1.2.5-rc.0