-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add single random draw selection algorithm
- Loading branch information
1 parent
776648d
commit 66871e3
Showing
6 changed files
with
339 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# 0.1.0 - 2022-12-17 | ||
|
||
* Initial release. | ||
|
||
# 0.2.0 - 2023-06-03 | ||
|
||
- Add Single Random Draw module and a basic error type. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
msrv = "1.41.1" | ||
msrv = "1.48.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/// Error types. | ||
use bitcoin::FeeRate; | ||
use bitcoin::Weight; | ||
use std::error::Error as E; | ||
use std::fmt; | ||
|
||
#[derive(Debug)] | ||
pub enum Error { | ||
MultiplicationOverflow(Weight, FeeRate), | ||
AdditionOverflow(Weight, Weight), | ||
} | ||
|
||
impl E for Error {} | ||
|
||
impl fmt::Display for Error { | ||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||
match self { | ||
Error::MultiplicationOverflow(one, two) => { | ||
write!(f, "{} * {} exceeds u64 Max", one, two) | ||
} | ||
Error::AdditionOverflow(one, two) => { | ||
write!(f, "{} + {} exceeds u64 Max", one, two) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.