-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cost is a weight in milli weight units. Sometimes we need to work in weight units. This commit updates the API of Cost so that Cost can be converted to bitcoin::Weight and vice versa. Function inputs or outputs that are weight units are converted to bitcoin::Weight to show the unit of measurement. Because bitcoin::Weight works in terms of u64 while Cost works in terms of u32, this commit adds U32Weight, which is a private newtype that safely translates between u64 and u32. Because we use bitcoin::Weight in elements contexts, we require the bitcoin feature for elements code. We will be able to use elements::Weight once this struct is added to rust-elements.
- Loading branch information
1 parent
c49b870
commit 7b48bd8
Showing
2 changed files
with
84 additions
and
36 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
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