Merge branch 'develop' into events_refactor

Conflicts:
	dist/web3-light.js
	dist/web3-light.js.map
	dist/web3-light.min.js
	dist/web3.js
	dist/web3.js.map
	dist/web3.min.js
	lib/web3/filter.js
This commit is contained in:
Marek Kotewicz 2015-04-22 09:28:56 +02:00
commit 4482d5bf00
9 changed files with 29 additions and 13 deletions

7
dist/web3-light.js vendored
View File

@ -1110,6 +1110,9 @@ var fromDecimal = function (value) {
var toHex = function (val) { var toHex = function (val) {
/*jshint maxcomplexity:7 */ /*jshint maxcomplexity:7 */
if(val === null || typeof val === 'undefined')
return val;
if (isBoolean(val)) if (isBoolean(val))
return fromDecimal(+val); return fromDecimal(+val);
@ -2241,9 +2244,11 @@ var getOptions = function (options) {
// make sure topics, get converted to hex // make sure topics, get converted to hex
options.topics = options.topics || []; options.topics = options.topics || [];
options.topics = options.topics.map(function(topic){ options.topics = options.topics.map(function(topic) {
if (topic === null) { if (topic === null) {
return null; return null;
} else if (utils.isArray) {
topic = topic.map(utils.toHex);
} }
return utils.toHex(topic); return utils.toHex(topic);
}); });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

7
dist/web3.js vendored
View File

@ -1110,6 +1110,9 @@ var fromDecimal = function (value) {
var toHex = function (val) { var toHex = function (val) {
/*jshint maxcomplexity:7 */ /*jshint maxcomplexity:7 */
if(val === null || typeof val === 'undefined')
return val;
if (isBoolean(val)) if (isBoolean(val))
return fromDecimal(+val); return fromDecimal(+val);
@ -2241,9 +2244,11 @@ var getOptions = function (options) {
// make sure topics, get converted to hex // make sure topics, get converted to hex
options.topics = options.topics || []; options.topics = options.topics || [];
options.topics = options.topics.map(function(topic){ options.topics = options.topics.map(function(topic) {
if (topic === null) { if (topic === null) {
return null; return null;
} else if (utils.isArray) {
topic = topic.map(utils.toHex);
} }
return utils.toHex(topic); return utils.toHex(topic);
}); });

6
dist/web3.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/web3.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -214,6 +214,9 @@ var fromDecimal = function (value) {
var toHex = function (val) { var toHex = function (val) {
/*jshint maxcomplexity:7 */ /*jshint maxcomplexity:7 */
if(val === null || typeof val === 'undefined')
return val;
if (isBoolean(val)) if (isBoolean(val))
return fromDecimal(+val); return fromDecimal(+val);

View File

@ -41,9 +41,11 @@ var getOptions = function (options) {
// make sure topics, get converted to hex // make sure topics, get converted to hex
options.topics = options.topics || []; options.topics = options.topics || [];
options.topics = options.topics.map(function(topic){ options.topics = options.topics.map(function(topic) {
if (topic === null) { if (topic === null) {
return null; return null;
} else if (utils.isArray(topic)) {
topic = topic.map(utils.toHex);
} }
return utils.toHex(topic); return utils.toHex(topic);
}); });

View File

@ -4,6 +4,7 @@ var BigNumber = require('bignumber.js');
var assert = chai.assert; var assert = chai.assert;
var tests = [ var tests = [
{ value: null, expected: null },
{ value: 1, expected: '0x1' }, { value: 1, expected: '0x1' },
{ value: '1', expected: '0x1' }, { value: '1', expected: '0x1' },
{ value: '0x1', expected: '0x1'}, { value: '0x1', expected: '0x1'},