amaru_kernel/cardano/transaction.rs
1// Copyright 2026 PRAGMA
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
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 crate::{AuxiliaryData, TransactionBody, WitnessSet, cbor};
16
17// TODO:
18//
19// This type is currently mostly unused; transactions in blocks have their constituents separated
20// (i.e. seggregated witnesses). This type would however come in handy as soon as start accepting
21// transactions from an external API.
22//
23// In which case, it'll become interesting to think about what public API we wanna expose. Exposing
24// all fields an internals doesn't sound like a good idea and will likely break people's code
25// (including ours) over time.
26#[derive(Debug, Clone, PartialEq, Eq, cbor::Encode, cbor::Decode, serde::Serialize, serde::Deserialize)]
27pub struct Transaction {
28 #[n(0)]
29 pub body: TransactionBody,
30 #[n(1)]
31 pub witnesses: WitnessSet,
32 #[n(2)]
33 pub is_expected_valid: bool,
34 #[n(3)]
35 pub auxiliary_data: Option<AuxiliaryData>,
36}