casper_storage/data_access_layer/
contract.rs1use crate::tracking_copy::TrackingCopyError;
2use casper_types::{Contract, Digest, Key};
3
4pub struct ContractRequest {
6 state_hash: Digest,
7 key: Key,
8}
9
10impl ContractRequest {
11 pub fn new(state_hash: Digest, key: Key) -> Self {
13 ContractRequest { state_hash, key }
14 }
15
16 pub fn key(&self) -> Key {
18 self.key
19 }
20 pub fn state_hash(&self) -> Digest {
22 self.state_hash
23 }
24}
25
26#[derive(Debug)]
28pub enum ContractResult {
29 RootNotFound,
31 ValueNotFound(String),
33 Success {
35 contract: Contract,
37 },
38 Failure(TrackingCopyError),
40}