16: Update nim-waku, `0x` now optional in RPC requests r=D4nte a=D4nte

Confirms resolution of https://github.com/status-im/nim-waku/issues/415

Co-authored-by: Franck Royer <franck@royer.one>
This commit is contained in:
bors[bot] 2021-03-29 03:26:25 +00:00 committed by GitHub
commit fdff7c43b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {