forked from tornado-packages/ethers.js
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7250cdcd31 | ||
|
|
20f34f1ba9 | ||
|
|
4ac08432b8 | ||
|
|
3e3048df81 | ||
|
|
c6199bf52a | ||
|
|
20409c083c | ||
|
|
7a90f18145 | ||
|
|
df1ae611ba | ||
|
|
6009a26c89 | ||
|
|
30984b6f00 | ||
|
|
76a8e503dd | ||
|
|
d0e0e30532 | ||
|
|
5af16a6090 |
18
CHANGELOG.md
18
CHANGELOG.md
@@ -1,6 +1,24 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
ethers/v4.0.41 (2019-12-21 01:05)
|
||||
---------------------------------
|
||||
|
||||
- Added proper support for v0.6 Solidity JSON type ([#688](https://github.com/ethers-io/ethers.js/issues/688); [20f34f1](https://github.com/ethers-io/ethers.js/commit/20f34f1ba9c698d1731cb12c5de1822ad462fd7f)).
|
||||
|
||||
ethers/v4.0.40 (2019-11-24 19:58)
|
||||
---------------------------------
|
||||
|
||||
- Update elliptic package to protect from Minerva timing attack ([#666](https://github.com/ethers-io/ethers.js/issues/666); [20409c0](https://github.com/ethers-io/ethers.js/commit/20409c083cd428c46cba09488ee609cc14ff1d2b)).
|
||||
- Do not poll if disabled during the previous event loop. ([7a90f18](https://github.com/ethers-io/ethers.js/commit/7a90f18145931e7ff790cd9e1fd549929fbb9023)).
|
||||
- Moved node types to devDependencies ([#663](https://github.com/ethers-io/ethers.js/issues/663); [df1ae61](https://github.com/ethers-io/ethers.js/commit/df1ae611bab0955005b0da6604191b60b34f198f)).
|
||||
- Added provider property to Web3Provider ([#641](https://github.com/ethers-io/ethers.js/issues/641); [6009a26](https://github.com/ethers-io/ethers.js/commit/6009a26c89c359ae44ef4b6e8a664ed57db24f67)).
|
||||
|
||||
ethers/v4.0.39 (2019-10-30 19:15)
|
||||
---------------------------------
|
||||
|
||||
- Fix filters by forcing a poll instantly when polling starts to capture the current block. ([#613](https://github.com/ethers-io/ethers.js/issues/613); [d0e0e30](https://github.com/ethers-io/ethers.js/commit/d0e0e30532baf387df6b4a8efe0805986cc265f2))
|
||||
|
||||
ethers/v4.0.38 (2019-10-17 01:28)
|
||||
---------------------------------
|
||||
|
||||
|
||||
2
_version.d.ts
vendored
2
_version.d.ts
vendored
@@ -1 +1 @@
|
||||
export declare const version = "4.0.38";
|
||||
export declare const version = "4.0.41";
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "4.0.38";
|
||||
exports.version = "4.0.41";
|
||||
|
||||
611
dist/ethers.js
vendored
611
dist/ethers.js
vendored
File diff suppressed because it is too large
Load Diff
2
dist/ethers.min.js
vendored
2
dist/ethers.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/ethers.min.js.map
vendored
2
dist/ethers.min.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/ethers.types.txt
vendored
2
dist/ethers.types.txt
vendored
@@ -266,7 +266,7 @@ declare module 'ethers/utils/shims' {
|
||||
}
|
||||
|
||||
declare module 'ethers/_version' {
|
||||
export const version = "4.0.38";
|
||||
export const version = "4.0.41";
|
||||
}
|
||||
|
||||
declare module 'ethers/utils/bignumber' {
|
||||
|
||||
2
dist/shims.js
vendored
2
dist/shims.js
vendored
File diff suppressed because one or more lines are too long
20
package-lock.json
generated
20
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ethers",
|
||||
"version": "4.0.37",
|
||||
"version": "4.0.40",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -92,7 +92,8 @@
|
||||
"@types/node": {
|
||||
"version": "10.14.12",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.12.tgz",
|
||||
"integrity": "sha512-QcAKpaO6nhHLlxWBvpc4WeLrTvPqlHOvaj0s5GriKkA1zq+bsFBPpfYCvQhLqLgYlIko8A9YrPdaMHCo5mBcpg=="
|
||||
"integrity": "sha512-QcAKpaO6nhHLlxWBvpc4WeLrTvPqlHOvaj0s5GriKkA1zq+bsFBPpfYCvQhLqLgYlIko8A9YrPdaMHCo5mBcpg==",
|
||||
"dev": true
|
||||
},
|
||||
"JSONStream": {
|
||||
"version": "1.3.5",
|
||||
@@ -1827,14 +1828,17 @@
|
||||
"dev": true
|
||||
},
|
||||
"elliptic": {
|
||||
"version": "6.3.3",
|
||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz",
|
||||
"integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=",
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz",
|
||||
"integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==",
|
||||
"requires": {
|
||||
"bn.js": "^4.4.0",
|
||||
"brorand": "^1.0.1",
|
||||
"hash.js": "^1.0.0",
|
||||
"inherits": "^2.0.1"
|
||||
"hmac-drbg": "^1.0.0",
|
||||
"inherits": "^2.0.1",
|
||||
"minimalistic-assert": "^1.0.0",
|
||||
"minimalistic-crypto-utils": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"emoji-regex": {
|
||||
@@ -3661,7 +3665,6 @@
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
|
||||
"integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"hash.js": "^1.0.3",
|
||||
"minimalistic-assert": "^1.0.0",
|
||||
@@ -4589,8 +4592,7 @@
|
||||
"minimalistic-crypto-utils": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz",
|
||||
"integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=",
|
||||
"dev": true
|
||||
"integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo="
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ethers",
|
||||
"version": "4.0.38",
|
||||
"version": "4.0.41",
|
||||
"description": "Ethereum wallet library.",
|
||||
"main": "./index.js",
|
||||
"types": "./index.d.ts",
|
||||
@@ -19,10 +19,9 @@
|
||||
"version": "npm dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": "^10.3.2",
|
||||
"aes-js": "3.0.0",
|
||||
"bn.js": "^4.4.0",
|
||||
"elliptic": "6.3.3",
|
||||
"elliptic": "6.5.2",
|
||||
"hash.js": "1.1.3",
|
||||
"js-sha3": "0.5.7",
|
||||
"scrypt-js": "2.0.4",
|
||||
@@ -31,6 +30,7 @@
|
||||
"xmlhttprequest": "1.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^10.3.2",
|
||||
"browserify": "^16.2.3",
|
||||
"browserify-zlib": "^0.2.0",
|
||||
"dts-bundle": "^0.7.3",
|
||||
|
||||
@@ -452,6 +452,9 @@ var BaseProvider = /** @class */ (function (_super) {
|
||||
BaseProvider.prototype._doPoll = function () {
|
||||
var _this = this;
|
||||
this.getBlockNumber().then(function (blockNumber) {
|
||||
if (!_this.polling) {
|
||||
return;
|
||||
}
|
||||
_this._setFastBlockNumber(blockNumber);
|
||||
// If the block hasn't changed, meh.
|
||||
if (blockNumber === _this._lastBlockNumber) {
|
||||
@@ -594,6 +597,7 @@ var BaseProvider = /** @class */ (function (_super) {
|
||||
setTimeout(function () {
|
||||
if (value && !_this._poller) {
|
||||
_this._poller = setInterval(_this._doPoll.bind(_this), _this.pollingInterval);
|
||||
_this._doPoll();
|
||||
}
|
||||
else if (!value && _this._poller) {
|
||||
clearInterval(_this._poller);
|
||||
|
||||
@@ -47,6 +47,8 @@ var Web3Provider = /** @class */ (function (_super) {
|
||||
errors.throwError('invalid web3Provider', errors.INVALID_ARGUMENT, { arg: 'web3Provider', value: web3Provider });
|
||||
}
|
||||
properties_1.defineReadOnly(_this, '_web3Provider', web3Provider);
|
||||
// @TODO: In v5 remove the above definition; only this one is needed
|
||||
properties_1.defineReadOnly(_this, 'provider', web3Provider);
|
||||
return _this;
|
||||
}
|
||||
Web3Provider.prototype.send = function (method, params) {
|
||||
|
||||
@@ -1 +1 @@
|
||||
export const version = "4.0.38";
|
||||
export const version = "4.0.41";
|
||||
|
||||
@@ -573,6 +573,8 @@ export class BaseProvider extends Provider {
|
||||
|
||||
private _doPoll(): void {
|
||||
this.getBlockNumber().then((blockNumber) => {
|
||||
if (!this.polling) { return; }
|
||||
|
||||
this._setFastBlockNumber(blockNumber);
|
||||
|
||||
// If the block hasn't changed, meh.
|
||||
@@ -666,6 +668,7 @@ export class BaseProvider extends Provider {
|
||||
toBlock: blockNumber,
|
||||
topics: topics
|
||||
}
|
||||
|
||||
if (!filter.address) { delete filter.address; }
|
||||
this.getLogs(filter).then((logs) => {
|
||||
if (logs.length === 0) { return; }
|
||||
@@ -716,6 +719,7 @@ export class BaseProvider extends Provider {
|
||||
setTimeout(() => {
|
||||
if (value && !this._poller) {
|
||||
this._poller = setInterval(this._doPoll.bind(this), this.pollingInterval);
|
||||
this._doPoll();
|
||||
|
||||
} else if (!value && this._poller) {
|
||||
clearInterval(this._poller);
|
||||
|
||||
@@ -55,6 +55,9 @@ export class Web3Provider extends JsonRpcProvider {
|
||||
}
|
||||
|
||||
defineReadOnly(this, '_web3Provider', web3Provider);
|
||||
|
||||
// @TODO: In v5 remove the above definition; only this one is needed
|
||||
defineReadOnly(this, 'provider', web3Provider);
|
||||
}
|
||||
|
||||
send(method: string, params: any): Promise<any> {
|
||||
|
||||
@@ -311,6 +311,13 @@ function addMethod(method: any): void {
|
||||
let signature = formatSignature(method).replace(/tuple/g, '');
|
||||
let sighash = id(signature).substring(0, 10);
|
||||
|
||||
let isConst = false;
|
||||
if (method.constant != null) {
|
||||
isConst = method.constant;
|
||||
} else if (method.stateMutability != null) {
|
||||
isConst = (method.stateMutability == "view" || method.stateMutability == "pure");
|
||||
}
|
||||
|
||||
let description = new _FunctionDescription({
|
||||
inputs: method.inputs,
|
||||
outputs: method.outputs,
|
||||
@@ -318,7 +325,7 @@ function addMethod(method: any): void {
|
||||
gas: method.gas,
|
||||
|
||||
payable: (method.payable == null || !!method.payable),
|
||||
type: ((method.constant) ? 'call': 'transaction'),
|
||||
type: (isConst ? 'call': 'transaction'),
|
||||
|
||||
name: method.name,
|
||||
signature: signature,
|
||||
|
||||
@@ -63,7 +63,7 @@ Building Testcases
|
||||
------------------
|
||||
|
||||
Each suite of testcases is produced from a variety of sources. Many include a
|
||||
specific set of test vecotrs as well as procedurally generated tests using known
|
||||
specific set of test vectors as well as procedurally generated tests using known
|
||||
correct implementations.
|
||||
|
||||
The `contract-interface` test cases are created by selecting a (deterministically) random
|
||||
|
||||
@@ -110,4 +110,8 @@ function Reporter(runner) {
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
window.ethersReporter = Reporter;
|
||||
} catch (error) { }
|
||||
|
||||
module.exports = Reporter;
|
||||
|
||||
@@ -59,6 +59,13 @@ if (!ArrayBuffer.isView) {
|
||||
}
|
||||
}
|
||||
|
||||
if (Array.prototype.fill == null) {
|
||||
shims.push("Array.fill");
|
||||
Array.prototype.fill = function(value) {
|
||||
for (var i = 0; i < this.length; i++) { this[i] = value; }
|
||||
}
|
||||
}
|
||||
|
||||
// Shim nextTick
|
||||
if (!global.nextTick) {
|
||||
shims.push("nextTick");
|
||||
|
||||
@@ -540,3 +540,46 @@ describe('Test Filters', function() {
|
||||
doTest(test);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Test Solidity v0.6 ABI', function() {
|
||||
|
||||
var tests = [
|
||||
{
|
||||
inputs: [ ],
|
||||
outputs: [ ],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
name: "testView_call"
|
||||
},
|
||||
{
|
||||
inputs: [ ],
|
||||
outputs: [ ],
|
||||
stateMutability: "pure",
|
||||
type: "function",
|
||||
name: "testPure_call"
|
||||
},
|
||||
{
|
||||
inputs: [ ],
|
||||
outputs: [ ],
|
||||
stateMutability: "payable",
|
||||
type: "function",
|
||||
name: "testPayable_transaction"
|
||||
},
|
||||
{
|
||||
inputs: [ ],
|
||||
outputs: [ ],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
name: "testNonpayable_transaction"
|
||||
},
|
||||
];
|
||||
|
||||
tests.forEach(function(test, index) {
|
||||
var type = test.name.split("_")[1];
|
||||
it(('generates fragment from ABI - ' + test.name.split("_")[0]), function() {
|
||||
var iface = new ethers.utils.Interface(JSON.stringify([ test ]));
|
||||
var func = iface.functions[test.name];
|
||||
assert.equal(func.type, type, "matches type");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
<!-- Run the test cases! -->
|
||||
<script type="text/javascript">
|
||||
mocha.reporter(tests.reporter);
|
||||
mocha.reporter(ethersReporter);
|
||||
|
||||
// Use this to focus on specific test cases
|
||||
//mocha.grep(new RegExp('easyseed')).run();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
var assert = require('assert');
|
||||
|
||||
function getEthers(filename) {
|
||||
let ethers = require('../index');
|
||||
var ethers = require('../index');
|
||||
console.log('Loaded local ethers: ' + filename);
|
||||
assert.equal(ethers.platform, 'node', 'platform: ' + ethers.platform + ' != "node"');
|
||||
return ethers;
|
||||
|
||||
@@ -243,12 +243,19 @@ function addMethod(method) {
|
||||
case 'function': {
|
||||
var signature = abi_coder_1.formatSignature(method).replace(/tuple/g, '');
|
||||
var sighash = hash_1.id(signature).substring(0, 10);
|
||||
var isConst = false;
|
||||
if (method.constant != null) {
|
||||
isConst = method.constant;
|
||||
}
|
||||
else if (method.stateMutability != null) {
|
||||
isConst = (method.stateMutability == "view" || method.stateMutability == "pure");
|
||||
}
|
||||
var description = new _FunctionDescription({
|
||||
inputs: method.inputs,
|
||||
outputs: method.outputs,
|
||||
gas: method.gas,
|
||||
payable: (method.payable == null || !!method.payable),
|
||||
type: ((method.constant) ? 'call' : 'transaction'),
|
||||
type: (isConst ? 'call' : 'transaction'),
|
||||
name: method.name,
|
||||
signature: signature,
|
||||
sighash: sighash,
|
||||
|
||||
Reference in New Issue
Block a user