1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
// Copyright 2019-2022 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
use num_derive::FromPrimitive;
/// Identifies the builtin actor types for usage with the
/// `actor::resolve_builtin_actor_type` syscall.
/// Note that there is a mirror of this enumerable in the FVM SDK `src/actors/builtins.rs`.
/// These must be kept in sync for the syscall to work correctly, without either side
/// importing the other.
#[derive(PartialEq, Eq, Clone, Copy, PartialOrd, Ord, FromPrimitive, Debug)]
#[repr(i32)]
pub enum Type {
System = 1,
Init = 2,
Cron = 3,
Account = 4,
Power = 5,
Miner = 6,
Market = 7,
PaymentChannel = 8,
Multisig = 9,
Reward = 10,
VerifiedRegistry = 11,
DataCap = 12,
}
impl Type {
pub fn name(&self) -> &'static str {
match *self {
Type::System => "system",
Type::Init => "init",
Type::Cron => "cron",
Type::Account => "account",
Type::Power => "storagepower",
Type::Miner => "storageminer",
Type::Market => "storagemarket",
Type::PaymentChannel => "paymentchannel",
Type::Multisig => "multisig",
Type::Reward => "reward",
Type::VerifiedRegistry => "verifiedregistry",
Type::DataCap => "datacap",
}
}
}