From a30fde94cb324808dc55e13283359f71d65cbe57 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Wed, 6 Sep 2023 09:58:44 -0700 Subject: [PATCH 1/2] Adds method for contains_certificate --- ledger/src/contains.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ledger/src/contains.rs b/ledger/src/contains.rs index 41e53dd429..6d612aff8c 100644 --- a/ledger/src/contains.rs +++ b/ledger/src/contains.rs @@ -29,6 +29,11 @@ impl> Ledger { pub fn contains_block_hash(&self, block_hash: &N::BlockHash) -> Result { self.vm.block_store().contains_block_hash(block_hash) } + + /// Returns `true` if the given batch certificate ID exists. + pub fn contains_certificate(&self, certificate_id: &Field) -> Result { + self.vm.block_store().contains_certificate(certificate_id) + } /// Returns `true` if the given program ID exists. pub fn contains_program_id(&self, program_id: &ProgramID) -> Result { From c0f12a2bf7f6a5a2ac466d53a4ede262911e9cc1 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Wed, 6 Sep 2023 10:02:40 -0700 Subject: [PATCH 2/2] Rustfmt --- ledger/src/contains.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/src/contains.rs b/ledger/src/contains.rs index 6d612aff8c..0a0495bd57 100644 --- a/ledger/src/contains.rs +++ b/ledger/src/contains.rs @@ -29,7 +29,7 @@ impl> Ledger { pub fn contains_block_hash(&self, block_hash: &N::BlockHash) -> Result { self.vm.block_store().contains_block_hash(block_hash) } - + /// Returns `true` if the given batch certificate ID exists. pub fn contains_certificate(&self, certificate_id: &Field) -> Result { self.vm.block_store().contains_certificate(certificate_id)