Remove `ValueSum::from_raw`
There is no reason for crate users to be constructing `ValueSum` directly. We no longer use it to represent `valueBalanceOrchard`, instead requiring the user to specify their own type.
This commit is contained in:
parent
04af08d343
commit
d11fbd4a56
|
@ -6,4 +6,8 @@ and this project adheres to Rust's notion of
|
|||
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
### Removed
|
||||
- `orchard::value::ValueSum::from_raw`
|
||||
|
||||
## [0.1.0-beta.1] - 2021-12-17
|
||||
Initial release!
|
||||
|
|
10
src/value.rs
10
src/value.rs
|
@ -131,7 +131,7 @@ impl Sub for NoteValue {
|
|||
}
|
||||
}
|
||||
|
||||
/// A sum of Orchard note values
|
||||
/// A sum of Orchard note values.
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq)]
|
||||
pub struct ValueSum(i128);
|
||||
|
||||
|
@ -140,14 +140,6 @@ impl ValueSum {
|
|||
// Default for i64 is zero.
|
||||
Default::default()
|
||||
}
|
||||
|
||||
/// Creates a value sum from its raw numeric value.
|
||||
///
|
||||
/// This only enforces that the value is a signed 63-bit integer. Callers should
|
||||
/// enforce any additional constraints on the value's valid range themselves.
|
||||
pub fn from_raw(value: i64) -> Self {
|
||||
ValueSum(value as i128)
|
||||
}
|
||||
}
|
||||
|
||||
impl Add for ValueSum {
|
||||
|
|
Loading…
Reference in New Issue