mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-22 11:08:33 +00:00
readd topic convertion, add fix
This commit is contained in:
parent
2c7db81ebc
commit
0563dba4ee
15
dist/web3-light.js
vendored
15
dist/web3-light.js
vendored
@ -2010,7 +2010,7 @@ var toAscii = function(hex) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Should be called to get hex representation (prefixed by 0x) of utf8 string
|
||||
* Should be called to get hex representation (prefixed by 0x) of utf8 a string
|
||||
*
|
||||
* @method fromUtf8
|
||||
* @param {String} string
|
||||
@ -3760,9 +3760,10 @@ var inputPostFormatter = function(post) {
|
||||
}
|
||||
|
||||
// format the following options
|
||||
// post.topics = post.topics.map(function(topic){
|
||||
// return utils.fromUtf8(topic);
|
||||
// });
|
||||
post.topics = post.topics.map(function(topic){
|
||||
// convert only if not hex
|
||||
return (topic.indexOf('0x') === 0) ? topic : utils.fromUtf8(topic);
|
||||
});
|
||||
|
||||
return post;
|
||||
};
|
||||
@ -3791,9 +3792,9 @@ var outputPostFormatter = function(post){
|
||||
if (!post.topics) {
|
||||
post.topics = [];
|
||||
}
|
||||
// post.topics = post.topics.map(function(topic){
|
||||
// return utils.toAscii(topic);
|
||||
// });
|
||||
post.topics = post.topics.map(function(topic){
|
||||
return utils.toAscii(topic);
|
||||
});
|
||||
|
||||
return post;
|
||||
};
|
||||
|
6
dist/web3-light.min.js
vendored
6
dist/web3-light.min.js
vendored
File diff suppressed because one or more lines are too long
15
dist/web3.js
vendored
15
dist/web3.js
vendored
@ -2010,7 +2010,7 @@ var toAscii = function(hex) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Should be called to get hex representation (prefixed by 0x) of utf8 string
|
||||
* Should be called to get hex representation (prefixed by 0x) of utf8 a string
|
||||
*
|
||||
* @method fromUtf8
|
||||
* @param {String} string
|
||||
@ -3760,9 +3760,10 @@ var inputPostFormatter = function(post) {
|
||||
}
|
||||
|
||||
// format the following options
|
||||
// post.topics = post.topics.map(function(topic){
|
||||
// return utils.fromUtf8(topic);
|
||||
// });
|
||||
post.topics = post.topics.map(function(topic){
|
||||
// convert only if not hex
|
||||
return (topic.indexOf('0x') === 0) ? topic : utils.fromUtf8(topic);
|
||||
});
|
||||
|
||||
return post;
|
||||
};
|
||||
@ -3791,9 +3792,9 @@ var outputPostFormatter = function(post){
|
||||
if (!post.topics) {
|
||||
post.topics = [];
|
||||
}
|
||||
// post.topics = post.topics.map(function(topic){
|
||||
// return utils.toAscii(topic);
|
||||
// });
|
||||
post.topics = post.topics.map(function(topic){
|
||||
return utils.toAscii(topic);
|
||||
});
|
||||
|
||||
return post;
|
||||
};
|
||||
|
6
dist/web3.js.map
vendored
6
dist/web3.js.map
vendored
File diff suppressed because one or more lines are too long
10
dist/web3.min.js
vendored
10
dist/web3.min.js
vendored
File diff suppressed because one or more lines are too long
@ -137,7 +137,7 @@ var toAscii = function(hex) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Should be called to get hex representation (prefixed by 0x) of utf8 string
|
||||
* Should be called to get hex representation (prefixed by 0x) of utf8 a string
|
||||
*
|
||||
* @method fromUtf8
|
||||
* @param {String} string
|
||||
|
@ -220,9 +220,10 @@ var inputPostFormatter = function(post) {
|
||||
}
|
||||
|
||||
// format the following options
|
||||
// post.topics = post.topics.map(function(topic){
|
||||
// return utils.fromUtf8(topic);
|
||||
// });
|
||||
post.topics = post.topics.map(function(topic){
|
||||
// convert only if not hex
|
||||
return (topic.indexOf('0x') === 0) ? topic : utils.fromUtf8(topic);
|
||||
});
|
||||
|
||||
return post;
|
||||
};
|
||||
@ -251,9 +252,9 @@ var outputPostFormatter = function(post){
|
||||
if (!post.topics) {
|
||||
post.topics = [];
|
||||
}
|
||||
// post.topics = post.topics.map(function(topic){
|
||||
// return utils.toAscii(topic);
|
||||
// });
|
||||
post.topics = post.topics.map(function(topic){
|
||||
return utils.toAscii(topic);
|
||||
});
|
||||
|
||||
return post;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user