chore: address review

This commit is contained in:
Vasco Santos
2020-12-02 17:45:18 +01:00
parent 0801fc3c0b
commit 5cb2025c2a
6 changed files with 34 additions and 43 deletions

View File

@ -65,7 +65,10 @@ async function verifySignature (message) {
*/
async function messagePublicKey (message) {
// should be available in the from property of the message (peer id)
// @ts-ignore - from type changed
if (!message.from) {
throw new Error('Could not get the public key from the originator id')
}
const from = PeerId.createFromCID(message.from)
if (message.key) {