This commit is contained in:
Marek Kotewicz 2015-06-30 13:01:30 +02:00
parent 490dde52a7
commit d9b785ec41
7 changed files with 38 additions and 11 deletions

3
dist/web3-light.js vendored
View File

@ -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
};
};

File diff suppressed because one or more lines are too long

3
dist/web3.js vendored
View File

@ -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

File diff suppressed because one or more lines are too long

7
dist/web3.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -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
};
};

View File

@ -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));