Skip to content

Commit

Permalink
quick fix regarding unsupported kinds during encoding/decoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
niamtokik committed Nov 19, 2023
1 parent 9c298fd commit d2cecd5
Show file tree
Hide file tree
Showing 3 changed files with 157 additions and 67 deletions.
4 changes: 2 additions & 2 deletions apps/nostr_relay/src/nostr_relay_events.erl
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,12 @@ match_event_kind_test() ->

% a filter where an kind public key is not in the kinds list
% must return false
WrongKinds = [metadata],
WrongKinds = [set_metadata],
?assertEqual(false, match_event_kind(E, #filter{ kinds = WrongKinds })),

% a filter containing an kind public key in the kinds list
% must return true.
RightKinds = [metadata, text_note],
RightKinds = [set_metadata, text_note],
?assertEqual(true, match_event_kind(E, #filter{ kinds = RightKinds })).

%%--------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions apps/nostrlib/include/nostrlib.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
%% A macro used to translate a kind as integer or atom.
%%--------------------------------------------------------------------
-define(KIND(K_INTEGER, K_ATOM),
kind(K_INTEGER) -> K_ATOM;
kind(K_ATOM) -> K_INTEGER
kind(K_INTEGER) -> {ok, K_ATOM};
kind(K_ATOM) -> {ok, K_INTEGER}
).

%%%===================================================================
Expand Down
Loading

0 comments on commit d2cecd5

Please sign in to comment.