mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-23 11:38:12 +00:00
fixed #248
This commit is contained in:
parent
490dde52a7
commit
d9b785ec41
3
dist/web3-light.js
vendored
3
dist/web3-light.js
vendored
@ -3123,8 +3123,9 @@ SolidityFunction.prototype.request = function () {
|
||||
var format = this.unpackOutput.bind(this);
|
||||
|
||||
return {
|
||||
method: this._constant ? 'eth_call' : 'eth_sendTransaction',
|
||||
callback: callback,
|
||||
payload: payload,
|
||||
params: [payload],
|
||||
format: format
|
||||
};
|
||||
};
|
||||
|
4
dist/web3-light.min.js
vendored
4
dist/web3-light.min.js
vendored
File diff suppressed because one or more lines are too long
3
dist/web3.js
vendored
3
dist/web3.js
vendored
@ -3123,8 +3123,9 @@ SolidityFunction.prototype.request = function () {
|
||||
var format = this.unpackOutput.bind(this);
|
||||
|
||||
return {
|
||||
method: this._constant ? 'eth_call' : 'eth_sendTransaction',
|
||||
callback: callback,
|
||||
payload: payload,
|
||||
params: [payload],
|
||||
format: format
|
||||
};
|
||||
};
|
||||
|
4
dist/web3.js.map
vendored
4
dist/web3.js.map
vendored
File diff suppressed because one or more lines are too long
7
dist/web3.min.js
vendored
7
dist/web3.min.js
vendored
File diff suppressed because one or more lines are too long
@ -188,8 +188,9 @@ SolidityFunction.prototype.request = function () {
|
||||
var format = this.unpackOutput.bind(this);
|
||||
|
||||
return {
|
||||
method: this._constant ? 'eth_call' : 'eth_sendTransaction',
|
||||
callback: callback,
|
||||
payload: payload,
|
||||
params: [payload],
|
||||
format: format
|
||||
};
|
||||
};
|
||||
|
@ -28,6 +28,16 @@ describe('lib/web3/batch', function () {
|
||||
done();
|
||||
};
|
||||
|
||||
provider.injectValidation(function (payload) {
|
||||
var first = payload[0];
|
||||
var second = payload[1];
|
||||
|
||||
assert.equal(first.method, 'eth_getBalance');
|
||||
assert.deepEqual(first.params, ['0x0000000000000000000000000000000000000000', 'latest']);
|
||||
assert.equal(second.method, 'eth_getBalance');
|
||||
assert.deepEqual(second.params, ['0x0000000000000000000000000000000000000005', 'latest']);
|
||||
});
|
||||
|
||||
var batch = web3.createBatch();
|
||||
batch.add(web3.eth.getBalance.request('0x0000000000000000000000000000000000000000', 'latest', callback));
|
||||
batch.add(web3.eth.getBalance.request('0x0000000000000000000000000000000000000005', 'latest', callback2));
|
||||
@ -55,7 +65,7 @@ describe('lib/web3/batch', function () {
|
||||
}];
|
||||
|
||||
|
||||
var address = '0x0000000000000000000000000000000000000000';
|
||||
var address = '0x1000000000000000000000000000000000000001';
|
||||
var result = '0x126';
|
||||
var result2 = '0x0000000000000000000000000000000000000000000000000000000000000123';
|
||||
|
||||
@ -71,6 +81,19 @@ describe('lib/web3/batch', function () {
|
||||
done();
|
||||
};
|
||||
|
||||
provider.injectValidation(function (payload) {
|
||||
var first = payload[0];
|
||||
var second = payload[1];
|
||||
|
||||
assert.equal(first.method, 'eth_getBalance');
|
||||
assert.deepEqual(first.params, ['0x0000000000000000000000000000000000000000', 'latest']);
|
||||
assert.equal(second.method, 'eth_call');
|
||||
assert.deepEqual(second.params, [{
|
||||
'to': '0x1000000000000000000000000000000000000001',
|
||||
'data': '0xe3d670d70000000000000000000000001000000000000000000000000000000000000001'
|
||||
}]);
|
||||
});
|
||||
|
||||
var batch = web3.createBatch();
|
||||
batch.add(web3.eth.getBalance.request('0x0000000000000000000000000000000000000000', 'latest', callback));
|
||||
batch.add(web3.eth.contract(abi).at(address).balance.request(address, callback2));
|
||||
|
Loading…
x
Reference in New Issue
Block a user