Begin 'fixing' errors

This commit is contained in:
James Wilson
2025-09-30 18:04:21 +01:00
parent 964c474088
commit 4606eb4679
11 changed files with 239 additions and 241 deletions
+3 -3
View File
@@ -21,7 +21,7 @@ pub use dispatch_error::{
pub use crate::metadata::Metadata;
pub use scale_decode::Error as DecodeError;
pub use scale_encode::Error as EncodeError;
pub use subxt_core::error::{ExtrinsicError, MetadataError, StorageAddressError};
pub use subxt_core::error::{ExtrinsicError, MetadataError, StorageError};
pub use subxt_metadata::TryFromError as MetadataTryFromError;
/// The underlying error enum, generic over the type held by the `Runtime`
@@ -68,7 +68,7 @@ pub enum Error {
Block(#[from] BlockError),
/// An error encoding a storage address.
#[error("Error encoding storage address: {0}")]
StorageAddress(#[from] StorageAddressError),
StorageAddress(#[from] StorageError),
/// The bytes representing an error that we were unable to decode.
#[error("An error occurred but it could not be decoded: {0:?}")]
Unknown(Vec<u8>),
@@ -87,7 +87,7 @@ impl From<CoreError> for Error {
match value {
CoreError::Codec(e) => Error::Codec(e),
CoreError::Metadata(e) => Error::Metadata(e),
CoreError::StorageAddress(e) => Error::StorageAddress(e),
CoreError::StorageError(e) => Error::StorageAddress(e),
CoreError::Decode(e) => Error::Decode(e),
CoreError::Encode(e) => Error::Encode(e),
CoreError::Extrinsic(e) => Error::Extrinsic(e),
+3 -3
View File
@@ -6,7 +6,7 @@ use crate::{
backend::{BackendExt, BlockRef},
client::{OfflineClientT, OnlineClientT},
config::{Config, HashFor},
error::{Error, MetadataError, StorageAddressError},
error::{Error, MetadataError, StorageError},
metadata::DecodeWithMetadata,
storage::storage_value::StorageValue,
};
@@ -542,12 +542,12 @@ where
}
/// Strips the first 32 bytes (16 for the pallet hash, 16 for the entry hash) off some storage address bytes.
fn strip_storage_address_root_bytes(address_bytes: &mut &[u8]) -> Result<(), StorageAddressError> {
fn strip_storage_address_root_bytes(address_bytes: &mut &[u8]) -> Result<(), StorageError> {
if address_bytes.len() >= 32 {
*address_bytes = &address_bytes[32..];
Ok(())
} else {
Err(StorageAddressError::UnexpectedAddressBytes)
Err(StorageError::UnexpectedAddressBytes)
}
}