#![cfg(feature = "dandelion")]
use blvm_node::network::relay::RelayManager;
use blvm_protocol::Hash;
fn hash_from_u8(v: u8) -> Hash {
[v; 32]
}
#[test]
fn stem_then_fluff_via_hop_limit() {
let mut policies = blvm_node::network::relay::RelayPolicies::default();
policies.enable_dandelion = true;
let mut relay = blvm_node::network::relay::RelayManager::with_policies(policies);
let peers = vec!["p1".into(), "p2".into(), "p3".into()];
relay.set_dandelion_fluff_probability(0.0);
relay.set_dandelion_max_stem_hops(0);
relay.initialize_dandelion_path("p1".into(), &peers);
let tx = hash_from_u8(1);
let next = relay.relay_transaction_dandelion(tx, "p1".into(), &peers);
assert!(next.is_some());
let next2 = relay.relay_transaction_dandelion(tx, "p1".into(), &peers);
assert!(next2.is_none());
}