ecaps2: Add a constructor.
This commit is contained in:
parent
36d6169386
commit
af8cf177ce
1 changed files with 9 additions and 0 deletions
|
@ -28,6 +28,15 @@ generate_element!(
|
||||||
|
|
||||||
impl PresencePayload for ECaps2 {}
|
impl PresencePayload for ECaps2 {}
|
||||||
|
|
||||||
|
impl ECaps2 {
|
||||||
|
/// Create an ECaps2 element from a list of hashes.
|
||||||
|
pub fn new(hashes: Vec<Hash>) -> ECaps2 {
|
||||||
|
ECaps2 {
|
||||||
|
hashes,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn compute_item(field: &str) -> Vec<u8> {
|
fn compute_item(field: &str) -> Vec<u8> {
|
||||||
let mut bytes = field.as_bytes().to_vec();
|
let mut bytes = field.as_bytes().to_vec();
|
||||||
bytes.push(0x1f);
|
bytes.push(0x1f);
|
||||||
|
|
Loading…
Reference in a new issue