Move new to top of impl block
To ease reading, put the `new` method at the top of the impl block. Improve rustdocs while we do it.
This commit is contained in:
parent
08e55bc4f1
commit
25d1472924
|
@ -110,17 +110,17 @@ impl FilterHash {
|
|||
}
|
||||
|
||||
impl BlockFilter {
|
||||
/// Creates a new filter from pre-computed data.
|
||||
pub fn new (content: &[u8]) -> BlockFilter {
|
||||
BlockFilter { content: content.to_vec() }
|
||||
}
|
||||
|
||||
/// compute this filter's id in a chain of filters
|
||||
pub fn filter_header(&self, previous_filter_header: &FilterHeader) -> FilterHeader {
|
||||
let filter_hash = FilterHash::hash(self.content.as_slice());
|
||||
filter_hash.filter_header(previous_filter_header)
|
||||
}
|
||||
|
||||
/// create a new filter from pre-computed data
|
||||
pub fn new (content: &[u8]) -> BlockFilter {
|
||||
BlockFilter { content: content.to_vec() }
|
||||
}
|
||||
|
||||
/// Compute a SCRIPT_FILTER that contains spent and output scripts
|
||||
pub fn new_script_filter<M>(block: &Block, script_for_coin: M) -> Result<BlockFilter, Error>
|
||||
where M: Fn(&OutPoint) -> Result<Script, Error> {
|
||||
|
|
Loading…
Reference in New Issue