Skip to content

Commit

Permalink
Merge pull request #2615 from planetarium/release/210
Browse files Browse the repository at this point in the history
Backmerge 210
  • Loading branch information
moreal authored Oct 29, 2024
2 parents cbb23b9 + c38d17d commit 7c8b0a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions NineChronicles.Headless/GraphTypes/StandaloneQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,20 @@ public StandaloneQuery(StandaloneContext standaloneContext, IKeyStore keyStore,

var filtered = block.Transactions
.Where(tx => tx.Actions.Count == 1)
.Where(tx =>
tx.Actions[0] is Dictionary dictionary && dictionary.ContainsKey("type_id") &&
dictionary["type_id"] is Text typeId && typeId == TransferAsset.TypeIdentifier)
.Select(tx =>
(
transactionRepository.GetTxExecution(blockHash, tx.Id) ??
throw new InvalidOperationException($"TxExecution {tx.Id} not found."),
throw new InvalidOperationException($"TxExecution {tx.Id} not found."),
ToAction(tx.Actions[0])
))
.Where(pair => pair.Item2 is ITransferAsset)
.Select(pair => (pair.Item1!, (ITransferAsset)pair.Item2))
.Where(pair => !pair.Item1.Fail &&
(!recipient.HasValue || pair.Item2.Recipient == recipient) &&
pair.Item2.Amount.Currency.Ticker == "NCG");
(!recipient.HasValue || pair.Item2.Recipient == recipient) &&
pair.Item2.Amount.Currency.Ticker == "NCG");

var histories = filtered.Select(pair =>
new TransferNCGHistory(
Expand Down

0 comments on commit 7c8b0a6

Please sign in to comment.