snarkvm_ledger/
contains.rs1use super::*;
17
18impl<N: Network, C: ConsensusStorage<N>> Ledger<N, C> {
19 pub fn contains_state_root(&self, state_root: &N::StateRoot) -> Result<bool> {
21 self.vm.block_store().contains_state_root(state_root)
22 }
23
24 pub fn contains_block_height(&self, height: u32) -> Result<bool> {
26 self.vm.block_store().contains_block_height(height)
27 }
28
29 pub fn contains_block_hash(&self, block_hash: &N::BlockHash) -> Result<bool> {
31 self.vm.block_store().contains_block_hash(block_hash)
32 }
33
34 pub fn contains_certificate(&self, certificate_id: &Field<N>) -> Result<bool> {
36 self.vm.block_store().contains_certificate(certificate_id)
37 }
38
39 pub fn contains_program_id(&self, program_id: &ProgramID<N>) -> Result<bool> {
41 self.vm.transaction_store().contains_program_id(program_id)
42 }
43
44 pub fn contains_transmission(&self, transmission_id: &TransmissionID<N>) -> Result<bool> {
46 match transmission_id {
47 TransmissionID::Ratification => Ok(false),
48 TransmissionID::Solution(solution_id, _) => self.contains_solution_id(solution_id),
49 TransmissionID::Transaction(transaction_id, _) => self.contains_transaction_id(transaction_id),
50 }
51 }
52
53 pub fn contains_solution_id(&self, solution_id: &SolutionID<N>) -> Result<bool> {
55 self.vm.block_store().contains_solution_id(solution_id)
56 }
57
58 pub fn contains_transaction_id(&self, transaction_id: &N::TransactionID) -> Result<bool> {
62 self.vm.block_store().contains_transaction_id(transaction_id)
63 }
64
65 pub fn contains_transition_id(&self, transition_id: &N::TransitionID) -> Result<bool> {
69 self.vm.transition_store().contains_transition_id(transition_id)
70 }
71
72 pub fn contains_input_id(&self, input_id: &Field<N>) -> Result<bool> {
76 self.vm.transition_store().contains_input_id(input_id)
77 }
78
79 pub fn contains_serial_number(&self, serial_number: &Field<N>) -> Result<bool> {
81 self.vm.transition_store().contains_serial_number(serial_number)
82 }
83
84 pub fn contains_tag(&self, tag: &Field<N>) -> Result<bool> {
86 self.vm.transition_store().contains_tag(tag)
87 }
88
89 pub fn contains_output_id(&self, output_id: &Field<N>) -> Result<bool> {
93 self.vm.transition_store().contains_output_id(output_id)
94 }
95
96 pub fn contains_commitment(&self, commitment: &Field<N>) -> Result<bool> {
98 self.vm.transition_store().contains_commitment(commitment)
99 }
100
101 pub fn contains_checksum(&self, checksum: &Field<N>) -> bool {
103 self.vm.transition_store().contains_checksum(checksum)
104 }
105
106 pub fn contains_nonce(&self, nonce: &Group<N>) -> Result<bool> {
108 self.vm.transition_store().contains_nonce(nonce)
109 }
110
111 pub fn contains_tpk(&self, tpk: &Group<N>) -> Result<bool> {
115 self.vm.transition_store().contains_tpk(tpk)
116 }
117
118 pub fn contains_tcm(&self, tcm: &Field<N>) -> Result<bool> {
120 self.vm.transition_store().contains_tcm(tcm)
121 }
122}