Remove legacy nip_ee_mls feature-gating code
This commit is contained in:
@@ -12,7 +12,6 @@ defmodule Parrhesia.ConfigTest do
|
||||
assert Parrhesia.Config.get([:policies, :marmot_media_reject_mip04_v1]) == true
|
||||
assert Parrhesia.Config.get([:policies, :marmot_push_max_trigger_age_seconds]) == 120
|
||||
assert Parrhesia.Config.get([:features, :nip_50_search]) == true
|
||||
assert Parrhesia.Config.get([:features, :nip_ee_mls]) == false
|
||||
assert Parrhesia.Config.get([:features, :marmot_push_notifications]) == false
|
||||
end
|
||||
|
||||
|
||||
@@ -229,7 +229,6 @@ defmodule Parrhesia.Policy.EventPolicyTest do
|
||||
Application.put_env(
|
||||
:parrhesia,
|
||||
:features,
|
||||
nip_ee_mls: false,
|
||||
marmot_push_notifications: true
|
||||
)
|
||||
|
||||
@@ -281,7 +280,6 @@ defmodule Parrhesia.Policy.EventPolicyTest do
|
||||
Application.put_env(
|
||||
:parrhesia,
|
||||
:features,
|
||||
nip_ee_mls: false,
|
||||
marmot_push_notifications: true
|
||||
)
|
||||
|
||||
@@ -337,7 +335,6 @@ defmodule Parrhesia.Policy.EventPolicyTest do
|
||||
Application.put_env(
|
||||
:parrhesia,
|
||||
:features,
|
||||
nip_ee_mls: false,
|
||||
marmot_push_notifications: true
|
||||
)
|
||||
|
||||
@@ -424,15 +421,6 @@ defmodule Parrhesia.Policy.EventPolicyTest do
|
||||
)
|
||||
end
|
||||
|
||||
test "rejects mls kinds when feature is disabled" do
|
||||
Application.put_env(:parrhesia, :features, nip_ee_mls: false)
|
||||
|
||||
event = %{"kind" => 443, "tags" => [], "pubkey" => String.duplicate("d", 64), "id" => ""}
|
||||
|
||||
assert {:error, :mls_disabled} =
|
||||
EventPolicy.authorize_write(event, MapSet.new([String.duplicate("d", 64)]))
|
||||
end
|
||||
|
||||
test "enforces min pow difficulty" do
|
||||
Application.put_env(:parrhesia, :policies, min_pow_difficulty: 8)
|
||||
|
||||
|
||||
@@ -346,7 +346,7 @@ defmodule Parrhesia.Storage.Adapters.Postgres.EventsQueryCountTest do
|
||||
})
|
||||
|
||||
assert {:ok, results} =
|
||||
Events.query(%{}, [%{"kinds" => [445], "#h" => [group_id]}], [])
|
||||
Events.query(%{}, [%{"kinds" => [445], "#h" => [group_id]}], now: 1_700_000_700)
|
||||
|
||||
tie_winner_id = Enum.min([tie_a["id"], tie_b["id"]])
|
||||
tie_loser_id = Enum.max([tie_a["id"], tie_b["id"]])
|
||||
@@ -368,7 +368,7 @@ defmodule Parrhesia.Storage.Adapters.Postgres.EventsQueryCountTest do
|
||||
end)
|
||||
|
||||
assert {:ok, results} =
|
||||
Events.query(%{}, [%{"kinds" => [445], "#h" => [group_id]}], [])
|
||||
Events.query(%{}, [%{"kinds" => [445], "#h" => [group_id]}], now: 1_700_001_100)
|
||||
|
||||
expected_ids =
|
||||
events
|
||||
|
||||
@@ -28,12 +28,9 @@ defmodule Parrhesia.Storage.Adapters.Postgres.EventsTest do
|
||||
assert normalized.pubkey == Base.decode16!(pubkey, case: :lower)
|
||||
end
|
||||
|
||||
test "applies MLS retention TTL to kind 445 when enabled" do
|
||||
previous_features = Application.get_env(:parrhesia, :features, [])
|
||||
test "applies MLS retention TTL to kind 445" do
|
||||
previous_policies = Application.get_env(:parrhesia, :policies, [])
|
||||
|
||||
Application.put_env(:parrhesia, :features, Keyword.put(previous_features, :nip_ee_mls, true))
|
||||
|
||||
Application.put_env(
|
||||
:parrhesia,
|
||||
:policies,
|
||||
@@ -41,7 +38,6 @@ defmodule Parrhesia.Storage.Adapters.Postgres.EventsTest do
|
||||
)
|
||||
|
||||
on_exit(fn ->
|
||||
Application.put_env(:parrhesia, :features, previous_features)
|
||||
Application.put_env(:parrhesia, :policies, previous_policies)
|
||||
end)
|
||||
|
||||
@@ -60,11 +56,8 @@ defmodule Parrhesia.Storage.Adapters.Postgres.EventsTest do
|
||||
end
|
||||
|
||||
test "keeps explicit expiration tag for kind 445 when present" do
|
||||
previous_features = Application.get_env(:parrhesia, :features, [])
|
||||
previous_policies = Application.get_env(:parrhesia, :policies, [])
|
||||
|
||||
Application.put_env(:parrhesia, :features, Keyword.put(previous_features, :nip_ee_mls, true))
|
||||
|
||||
Application.put_env(
|
||||
:parrhesia,
|
||||
:policies,
|
||||
@@ -72,7 +65,6 @@ defmodule Parrhesia.Storage.Adapters.Postgres.EventsTest do
|
||||
)
|
||||
|
||||
on_exit(fn ->
|
||||
Application.put_env(:parrhesia, :features, previous_features)
|
||||
Application.put_env(:parrhesia, :policies, previous_policies)
|
||||
end)
|
||||
|
||||
|
||||
@@ -97,14 +97,6 @@ defmodule Parrhesia.Web.ConformanceTest do
|
||||
end
|
||||
|
||||
test "kind 445 commit ACK implies durable visibility before wrapped welcome ACK" do
|
||||
previous_features = Application.get_env(:parrhesia, :features, [])
|
||||
|
||||
Application.put_env(:parrhesia, :features, Keyword.put(previous_features, :nip_ee_mls, true))
|
||||
|
||||
on_exit(fn ->
|
||||
Application.put_env(:parrhesia, :features, previous_features)
|
||||
end)
|
||||
|
||||
{:ok, state} = Connection.init(subscription_index: nil)
|
||||
|
||||
commit_event =
|
||||
@@ -158,9 +150,7 @@ defmodule Parrhesia.Web.ConformanceTest do
|
||||
Application.put_env(
|
||||
:parrhesia,
|
||||
:features,
|
||||
previous_features
|
||||
|> Keyword.put(:marmot_push_notifications, true)
|
||||
|> Keyword.put(:nip_ee_mls, false)
|
||||
Keyword.put(previous_features, :marmot_push_notifications, true)
|
||||
)
|
||||
|
||||
Application.put_env(
|
||||
|
||||
@@ -159,14 +159,6 @@ defmodule Parrhesia.Web.ConnectionTest do
|
||||
end
|
||||
|
||||
test "malformed kind 445 envelope EVENT is rejected" do
|
||||
previous_features = Application.get_env(:parrhesia, :features, [])
|
||||
|
||||
Application.put_env(:parrhesia, :features, Keyword.put(previous_features, :nip_ee_mls, true))
|
||||
|
||||
on_exit(fn ->
|
||||
Application.put_env(:parrhesia, :features, previous_features)
|
||||
end)
|
||||
|
||||
state = connection_state()
|
||||
|
||||
event =
|
||||
@@ -232,9 +224,7 @@ defmodule Parrhesia.Web.ConnectionTest do
|
||||
Application.put_env(
|
||||
:parrhesia,
|
||||
:features,
|
||||
previous_features
|
||||
|> Keyword.put(:marmot_push_notifications, true)
|
||||
|> Keyword.put(:nip_ee_mls, false)
|
||||
Keyword.put(previous_features, :marmot_push_notifications, true)
|
||||
)
|
||||
|
||||
Application.put_env(
|
||||
@@ -285,9 +275,7 @@ defmodule Parrhesia.Web.ConnectionTest do
|
||||
Application.put_env(
|
||||
:parrhesia,
|
||||
:features,
|
||||
previous_features
|
||||
|> Keyword.put(:marmot_push_notifications, true)
|
||||
|> Keyword.put(:nip_ee_mls, false)
|
||||
Keyword.put(previous_features, :marmot_push_notifications, true)
|
||||
)
|
||||
|
||||
Application.put_env(
|
||||
|
||||
Reference in New Issue
Block a user