Skip to main content

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 iota_sdk_types::{Identifier, StructTag};
6
7use crate::base_types::IotaAddress;
8
9pub const STARDUST_UPGRADE_MODULE_NAME: Identifier =
10    Identifier::from_static("stardust_upgrade_label");
11pub const STARDUST_UPGRADE_STRUCT_NAME: Identifier =
12    Identifier::from_static("STARDUST_UPGRADE_LABEL");
13
14pub const STARDUST_UPGRADE_LABEL_VALUE: &str = "000000000000000000000000000000000000000000000000000000000000107a::stardust_upgrade_label::STARDUST_UPGRADE_LABEL";
15
16/// Get the stardust upgrade label `type`.
17pub fn stardust_upgrade_label_type() -> StructTag {
18    StructTag::new(
19        IotaAddress::STARDUST,
20        STARDUST_UPGRADE_MODULE_NAME,
21        STARDUST_UPGRADE_STRUCT_NAME,
22        vec![],
23    )
24}
25
26/// Is this other StructTag representing a stardust upgrade label?
27pub fn is_stardust_upgrade(other: &StructTag) -> bool {
28    other.address() == IotaAddress::STARDUST
29        && other.module() == &STARDUST_UPGRADE_MODULE_NAME
30        && other.name() == &STARDUST_UPGRADE_STRUCT_NAME
31}