casper_storage/data_access_layer/
message_topics.rs

1use casper_types::{addressable_entity::MessageTopics, Digest, EntityAddr};
2
3use crate::tracking_copy::TrackingCopyError;
4
5/// Request for a message topics.
6pub struct MessageTopicsRequest {
7    state_hash: Digest,
8    entity_addr: EntityAddr,
9}
10
11impl MessageTopicsRequest {
12    /// Creates new request object.
13    pub fn new(state_hash: Digest, entity_addr: EntityAddr) -> Self {
14        Self {
15            state_hash,
16            entity_addr,
17        }
18    }
19
20    /// Returns state root hash.
21    pub fn state_hash(&self) -> Digest {
22        self.state_hash
23    }
24
25    /// Returns the hash addr.
26    pub fn entity_addr(&self) -> EntityAddr {
27        self.entity_addr
28    }
29}
30
31/// Result of a global state query request.
32#[derive(Debug)]
33pub enum MessageTopicsResult {
34    /// Invalid state root hash.
35    RootNotFound,
36    /// Successful query.
37    Success {
38        /// Stored value under a path.
39        message_topics: MessageTopics,
40    },
41    /// Tracking Copy Error
42    Failure(TrackingCopyError),
43}