-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
084f722
commit 6aaadb6
Showing
34 changed files
with
455 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
packages/rs-dpp/src/errors/consensus/state/token/identity_token_account_not_frozen_error.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
use crate::consensus::state::state_error::StateError; | ||
use crate::consensus::ConsensusError; | ||
use crate::ProtocolError; | ||
use bincode::{Decode, Encode}; | ||
use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize}; | ||
use platform_value::Identifier; | ||
use thiserror::Error; | ||
|
||
#[derive( | ||
Error, Debug, Clone, PartialEq, Eq, Encode, Decode, PlatformSerialize, PlatformDeserialize, | ||
)] | ||
#[error( | ||
"Identity {} account is not frozen for token {}. Action attempted: {}", | ||
identity_id, | ||
token_id, | ||
action | ||
)] | ||
#[platform_serialize(unversioned)] | ||
pub struct IdentityTokenAccountNotFrozenError { | ||
token_id: Identifier, | ||
identity_id: Identifier, | ||
action: String, | ||
} | ||
|
||
impl IdentityTokenAccountNotFrozenError { | ||
pub fn new(token_id: Identifier, identity_id: Identifier, action: String) -> Self { | ||
Self { | ||
token_id, | ||
identity_id, | ||
action, | ||
} | ||
} | ||
|
||
pub fn token_id(&self) -> &Identifier { | ||
&self.token_id | ||
} | ||
|
||
pub fn identity_id(&self) -> &Identifier { | ||
&self.identity_id | ||
} | ||
|
||
pub fn action(&self) -> &str { | ||
&self.action | ||
} | ||
} | ||
|
||
impl From<IdentityTokenAccountNotFrozenError> for ConsensusError { | ||
fn from(err: IdentityTokenAccountNotFrozenError) -> Self { | ||
Self::StateError(StateError::IdentityTokenAccountNotFrozenError(err)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
mod identity_does_not_have_enough_token_balance_error; | ||
mod identity_token_account_frozen_error; | ||
mod identity_token_account_not_frozen_error; | ||
mod unauthorized_token_action_error; | ||
|
||
pub use identity_does_not_have_enough_token_balance_error::*; | ||
pub use identity_token_account_frozen_error::*; | ||
pub use identity_token_account_not_frozen_error::*; | ||
pub use unauthorized_token_action_error::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
..._transition/state_transitions/batch/action_validation/token_base_transition_action/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
..._transition/state_transitions/batch/action_validation/token_burn_transition_action/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...tate_transitions/batch/action_validation/token_burn_transition_action/structure_v0/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.