+ let testnet_genesis = ChainHash::using_genesis_block(Network::Testnet);
+ let valid_encrypted_vout = namespace.get_encrypted_vout(0, 0, &fake_scid_rand_bytes);
+ let valid_fake_scid = scid_utils::scid_from_parts(1, 0, valid_encrypted_vout as u64).unwrap();
+ assert!(is_valid_phantom(&fake_scid_rand_bytes, valid_fake_scid, &testnet_genesis));
+ let invalid_fake_scid = scid_utils::scid_from_parts(1, 0, 12).unwrap();
+ assert!(!is_valid_phantom(&fake_scid_rand_bytes, invalid_fake_scid, &testnet_genesis));
+ }
+
+ #[test]
+ fn test_is_valid_intercept() {
+ let namespace = Namespace::Intercept;
+ let fake_scid_rand_bytes = [0; 32];
+ let testnet_genesis = ChainHash::using_genesis_block(Network::Testnet);