Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/wasm/rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
byteorder = "1.4.3"
thiserror = "1.0.30"
num-bigint = { version = "0.4", default-features = false, features = ["serde"] }
num-traits = { version = "0.2.14", default-features = false }
bigdecimal = { version = "0.3.0", default-features = false, features = ["serde"] }
serde_json = { version = "1.0.74", default-features = false, features = ["alloc"] }
polywrap_msgpack_serde = "0.0.2-beta.6"

[dev-dependencies]
serde = { version = "1.0.136", default-features = false, features = ["derive"] }
Expand Down
5 changes: 1 addition & 4 deletions packages/wasm/rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,4 @@ pub use msgpack::{
DecodeError, EncodeError, EnumTypeError, Read, ReadDecoder, Write, WriteEncoder,
};

pub use num_bigint::BigInt;
pub use bigdecimal::BigDecimal as BigNumber;
pub use serde_json as JSON;
pub use std::collections::BTreeMap as Map;
pub use polywrap_msgpack_serde::*;
13 changes: 7 additions & 6 deletions packages/wasm/rs/src/msgpack/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Errors returned from I/O `Write` and `Read` operations

use super::Format;
use polywrap_msgpack_serde::{JSON, ParseBigIntError};
use thiserror::Error;

/// Errors from encoding data
Expand Down Expand Up @@ -64,8 +65,8 @@ impl From<std::io::Error> for EncodeError {
}
}

impl From<serde_json::Error> for EncodeError {
fn from(e: serde_json::Error) -> EncodeError {
impl From<JSON::Error> for EncodeError {
fn from(e: JSON::Error) -> EncodeError {
EncodeError::JSONWriteError(e.to_string())
}
}
Expand Down Expand Up @@ -146,14 +147,14 @@ impl From<std::io::Error> for DecodeError {
}
}

impl From<serde_json::Error> for DecodeError {
fn from(e: serde_json::Error) -> DecodeError {
impl From<JSON::Error> for DecodeError {
fn from(e: JSON::Error) -> DecodeError {
DecodeError::JSONReadError(e.to_string())
}
}

impl From<num_bigint::ParseBigIntError> for DecodeError {
fn from(e: num_bigint::ParseBigIntError) -> Self {
impl From<ParseBigIntError> for DecodeError {
fn from(e: ParseBigIntError) -> Self {
DecodeError::BigIntReadError(e.to_string())
}
}
Expand Down