mirror of https://github.com/waku-org/js-waku.git
Update nim-waku, `0x` now optional in RPC requests
This commit is contained in:
parent
46869e998d
commit
c4d3c7fb47
2
nim-waku
2
nim-waku
|
@ -1 +1 @@
|
|||
Subproject commit 4ae1cd4737dacdd30f879eea199e0a89a9c1532e
|
||||
Subproject commit d1c1a0ca13e3aa2690a6550faca13210e1f46877
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue