mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
9470fa2d4c
ecde334 Merge pull request #241 from SilentCicero/master 3af1e82 Update eth.js 86d9b58 Added sendRawTransaction 4228b02 common fixes in requestmanager 47e292a version 0.6.0 c597034 gulp 9417bbf Merge branch 'master' into develop 15df5d6 Merge branch 'master' of https://github.com/ethereum/ethereum.js e947252 Merge pull request #234 from ethereum/ethers-patch-1 4d165de update license per name change to web3.js 03ae21b special logs will never be nulls, so there is no reason to check for null value 66f1def updated dependencies, gulp ccb436e Merge branch 'master' into develop d729884 unrelevant change in example fdf46ed fixed providor not set in request manager 811e3b2 Merge branch 'develop' of https://github.com/ethereum/ethereum.js into develop f454dda Merge branch 'develop' of https://github.com/asinyagin/web3.js into develop 4384805 build files b09bf31 Merge branch 'develop' into allAsync 6ea0d67 Set requests content type to application/json fe703f5 Merge pull request #229 from ethereum/extendWeb3 a90a85a mereg develop a2e5fbd add tests for the outputformatters 556eb45 re-add map files 08d2212 small fix on outputFormatters, dont transform null to 0 1495a0c add comlexity push for poll, does only show on travis 7518ed4 changed extend to _extend 1aefebd merged develop b6c49d4 improved async polling 16252f3 imporved async callback adding, without setinterval f242489 add optional default block parameter to contract call fixes #159 1d3d727 improved comment d9ce08e improved filter interval ddafe00 asyncified filters d14c706 build and improved extend function 733e19e add extend method and tests git-subtree-dir: libjsqrc/ethereumjs git-subtree-split: ecde3345e0e6d4bca0ce03e08ee4957395cd6194
39 lines
952 B
JavaScript
39 lines
952 B
JavaScript
var chai = require('chai');
|
|
var assert = chai.assert;
|
|
|
|
var FakeXMLHttpRequest = function () {
|
|
this.responseText = "{}";
|
|
this.readyState = 4;
|
|
this.onreadystatechange = null;
|
|
this.async = false;
|
|
this.headers = {
|
|
'Content-Type': 'text/plain'
|
|
};
|
|
};
|
|
|
|
FakeXMLHttpRequest.prototype.open = function (method, host, async) {
|
|
assert.equal(method, 'POST');
|
|
assert.notEqual(host, null);
|
|
assert.equal(async === false || async === true, true);
|
|
this.async = async;
|
|
};
|
|
|
|
FakeXMLHttpRequest.prototype.setRequestHeader = function(name, value) {
|
|
this.headers[name] = value;
|
|
};
|
|
|
|
FakeXMLHttpRequest.prototype.send = function (payload) {
|
|
assert.equal(typeof payload, 'string');
|
|
if (this.async) {
|
|
assert.equal(typeof this.onreadystatechange, 'function');
|
|
this.onreadystatechange();
|
|
return;
|
|
}
|
|
return this.responseText;
|
|
};
|
|
|
|
module.exports = {
|
|
XMLHttpRequest: FakeXMLHttpRequest
|
|
};
|
|
|