Skip to content

Commit

Permalink
put necessary derives for the contract errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgunozerk committed Feb 5, 2025
1 parent 1db9700 commit 7342590
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions contracts/token/fungible/src/fungible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ pub trait FungibleToken {
// ################## ERRORS ##################

#[contracterror]
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
#[repr(u32)]
pub enum FungibleTokenError {
/// Indicates an error related to the current balance of account from which
Expand Down
1 change: 1 addition & 0 deletions contracts/utils/pausable/src/pausable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub trait Pausable {
// ################## ERRORS ##################

#[contracterror]
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
#[repr(u32)]
pub enum PausableError {
/// The operation failed because the contract is paused.
Expand Down
2 changes: 2 additions & 0 deletions examples/fungible-pausable/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ pub const OWNER: Symbol = symbol_short!("OWNER");
pub struct ExampleContract;

#[contracterror]
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
#[repr(u32)]
pub enum ExampleContractError {
Unauthorized = 1,
}
Expand Down
2 changes: 2 additions & 0 deletions examples/fungible-pausable/src/contract_token_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ pub const OWNER: Symbol = symbol_short!("OWNER");
pub struct ExampleContract;

#[contracterror]
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
#[repr(u32)]
pub enum ExampleContractError {
Unauthorized = 1,
}
Expand Down
2 changes: 2 additions & 0 deletions examples/pausable/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub enum DataKey {
}

#[contracterror]
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
#[repr(u32)]
pub enum ExampleContractError {
Unauthorized = 1,
}
Expand Down

0 comments on commit 7342590

Please sign in to comment.