snarkvm_ledger_debug/
check_transaction_basic.rs

1// Copyright (C) 2019-2023 Aleo Systems Inc.
2// This file is part of the snarkVM library.
3
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at:
7// http://www.apache.org/licenses/LICENSE-2.0
8
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use super::*;
16
17impl<N: Network, C: ConsensusStorage<N>> Ledger<N, C> {
18    /// Checks the given transaction is well-formed and unique.
19    pub fn check_transaction_basic<R: CryptoRng + Rng>(
20        &self,
21        transaction: &Transaction<N>,
22        rejected_id: Option<Field<N>>,
23        rng: &mut R,
24    ) -> Result<()> {
25        self.vm().check_transaction(transaction, rejected_id, rng)
26    }
27}