From a9bec01b90d66ac5787d19f69a7bf2849e2a911b Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Mon, 11 May 2020 07:50:29 -0500 Subject: [PATCH] 7 failures --- lib/pigeon.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/pigeon.rb b/lib/pigeon.rb index f38347f..2a052a2 100644 --- a/lib/pigeon.rb +++ b/lib/pigeon.rb @@ -208,10 +208,13 @@ module Pigeon count = db.get_message_count_for(author.multihash) expected_prev = db.get_message_by_depth(author.multihash, count - 1) || Pigeon::NOTHING assert("depth", count, msg.depth) - # TODO: Re-visit this. Our current verification method - # is probably too strict and won't allow for partial - # verification of feeds. - assert("lipmaa", msg.lipmaa, Helpers.lipmaa(msg.depth) || NOTHING) + expected_lpma = Helpers.lipmaa(msg.depth) + if expected_lpma + real = db.get_message_by_depth(author.multihash, expected_lpma) + assert("lipmaa", msg.lipmaa, real) + else + assert("lipmaa", msg.lipmaa, NOTHING) + end assert("prev", msg.prev, expected_prev) tpl = msg.template.render_without_signature Helpers.verify_string(author, signature, tpl)