Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix compile error caused by decimal-rs 0.1.42 #5228

Merged
merged 1 commit into from
Mar 8, 2023
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
12 changes: 2 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion base_layer/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ chacha20poly1305 = "0.10.1"
chrono = { version = "0.4.19", default-features = false, features = ["serde"] }
criterion = { version = "0.4.0", optional = true }
croaring = { version = "0.5.2", optional = true }
decimal-rs = "0.1.20"
decimal-rs = "0.1.42"
derivative = "2.2.0"
digest = "0.9.0"
fs2 = "0.4.0"
Expand Down
9 changes: 8 additions & 1 deletion base_layer/core/src/transactions/tari_amount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,14 @@ pub enum MicroTariError {
#[error("Failed to parse value: {0}")]
ParseError(String),
#[error("Failed to convert value: {0}")]
ConversionError(#[from] DecimalConvertError),
ConversionError(DecimalConvertError),
}

// DecimalConvertError does not implement Error
impl From<DecimalConvertError> for MicroTariError {
fn from(err: DecimalConvertError) -> Self {
MicroTariError::ConversionError(err)
}
}
/// A convenience constant that makes it easier to define Tari amounts.
/// ```edition2018
Expand Down