Skip to content

Commit b8b8ce2

Browse files
committed
chore: rm MsgpackDecodingError
1 parent 256d1af commit b8b8ce2

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

crates/algokit_transact/src/error.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ pub enum AlgoKitTransactError {
1818
#[snafu(display("Error occurred during msgpack encoding: {source}"))]
1919
MsgpackEncodingError { source: rmpv::encode::Error },
2020

21-
#[snafu(display("Error occurred during msgpack decoding: {source}"))]
22-
MsgpackDecodingError { source: rmpv::decode::Error },
23-
2421
#[snafu(display("Error occurred during decoding at path {path}: {source}"))]
2522
DecodingError {
2623
path: String,
@@ -52,12 +49,6 @@ impl From<rmpv::encode::Error> for AlgoKitTransactError {
5249
}
5350
}
5451

55-
impl From<rmpv::decode::Error> for AlgoKitTransactError {
56-
fn from(source: rmpv::decode::Error) -> Self {
57-
AlgoKitTransactError::MsgpackDecodingError { source }
58-
}
59-
}
60-
6152
impl From<serde_path_to_error::Error<rmp_serde::decode::Error>> for AlgoKitTransactError {
6253
fn from(err: serde_path_to_error::Error<rmp_serde::decode::Error>) -> Self {
6354
AlgoKitTransactError::DecodingError {

crates/algokit_transact/src/traits.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@ pub trait AlgorandMsgpack: Serialize + for<'de> Deserialize<'de> {
3939
self.serialize(&mut temp_serializer)?;
4040

4141
// Deserialize into a Value and sort recursively
42-
let value = rmpv::decode::read_value(&mut temp_buf.as_slice())?;
42+
let value = rmpv::decode::read_value(&mut temp_buf.as_slice())
43+
.expect("value that was just serialized should deserialize");
4344
let sorted_value = sort_msgpack_value(value)?;
4445

4546
// Serialize the sorted value
4647
let mut final_buf = Vec::new();
47-
rmpv::encode::write_value(&mut final_buf, &sorted_value)?;
48+
rmpv::encode::write_value(&mut final_buf, &sorted_value)
49+
.expect("value that was just sorted should serialize");
4850

4951
Ok(final_buf)
5052
}

crates/algokit_transact_ffi/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ impl From<algokit_transact::AlgoKitTransactError> for AlgoKitTransactError {
4949
message: e.to_string(),
5050
}
5151
}
52-
algokit_transact::AlgoKitTransactError::MsgpackDecodingError { .. } => {
53-
AlgoKitTransactError::DecodingError {
54-
message: e.to_string(),
55-
}
56-
}
5752
algokit_transact::AlgoKitTransactError::MsgpackEncodingError { .. } => {
5853
AlgoKitTransactError::EncodingError {
5954
message: e.to_string(),

0 commit comments

Comments
 (0)