add replay tag for sphinx
This commit is contained in:
@@ -8,9 +8,10 @@ license = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
|
||||
[dependencies]
|
||||
sphinx-packet = { version = "0.1.0", optional = true }
|
||||
#sphinx-packet = { version = "0.1.0", optional = true }
|
||||
nym-outfox = { path = "../../../nym-outfox", optional = true }
|
||||
thiserror = { workspace = true }
|
||||
sphinx-packet = { git = "https://github.com/nymtech/sphinx.git", branch = "simon/replay_tag", optional = true}
|
||||
|
||||
[features]
|
||||
default = ["sphinx"]
|
||||
|
||||
@@ -9,6 +9,7 @@ pub use nym_outfox::{
|
||||
// re-exporting types and constants available in sphinx
|
||||
#[cfg(feature = "outfox")]
|
||||
use nym_outfox::packet::{OutfoxPacket, OutfoxProcessedPacket};
|
||||
use sphinx_packet::header::keys::ReplayTag;
|
||||
#[cfg(feature = "sphinx")]
|
||||
pub use sphinx_packet::{
|
||||
constants::{
|
||||
@@ -57,6 +58,15 @@ pub enum NymProcessedPacket {
|
||||
Outfox(OutfoxProcessedPacket),
|
||||
}
|
||||
|
||||
impl NymProcessedPacket {
|
||||
pub fn replay_tag(&self) -> ReplayTag {
|
||||
match self {
|
||||
NymProcessedPacket::Sphinx(sphinx) => sphinx.replay_tag(),
|
||||
NymProcessedPacket::Outfox(_) => todo!(), //SW temporary while I add a replay tag to outfox
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for NymPacket {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
#[allow(unreachable_patterns)]
|
||||
|
||||
@@ -18,7 +18,8 @@ curve25519-dalek = "3.2"
|
||||
chacha20poly1305 = "0.10.1"
|
||||
getrandom = { workspace = true, features = ["js"] }
|
||||
thiserror = { workspace = true }
|
||||
sphinx-packet = "0.1.0"
|
||||
#sphinx-packet = "0.1.0"
|
||||
sphinx-packet = { git = "https://github.com/nymtech/sphinx.git", branch = "simon/replay_tag"}
|
||||
rand = "0.7.3"
|
||||
log = "0.4"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user