Skip to content

Commit

Permalink
feat: sequencer error code VALIDATE_FAILURE
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcaron authored and xJonathanLEI committed May 20, 2024
1 parent 82bac8b commit 241b009
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions starknet-providers/src/sequencer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ pub enum ErrorCode {
UndeclaredClass,
#[serde(rename = "StarknetErrorCode.INVALID_TRANSACTION_NONCE")]
InvalidTransactionNonce,
#[serde(rename = "StarknetErrorCode.VALIDATE_FAILURE")]
ValidateFailure,
#[serde(rename = "StarknetErrorCode.CLASS_ALREADY_DECLARED")]
ClassAlreadyDeclared,
#[serde(rename = "StarknetErrorCode.COMPILATION_FAILED")]
Expand Down Expand Up @@ -474,6 +476,9 @@ impl From<SequencerError> for ProviderError {
ErrorCode::MalformedRequest => None,
ErrorCode::UndeclaredClass => Some(StarknetError::ClassHashNotFound),
ErrorCode::InvalidTransactionNonce => Some(StarknetError::InvalidTransactionNonce),
ErrorCode::ValidateFailure => {
Some(StarknetError::ValidationFailure(value.message.clone()))
}
ErrorCode::ClassAlreadyDeclared => Some(StarknetError::ClassAlreadyDeclared),
ErrorCode::CompilationFailed => Some(StarknetError::CompilationFailed),
ErrorCode::InvalidCompiledClassHash => Some(StarknetError::CompiledClassHashMismatch),
Expand Down

0 comments on commit 241b009

Please sign in to comment.