Update nim-waku, `0x` now optional in RPC requests

This commit is contained in:
Franck Royer 2021-03-29 14:25:03 +11:00
parent 46869e998d
commit c4d3c7fb47
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
3 changed files with 7 additions and 10 deletions

@ -1 +1 @@
Subproject commit 4ae1cd4737dacdd30f879eea199e0a89a9c1532e
Subproject commit d1c1a0ca13e3aa2690a6550faca13210e1f46877

View File

@ -22,7 +22,7 @@ it('Correctly serialized arguments', function () {
it('Convert utf-8 string to hex', function () {
const str = 'This is an utf-8 string.';
const expected = '0x5468697320697320616e207574662d3820737472696e672e';
const expected = '5468697320697320616e207574662d3820737472696e672e';
const actual = strToHex(str);
expect(actual).deep.equal(expected);
@ -55,7 +55,7 @@ it('Convert buffer to hex', function () {
0x67,
0x2e,
]);
const expected = '0x5468697320697320616e207574662d3820737472696e672e';
const expected = '5468697320697320616e207574662d3820737472696e672e';
const actual = bufToHex(buf);
expect(actual).to.deep.equal(expected);

View File

@ -243,16 +243,13 @@ export function strToHex(str: string): string {
hex = str;
console.log('invalid text input: ' + str);
}
return '0x' + hex;
return hex;
}
export function bufToHex(buffer: Uint8Array) {
return (
'0x' +
Array.prototype.map
.call(buffer, (x) => ('00' + x.toString(16)).slice(-2))
.join('')
);
return Array.prototype.map
.call(buffer, (x) => ('00' + x.toString(16)).slice(-2))
.join('');
}
interface RpcInfoResponse {