|
|
@@ -30,8 +30,66 @@ pub enum PythReceiverError {
|
|
|
}
|
|
|
|
|
|
impl core::fmt::Debug for PythReceiverError {
|
|
|
- fn fmt(&self, _: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
|
|
- Ok(())
|
|
|
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
|
|
+ match self {
|
|
|
+ PythReceiverError::PriceUnavailable => write!(f, "PriceUnavailable"),
|
|
|
+ PythReceiverError::InvalidUpdateData => write!(f, "InvalidUpdateData"),
|
|
|
+ PythReceiverError::VaaVerificationFailed => write!(f, "VaaVerificationFailed"),
|
|
|
+ PythReceiverError::InvalidVaa => write!(f, "InvalidVaa"),
|
|
|
+ PythReceiverError::InvalidWormholeMessage => write!(f, "InvalidWormholeMessage"),
|
|
|
+ PythReceiverError::InvalidMerkleProof => write!(f, "InvalidMerkleProof"),
|
|
|
+ PythReceiverError::InvalidAccumulatorMessage => write!(f, "InvalidAccumulatorMessage"),
|
|
|
+ PythReceiverError::InvalidMerkleRoot => write!(f, "InvalidMerkleRoot"),
|
|
|
+ PythReceiverError::InvalidMerklePath => write!(f, "InvalidMerklePath"),
|
|
|
+ PythReceiverError::InvalidUnknownSource => write!(f, "InvalidUnknownSource"),
|
|
|
+ PythReceiverError::NewPriceUnavailable => write!(f, "NewPriceUnavailable"),
|
|
|
+ PythReceiverError::InvalidAccumulatorMessageType => write!(f, "InvalidAccumulatorMessageType"),
|
|
|
+ PythReceiverError::InsufficientFee => write!(f, "InsufficientFee"),
|
|
|
+ PythReceiverError::InvalidEmitterAddress => write!(f, "InvalidEmitterAddress"),
|
|
|
+ PythReceiverError::TooManyUpdates => write!(f, "TooManyUpdates"),
|
|
|
+ PythReceiverError::PriceFeedNotFoundWithinRange => write!(f, "PriceFeedNotFoundWithinRange"),
|
|
|
+ PythReceiverError::NoFreshUpdate => write!(f, "NoFreshUpdate"),
|
|
|
+ PythReceiverError::PriceFeedNotFound => write!(f, "PriceFeedNotFound"),
|
|
|
+ PythReceiverError::InvalidGovernanceMessage => write!(f, "InvalidGovernanceMessage"),
|
|
|
+ PythReceiverError::InvalidGovernanceTarget => write!(f, "InvalidGovernanceTarget"),
|
|
|
+ PythReceiverError::InvalidGovernanceAction => write!(f, "InvalidGovernanceAction"),
|
|
|
+ PythReceiverError::InvalidGovernanceDataSource => write!(f, "InvalidGovernanceDataSource"),
|
|
|
+ PythReceiverError::OldGovernanceMessage => write!(f, "OldGovernanceMessage"),
|
|
|
+ PythReceiverError::GovernanceMessageAlreadyExecuted => write!(f, "GovernanceMessageAlreadyExecuted"),
|
|
|
+ PythReceiverError::InvalidWormholeAddressToSet => write!(f, "InvalidWormholeAddressToSet"),
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+impl core::fmt::Display for PythReceiverError {
|
|
|
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
|
|
+ match self {
|
|
|
+ PythReceiverError::PriceUnavailable => write!(f, "Price unavailable"),
|
|
|
+ PythReceiverError::InvalidUpdateData => write!(f, "Invalid update data"),
|
|
|
+ PythReceiverError::VaaVerificationFailed => write!(f, "VAA verification failed"),
|
|
|
+ PythReceiverError::InvalidVaa => write!(f, "Invalid VAA"),
|
|
|
+ PythReceiverError::InvalidWormholeMessage => write!(f, "Invalid Wormhole message"),
|
|
|
+ PythReceiverError::InvalidMerkleProof => write!(f, "Invalid Merkle proof"),
|
|
|
+ PythReceiverError::InvalidAccumulatorMessage => write!(f, "Invalid accumulator message"),
|
|
|
+ PythReceiverError::InvalidMerkleRoot => write!(f, "Invalid Merkle root"),
|
|
|
+ PythReceiverError::InvalidMerklePath => write!(f, "Invalid Merkle path"),
|
|
|
+ PythReceiverError::InvalidUnknownSource => write!(f, "Invalid unknown source"),
|
|
|
+ PythReceiverError::NewPriceUnavailable => write!(f, "New price unavailable"),
|
|
|
+ PythReceiverError::InvalidAccumulatorMessageType => write!(f, "Invalid accumulator message type"),
|
|
|
+ PythReceiverError::InsufficientFee => write!(f, "Insufficient fee"),
|
|
|
+ PythReceiverError::InvalidEmitterAddress => write!(f, "Invalid emitter address"),
|
|
|
+ PythReceiverError::TooManyUpdates => write!(f, "Too many updates"),
|
|
|
+ PythReceiverError::PriceFeedNotFoundWithinRange => write!(f, "Price feed not found within range"),
|
|
|
+ PythReceiverError::NoFreshUpdate => write!(f, "No fresh update"),
|
|
|
+ PythReceiverError::PriceFeedNotFound => write!(f, "Price feed not found"),
|
|
|
+ PythReceiverError::InvalidGovernanceMessage => write!(f, "Invalid governance message"),
|
|
|
+ PythReceiverError::InvalidGovernanceTarget => write!(f, "Invalid governance target"),
|
|
|
+ PythReceiverError::InvalidGovernanceAction => write!(f, "Invalid governance action"),
|
|
|
+ PythReceiverError::InvalidGovernanceDataSource => write!(f, "Invalid governance data source"),
|
|
|
+ PythReceiverError::OldGovernanceMessage => write!(f, "Old governance message"),
|
|
|
+ PythReceiverError::GovernanceMessageAlreadyExecuted => write!(f, "Governance message already executed"),
|
|
|
+ PythReceiverError::InvalidWormholeAddressToSet => write!(f, "Invalid Wormhole address to set"),
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|