Skip to content

Commit

Permalink
Merge pull request #1963 from AleoHQ/feat/contains-cert
Browse files Browse the repository at this point in the history
Adds method for `contains_certificate`
  • Loading branch information
howardwu authored Sep 6, 2023
2 parents f8ebf4e + c0f12a2 commit f2f16e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ledger/src/contains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ impl<N: Network, C: ConsensusStorage<N>> Ledger<N, C> {
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<N>) -> Result<bool> {
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<N>) -> Result<bool> {
self.vm.transaction_store().contains_program_id(program_id)
Expand Down

1 comment on commit f2f16e1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'snarkVM Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: f2f16e1 Previous: f8ebf4e Ratio
bls12_377: fq12_add_assign 300 ns/iter (± 0) 185 ns/iter (± 0) 1.62

This comment was automatically generated by workflow using github-action-benchmark.

CC: @raychu86

Please sign in to comment.