-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(connection-router-api): replace the code with the latest (#272)
- Loading branch information
1 parent
4f00800
commit ece3349
Showing
7 changed files
with
347 additions
and
117 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
use thiserror::Error; | ||
|
||
use axelar_wasm_std_derive::IntoContractError; | ||
|
||
/// A chain name must adhere to the following rules: | ||
/// 1. it can optionally start with an uppercase letter, followed by one or more lowercase letters | ||
/// 2. it can have an optional suffix of an optional dash and one or more digits ("1", "03", "-5" are all valid suffixes) | ||
pub const CHAIN_NAME_REGEX: &str = "^[A-Z]?[a-z]+(-?[0-9]+)?$"; | ||
|
||
#[derive(Error, Debug)] | ||
#[derive(Error, Debug, PartialEq, IntoContractError)] | ||
pub enum Error { | ||
#[error("chain name '{}' must adhere to the pattern '{}'", .0, CHAIN_NAME_REGEX)] | ||
ChainNamePatternMismatch(String), | ||
#[error("address must not be empty")] | ||
EmptyAddress, | ||
#[error("address is invalid")] | ||
InvalidAddress, | ||
|
||
#[error("message ID is invalid")] | ||
InvalidMessageId, | ||
|
||
#[error("chain name is invalid")] | ||
InvalidChainName, | ||
} |
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,3 +1,5 @@ | ||
mod primitives; | ||
|
||
pub mod error; | ||
pub mod msg; | ||
pub mod primitives; | ||
pub use primitives::*; |
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.