-
Notifications
You must be signed in to change notification settings - Fork 341
Separate sign and verify from swarm.js #129
Conversation
Hows it work? Two new functions were added to swarm.verify(fn)
swarm.sign(fn)
|
Hmm, can someone check if the @ngoldman merge bot crashed and reboot it? 😎 |
emitter.verify = function (fn) { | ||
verify = fn | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Flet what these be for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are to pass in functions to sign
and verify
messages.
swarm.js
is running these because the signed/verified data is actualy the protobuf
-encoded message itself, which is not readily accessible outside the module.
More info in my comment: #129 (comment)
I do agree that the variable name emitter
is a little confusing. If it were named swarm
it would be a bit more intuitive I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also thank you for taking the time to review! ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes I see from #129 (comment). Might be good just to add a comment or two for now so it's clearer for future contributors since at face value they are identical and their purpose is not entirely obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed! The ultimate goal is to move swarm
into a nice, well docmented module :). I'll add some code comments so this information is not lost with time.
Comments for the comment god! |
MERGES FOR THE MERGE KING |
Separate sign and verify from swarm.js
This PR moves the sign and verify logic out of
swarm.js
and intolib/signature.js
.There are a couple reasons for this:
swarm.js
into its own module so its reusable by peerbot/friends-irc/other bots. Abstracting signature will help to keep this future module focused. Also bots probably don't need to sign/verify.Please yell at me if this is outrageous. 😁