-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added parsing from esdt attributes for generated structs and enums
- Loading branch information
Showing
17 changed files
with
327 additions
and
12 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
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use crate::errors::novax_error::NovaXError; | ||
|
||
/// Enumerates coding-related errors, specifically for encoding and decoding processes. | ||
/// | ||
/// This enum represents errors that can occur during the encoding and decoding stages, particularly | ||
/// involving serialization and deserialization of data structures used within the NovaX framework. | ||
/// | ||
/// # Variants | ||
/// - `CannotDecodeEsdtAttributes`: This error occurs when there's a failure in decoding attributes | ||
/// associated with an ESDT (Elrond Standard Digital Token). While attributes are typically found in | ||
/// non-fungible tokens (NFTs), this error covers scenarios where decoding such attributes fails for | ||
/// any ESDT, fungible or non-fungible. | ||
#[derive(Serialize, Deserialize, PartialEq, Clone, Debug)] | ||
pub enum CodingError { | ||
/// Represents an error that occurs when the decoding of attributes for an ESDT (Elrond Standard Digital Token) | ||
/// fails. This error is particularly significant in the context of non-fungible tokens (NFTs), where attributes | ||
/// play a crucial role in defining the token's properties and metadata. | ||
CannotDecodeEsdtAttributes, | ||
} | ||
|
||
impl From<CodingError> for NovaXError { | ||
/// Converts a `CodingError` into a `NovaXError`. | ||
/// | ||
/// This implementation enables the seamless transformation of a specific coding error into the broader | ||
/// `NovaXError` type. This is particularly useful for error handling strategies that require a consistent | ||
/// error type across different modules of the NovaX framework. | ||
/// | ||
/// # Arguments | ||
/// - `value`: The `CodingError` instance to be converted. | ||
/// | ||
/// # Returns | ||
/// A `NovaXError` instance, specifically as a `NovaXError::Coding` variant containing the original `CodingError`. | ||
fn from(value: CodingError) -> Self { | ||
NovaXError::Coding(value) | ||
} | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.