Enhanced MethodDecoding in Transactions list (#3454)

* Better MethodDecoding UI // No empty params #3452

* Display input if ASCII in transactions #3434

* Fixes UI for #3454

* Better MethodDecoding contract detection #3454
This commit is contained in:
Nicolas Gotchac
2016-11-16 18:03:59 +01:00
committed by Jaco Greeff
parent a7574a1108
commit 18f570327e
7 changed files with 206 additions and 58 deletions

View File

@@ -17,3 +17,15 @@
export function bytesToHex (bytes) {
return '0x' + bytes.map((b) => ('0' + b.toString(16)).slice(-2)).join('');
}
export function hex2Ascii (_hex) {
const hex = /^(?:0x)?(.*)$/.exec(_hex.toString())[1];
let str = '';
for (let i = 0; i < hex.length; i += 2) {
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
}
return str;
}