pub enum ContractError {
Show 35 variants
Unauthorized,
SessionNotFound,
ParticipantNotFound,
InvalidState,
TimeNotReached,
AlreadyVoted,
InvalidCommitment,
InsufficientParticipants,
TooManyParticipants,
ContractPaused,
InvalidAddress,
DuplicateParticipant,
CannotRemoveVotedParticipant,
MaximumParticipantsReached,
RewardNftNotConfigured,
OnlyAdminCanExecute,
OnlyCreatorCanCancel,
CannotCancelCompletedLottery,
CannotCreateRewardAfterCompletion,
NotAllParticipantsRevealed,
InvalidCommitmentVerification,
MustSubmitCommitmentFirst,
CommitmentAlreadySubmitted,
RevealAlreadySubmitted,
SessionNotActive,
TransfersLocked,
OnlyAdminCanSetLock,
OnlyAdminCanSetSessionActive,
OnlyAdminCanAddParticipants,
OnlyAdminCanRemoveParticipants,
OnlyAdminCanUpdateConfig,
OnlyAdminCanPauseContract,
OnlyAdminCanResumeContract,
OnlyAdminCanCreateRewardNft,
Generic(String),
}Expand description
合约错误类型
Variants§
未授权
SessionNotFound
会话未找到
ParticipantNotFound
参与者未找到
InvalidState
无效状态
TimeNotReached
时间未到
AlreadyVoted
已投票
InvalidCommitment
无效承诺
InsufficientParticipants
参与者不足
TooManyParticipants
参与者过多
ContractPaused
合约已暂停
InvalidAddress
无效地址
DuplicateParticipant
重复参与者
CannotRemoveVotedParticipant
无法移除已投票参与者
MaximumParticipantsReached
达到最大参与者数量
RewardNftNotConfigured
奖品NFT未配置
OnlyAdminCanExecute
仅管理员可执行
OnlyCreatorCanCancel
仅创建者可取消
CannotCancelCompletedLottery
无法取消已完成的抽奖
CannotCreateRewardAfterCompletion
完成后无法创建奖品
NotAllParticipantsRevealed
并非所有参与者都已揭示
InvalidCommitmentVerification
无效承诺验证
MustSubmitCommitmentFirst
必须先提交承诺
CommitmentAlreadySubmitted
承诺已提交
RevealAlreadySubmitted
揭示已提交
SessionNotActive
会话未激活
TransfersLocked
转移已锁定
OnlyAdminCanSetLock
仅管理员可设置锁定
OnlyAdminCanSetSessionActive
仅管理员可设置会话激活
OnlyAdminCanAddParticipants
仅管理员可添加参与者
OnlyAdminCanRemoveParticipants
仅管理员可移除参与者
OnlyAdminCanUpdateConfig
仅管理员可更新配置
OnlyAdminCanPauseContract
仅管理员可暂停合约
OnlyAdminCanResumeContract
仅管理员可恢复合约
OnlyAdminCanCreateRewardNft
仅管理员可创建奖品NFT
Generic(String)
通用错误
Trait Implementations§
Source§impl Clone for ContractError
impl Clone for ContractError
Source§fn clone(&self) -> ContractError
fn clone(&self) -> ContractError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContractError
impl Debug for ContractError
Source§impl<'de> Deserialize<'de> for ContractError
impl<'de> Deserialize<'de> for ContractError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ContractError> for StdError
impl From<ContractError> for StdError
Source§fn from(err: ContractError) -> Self
fn from(err: ContractError) -> Self
将合约错误转换为标准错误
Source§impl JsonSchema for ContractError
impl JsonSchema for ContractError
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ContractError
impl PartialEq for ContractError
Source§impl Serialize for ContractError
impl Serialize for ContractError
impl StructuralPartialEq for ContractError
Auto Trait Implementations§
impl Freeze for ContractError
impl RefUnwindSafe for ContractError
impl Send for ContractError
impl Sync for ContractError
impl Unpin for ContractError
impl UnwindSafe for ContractError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more