def on_query_reputation(self, msg): pubkey = msg['pubkey'].decode('hex') if pubkey in self._reviews: self._transport.send(reputation(pubkey, self._reviews[pubkey]))
def create_review(self, pubkey, text, rating): signature = self._priv.sign(self._build_review(pubkey, text, rating)) new_review = review(self._priv.get_pubkey(), pubkey, signature, text, rating) self._reviews[pubkey].append(new_review) # announce the new reputation self._transport.send(reputation(pubkey, [new_review]))