iota_types/timelock/
stardust_upgrade_label.rs

1// Copyright (c) 2024 IOTA Stiftung
2// Modifications Copyright (c) 2024 IOTA Stiftung
3// SPDX-License-Identifier: Apache-2.0
4
5use crate::base_types::{Identifier, IotaAddress, StructTag};
6
7pub const STARDUST_UPGRADE_MODULE_NAME: Identifier =
8    Identifier::from_static("stardust_upgrade_label");
9pub const STARDUST_UPGRADE_STRUCT_NAME: Identifier =
10    Identifier::from_static("STARDUST_UPGRADE_LABEL");
11
12pub const STARDUST_UPGRADE_LABEL_VALUE: &str = "000000000000000000000000000000000000000000000000000000000000107a::stardust_upgrade_label::STARDUST_UPGRADE_LABEL";
13
14/// Get the stardust upgrade label `type`.
15pub fn stardust_upgrade_label_type() -> StructTag {
16    StructTag::new(
17        IotaAddress::STARDUST,
18        STARDUST_UPGRADE_MODULE_NAME,
19        STARDUST_UPGRADE_STRUCT_NAME,
20        vec![],
21    )
22}
23
24/// Is this other StructTag representing a stardust upgrade label?
25pub fn is_stardust_upgrade(other: &StructTag) -> bool {
26    other.address() == IotaAddress::STARDUST
27        && other.module() == &STARDUST_UPGRADE_MODULE_NAME
28        && other.name() == &STARDUST_UPGRADE_STRUCT_NAME
29}