Payload is now always a buffer

This commit is contained in:
Franck Royer 2021-03-15 16:26:07 +11:00
parent d9a7166098
commit fe7daebbb0
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 1 additions and 8 deletions

View File

@ -108,15 +108,8 @@ export class NimWaku {
async sendMessage(message: Message) {
this.checkProcess();
let payload;
if (typeof message.payload === 'string') {
payload = strToHex(message.payload);
} else {
payload = bufToHex(message.payload);
}
const rpcMessage = {
payload,
payload: bufToHex(message.payload),
contentTopic: message.contentTopic,
};