From be4d4723d0edc5d9254eeb82a714e78dd0b8ea0c Mon Sep 17 00:00:00 2001 From: shaojunda Date: Sat, 30 Dec 2023 13:32:23 +0800 Subject: [PATCH 1/2] fix: nil type --- collector/offchain_input_iterator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/collector/offchain_input_iterator.go b/collector/offchain_input_iterator.go index 2d68c4c1..fe3bc631 100644 --- a/collector/offchain_input_iterator.go +++ b/collector/offchain_input_iterator.go @@ -119,9 +119,10 @@ func (r *OffChainInputIterator) isTransactionInputForSearchKey(transactionInputW if filter.Script != nil { switch searchKey.ScriptType { case "lock": - if !cellOutput.Type.Equals(filter.Script) { + if cellOutput.Type == nil || !cellOutput.Type.Equals(filter.Script) { return false } + break case "type": if !cellOutput.Lock.Equals(filter.Script) { From 6521204ad7c7fbcababf57fa2d998c1b16956c22 Mon Sep 17 00:00:00 2001 From: shaojunda Date: Thu, 4 Jan 2024 10:27:11 +0800 Subject: [PATCH 2/2] chore: adjust test --- indexer/indexer_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indexer/indexer_test.go b/indexer/indexer_test.go index 50b24129..359672b1 100644 --- a/indexer/indexer_test.go +++ b/indexer/indexer_test.go @@ -78,7 +78,7 @@ func TestGetCellsMaxLimit(t *testing.T) { } resp, err := c.GetCells(context.Background(), s, SearchOrderAsc, math.MaxUint32, "") checkError(t, err) - assert.Equal(t, 34, len(resp.Objects)) + assert.Equal(t, 37, len(resp.Objects)) // Check response when `WithData` == true in request s = &SearchKey{