-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publishes sealevel balance as a relayer metric **Drive-by Changes** - Creates `HyperlaneSealevelError`, a `hyperlane-sealevel` specific type to avoid including sealevel errors in `hyperlane-core`'s `ChainCommunicationError`. It's pretty empty now, but we have a starting point now. This follows the approach used in `hyperlane-cosmos` too. - Includes an rpc provider instance in `SealevelProvider`, and uses it to add `get_balance` on `SealevelProvider`. **Testing** None, as sealevel e2e is currently disabled
- Loading branch information
1 parent
77aa58c
commit 98bb228
Showing
9 changed files
with
120 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use hyperlane_core::ChainCommunicationError; | ||
use solana_client::client_error::ClientError; | ||
use solana_sdk::pubkey::ParsePubkeyError; | ||
|
||
/// Errors from the crates specific to the hyperlane-sealevel | ||
/// implementation. | ||
/// This error can then be converted into the broader error type | ||
/// in hyperlane-core using the `From` trait impl | ||
#[derive(Debug, thiserror::Error)] | ||
pub enum HyperlaneSealevelError { | ||
/// ParsePubkeyError error | ||
#[error("{0}")] | ||
ParsePubkeyError(#[from] ParsePubkeyError), | ||
/// ClientError error | ||
#[error("{0}")] | ||
ClientError(#[from] ClientError), | ||
} | ||
|
||
impl From<HyperlaneSealevelError> for ChainCommunicationError { | ||
fn from(value: HyperlaneSealevelError) -> Self { | ||
ChainCommunicationError::from_other(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
Oops, something went wrong.