Skip to content

Commit

Permalink
feat: add original nonce to fendermint
Browse files Browse the repository at this point in the history
  • Loading branch information
karlem committed Jan 9, 2025
1 parent 490ce5e commit edae481
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ipc/api/src/cross.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ pub struct IpcEnvelope {
/// outgoing nonce for the envelope.
/// This nonce is set by the gateway when committing the message for propagation
pub nonce: u64,
/// original nonce of the message from the source network
pub original_nonce: u64,
}

impl IpcEnvelope {
Expand All @@ -57,6 +59,7 @@ impl IpcEnvelope {
to,
value,
nonce: 0,
original_nonce: 0,
message: Default::default(),
})
}
Expand All @@ -83,6 +86,7 @@ impl IpcEnvelope {
to,
value,
nonce: 0,
original_nonce: 0,
message: Default::default(),
})
}
Expand Down
2 changes: 2 additions & 0 deletions ipc/api/src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ macro_rules! cross_msg_types {
.map_err(|e| anyhow!("cannot convert `to`` ipc address due to: {e:}"))?,
value: val,
nonce: value.nonce,
original_nonce: value.original_nonce,
message: ethers::core::types::Bytes::from(value.message),
};
Ok(c)
Expand All @@ -112,6 +113,7 @@ macro_rules! cross_msg_types {
kind: IpcMsgKind::try_from(value.kind)?,
message: value.message.to_vec(),
nonce: value.nonce,
original_nonce: value.original_nonce,
};
Ok(s)
}
Expand Down

0 comments on commit edae481

Please sign in to comment.