Add a convert_payload function to Signed (#2320)

* Add a `convert_payload` function to `Signed`

* Review feedback
This commit is contained in:
Bastian Köcher
2021-01-25 21:50:45 +01:00
committed by GitHub
parent b210850d5c
commit fa6e4b4488
2 changed files with 16 additions and 0 deletions
+6
View File
@@ -85,6 +85,12 @@ impl Statement {
}
}
impl From<&'_ Statement> for CompactStatement {
fn from(stmt: &Statement) -> Self {
stmt.to_compact()
}
}
impl EncodeAs<CompactStatement> for Statement {
fn encode_as(&self) -> Vec<u8> {
self.to_compact().encode()