Skip to content

Commit

Permalink
Merge pull request #2243 from moreal/regex-action-type-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
moreal authored Sep 12, 2023
2 parents 2087ffd + a38bc8a commit 5734bea
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.RegularExpressions;
using Bencodex;
using Bencodex.Json;
using GraphQL;
Expand Down Expand Up @@ -75,7 +76,7 @@ public TransactionHeadlessQuery(StandaloneContext standaloneContext)
new QueryArgument<NonNullGraphType<LongGraphType>>
{ Name = "limit", Description = "number of block to query." },
new QueryArgument<NonNullGraphType<StringGraphType>>
{ Name = "actionType", Description = "filter tx by having actions' type" }
{ Name = "actionType", Description = "filter tx by having actions' type. It is regular expression." }
),
resolve: context =>
{
Expand All @@ -99,7 +100,7 @@ public TransactionHeadlessQuery(StandaloneContext standaloneContext)
return false;
}

return typeId == actionType;
return Regex.IsMatch(typeId, actionType);
}));

return transactions;
Expand Down

0 comments on commit 5734bea

Please sign in to comment.