From 4c1a232c36fe6de0cb622d5ca2a2c72714851677 Mon Sep 17 00:00:00 2001 From: moreal Date: Wed, 2 Oct 2024 15:11:49 +0900 Subject: [PATCH 1/2] Deserialize only transfer-asset actions --- NineChronicles.Headless/GraphTypes/StandaloneQuery.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/NineChronicles.Headless/GraphTypes/StandaloneQuery.cs b/NineChronicles.Headless/GraphTypes/StandaloneQuery.cs index 3cfeb63ff..c9ed20236 100644 --- a/NineChronicles.Headless/GraphTypes/StandaloneQuery.cs +++ b/NineChronicles.Headless/GraphTypes/StandaloneQuery.cs @@ -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( From 32efc0ef84239d7f0da4877ad7f6d4fbeadb4c97 Mon Sep 17 00:00:00 2001 From: Yang Chun Ung Date: Thu, 17 Oct 2024 11:51:42 +0900 Subject: [PATCH 2/2] Bump lib9c main --- Lib9c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib9c b/Lib9c index 810b1d86a..af1ed0865 160000 --- a/Lib9c +++ b/Lib9c @@ -1 +1 @@ -Subproject commit 810b1d86a3f11f9780c270671b845bfa7c8bd0a1 +Subproject commit af1ed08655712b90a40a7ebc5fde2dd063cd9cbc