mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-23 19:48:13 +00:00
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:
commit
4482d5bf00
7
dist/web3-light.js
vendored
7
dist/web3-light.js
vendored
@ -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-light.js.map
vendored
6
dist/web3-light.js.map
vendored
File diff suppressed because one or more lines are too long
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
7
dist/web3.js
vendored
7
dist/web3.js
vendored
@ -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
6
dist/web3.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/web3.min.js
vendored
4
dist/web3.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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);
|
||||||
|
|
||||||
|
@ -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);
|
||||||
});
|
});
|
||||||
|
@ -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'},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user