oasis_core_runtime/transaction/
context.rs1use std::sync::Arc;
3
4use crate::{
5    consensus::{
6        beacon::EpochTime,
7        roothash::{Header, RoundResults},
8        state::ConsensusState,
9        LightBlock,
10    },
11    protocol::Protocol,
12    storage::MKVS,
13};
14
15pub struct Context<'a> {
17    pub protocol: Arc<Protocol>,
19    pub consensus_block: &'a LightBlock,
21    pub consensus_state: ConsensusState,
23    pub runtime_state: &'a mut dyn MKVS,
25    pub header: &'a Header,
27    pub epoch: EpochTime,
29    pub round_results: &'a RoundResults,
31    pub max_messages: u32,
33    pub check_only: bool,
36}
37
38impl<'a> Context<'a> {
39    #[allow(clippy::too_many_arguments)]
41    pub fn new(
42        protocol: Arc<Protocol>,
43        consensus_block: &'a LightBlock,
44        consensus_state: ConsensusState,
45        runtime_state: &'a mut dyn MKVS,
46        header: &'a Header,
47        epoch: EpochTime,
48        round_results: &'a RoundResults,
49        max_messages: u32,
50        check_only: bool,
51    ) -> Self {
52        Self {
53            protocol,
54            consensus_block,
55            consensus_state,
56            runtime_state,
57            header,
58            epoch,
59            round_results,
60            max_messages,
61            check_only,
62        }
63    }
64}