Skip to content

Commit 256d1af

Browse files
committed
chore: consolidate DecodingError
1 parent 603a3e1 commit 256d1af

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

crates/algokit_transact/src/error.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,14 @@ pub enum AlgoKitTransactError {
1515
#[snafu(display("Error occurred during encoding: {source}"))]
1616
EncodingError { source: rmp_serde::encode::Error },
1717

18-
#[snafu(display("Error occurred during decoding: {source}"))]
19-
DecodingError { source: rmp_serde::decode::Error },
20-
2118
#[snafu(display("Error occurred during msgpack encoding: {source}"))]
2219
MsgpackEncodingError { source: rmpv::encode::Error },
2320

2421
#[snafu(display("Error occurred during msgpack decoding: {source}"))]
2522
MsgpackDecodingError { source: rmpv::decode::Error },
2623

2724
#[snafu(display("Error occurred during decoding at path {path}: {source}"))]
28-
DecodingErrorWithPath {
25+
DecodingError {
2926
path: String,
3027
source: rmp_serde::decode::Error,
3128
},
@@ -49,12 +46,6 @@ impl From<rmp_serde::encode::Error> for AlgoKitTransactError {
4946
}
5047
}
5148

52-
impl From<rmp_serde::decode::Error> for AlgoKitTransactError {
53-
fn from(source: rmp_serde::decode::Error) -> Self {
54-
AlgoKitTransactError::DecodingError { source }
55-
}
56-
}
57-
5849
impl From<rmpv::encode::Error> for AlgoKitTransactError {
5950
fn from(source: rmpv::encode::Error) -> Self {
6051
AlgoKitTransactError::MsgpackEncodingError { source }
@@ -69,7 +60,7 @@ impl From<rmpv::decode::Error> for AlgoKitTransactError {
6960

7061
impl From<serde_path_to_error::Error<rmp_serde::decode::Error>> for AlgoKitTransactError {
7162
fn from(err: serde_path_to_error::Error<rmp_serde::decode::Error>) -> Self {
72-
AlgoKitTransactError::DecodingErrorWithPath {
63+
AlgoKitTransactError::DecodingError {
7364
path: err.path().to_string(),
7465
source: err.into_inner(),
7566
}

crates/algokit_transact_ffi/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ impl From<algokit_transact::AlgoKitTransactError> for AlgoKitTransactError {
7777
message: e.to_string(),
7878
}
7979
}
80-
algokit_transact::AlgoKitTransactError::DecodingErrorWithPath { .. } => {
81-
AlgoKitTransactError::DecodingError {
82-
message: e.to_string(),
83-
}
84-
}
8580
}
8681
}
8782
}

0 commit comments

Comments
 (0)