Skip to content

Commit

Permalink
node-data: add timestamp to Ratification payload
Browse files Browse the repository at this point in the history
  • Loading branch information
herr-seppia committed Jan 10, 2024
1 parent 1e64238 commit 5349837
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion node-data/src/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ impl Serializable for Label {
impl Serializable for Ratification {
fn write<W: Write>(&self, w: &mut W) -> io::Result<()> {
w.write_all(&self.signature)?;
w.write_all(&self.timestamp.to_le_bytes())?;
self.validation_result.write(w)?;

Ok(())
Expand All @@ -274,11 +275,12 @@ impl Serializable for Ratification {
Self: Sized,
{
let signature = Self::read_bytes(r)?;

let timestamp = Self::read_u64_le(r)?;
let validation_result = ValidationResult::read(r)?;

Ok(Ratification {
signature,
timestamp,
validation_result,
})
}
Expand Down
1 change: 1 addition & 0 deletions node-data/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ pub mod payload {
)]
pub struct Ratification {
pub signature: [u8; 48],
pub timestamp: u64,
pub validation_result: ValidationResult,
}

Expand Down

0 comments on commit 5349837

Please sign in to comment.