templar_common/
registry.rs1use near_sdk::{
2 json_types::{Base58CryptoHash, U64},
3 near,
4};
5
6#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
7#[cfg_attr(feature = "rpc", derive(clap::ValueEnum))]
8#[near(serializers = [json, borsh])]
9pub enum DeployMode {
10 Normal,
11 GlobalHash,
12}
13
14impl std::fmt::Display for DeployMode {
15 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16 match self {
17 DeployMode::Normal => write!(f, "Normal"),
18 DeployMode::GlobalHash => write!(f, "GlobalHash"),
19 }
20 }
21}
22
23#[derive(Clone, Debug)]
24#[near(serializers = [borsh, json])]
25pub struct Deployment {
26 pub version_key: String,
27 pub code_hash: Base58CryptoHash,
28 pub block_height: U64,
29}