mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-23 03:28:07 +00:00
add possible 2d topic arrays fixes #175
This commit is contained in:
parent
a5c1bcc6e4
commit
c8f42262cc
7
dist/web3-light.js
vendored
7
dist/web3-light.js
vendored
@ -1134,6 +1134,9 @@ var fromDecimal = function (value) {
|
||||
var toHex = function (val) {
|
||||
/*jshint maxcomplexity:7 */
|
||||
|
||||
if(val === null || typeof val === 'undefined')
|
||||
return val;
|
||||
|
||||
if (isBoolean(val))
|
||||
return fromDecimal(+val);
|
||||
|
||||
@ -2320,7 +2323,9 @@ var getOptions = function (options) {
|
||||
// make sure topics, get converted to hex
|
||||
options.topics = options.topics || [];
|
||||
options.topics = options.topics.map(function(topic){
|
||||
return utils.toHex(topic);
|
||||
return (utils.isArray(topic))
|
||||
? topic.map(utils.toHex)
|
||||
: utils.toHex(topic);
|
||||
});
|
||||
|
||||
// lazy load
|
||||
|
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
2
dist/web3-light.min.js
vendored
2
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
@ -1134,6 +1134,9 @@ var fromDecimal = function (value) {
|
||||
var toHex = function (val) {
|
||||
/*jshint maxcomplexity:7 */
|
||||
|
||||
if(val === null || typeof val === 'undefined')
|
||||
return val;
|
||||
|
||||
if (isBoolean(val))
|
||||
return fromDecimal(+val);
|
||||
|
||||
@ -2320,7 +2323,9 @@ var getOptions = function (options) {
|
||||
// make sure topics, get converted to hex
|
||||
options.topics = options.topics || [];
|
||||
options.topics = options.topics.map(function(topic){
|
||||
return utils.toHex(topic);
|
||||
return (utils.isArray(topic))
|
||||
? topic.map(utils.toHex)
|
||||
: utils.toHex(topic);
|
||||
});
|
||||
|
||||
// lazy load
|
||||
|
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
@ -198,6 +198,9 @@ var fromDecimal = function (value) {
|
||||
var toHex = function (val) {
|
||||
/*jshint maxcomplexity:7 */
|
||||
|
||||
if(val === null || typeof val === 'undefined')
|
||||
return val;
|
||||
|
||||
if (isBoolean(val))
|
||||
return fromDecimal(+val);
|
||||
|
||||
|
@ -42,7 +42,9 @@ var getOptions = function (options) {
|
||||
// make sure topics, get converted to hex
|
||||
options.topics = options.topics || [];
|
||||
options.topics = options.topics.map(function(topic){
|
||||
return utils.toHex(topic);
|
||||
return (utils.isArray(topic))
|
||||
? topic.map(utils.toHex)
|
||||
: utils.toHex(topic);
|
||||
});
|
||||
|
||||
// lazy load
|
||||
|
@ -4,6 +4,7 @@ var BigNumber = require('bignumber.js');
|
||||
var assert = chai.assert;
|
||||
|
||||
var tests = [
|
||||
{ value: null, expected: null },
|
||||
{ value: 1, expected: '0x1' },
|
||||
{ value: '1', expected: '0x1' },
|
||||
{ value: '0x1', expected: '0x1'},
|
||||
|
Loading…
x
Reference in New Issue
Block a user