@@ -1098,15 +1098,28 @@ class NodeDataProcessorTest < ActiveSupport::TestCase
10981098
10991099 test "#process_block should fill all cell input's previous cell output id without cellbase's cell input" do
11001100 VCR . use_cassette ( "blocks/#{ DEFAULT_NODE_BLOCK_NUMBER } " ) do
1101+ redis_cache_store = ActiveSupport ::Cache . lookup_store ( :redis_cache_store )
1102+ Rails . stubs ( :cache ) . returns ( redis_cache_store )
1103+ Rails . cache . extend ( CacheRealizer )
11011104 node_block = fake_node_block ( "0x3307186493c5da8b91917924253a5ffd35231151649d0c7e2941aa8801815063" )
11021105 block = create ( :block , :with_block_hash )
11031106 ckb_transaction1 = create ( :ckb_transaction , tx_hash : "0x498315db9c7ba144cca74d2e9122ac9b3a3da1641b2975ae321d91ec34f1c0e3" , block : block )
11041107 ckb_transaction2 = create ( :ckb_transaction , tx_hash : "0x598315db9c7ba144cca74d2e9122ac9b3a3da1641b2975ae321d91ec34f1c0e3" , block : block )
11051108 create ( :cell_output , ckb_transaction : ckb_transaction1 , cell_index : 1 , tx_hash : "0x498315db9c7ba144cca74d2e9122ac9b3a3da1641b2975ae321d91ec34f1c0e3" , generated_by : ckb_transaction2 , block : block )
11061109 create ( :cell_output , ckb_transaction : ckb_transaction2 , cell_index : 2 , tx_hash : "0x598315db9c7ba144cca74d2e9122ac9b3a3da1641b2975ae321d91ec34f1c0e3" , generated_by : ckb_transaction1 , block : block )
1107- local_block = node_data_processor . process_block ( node_block )
1110+ cell_outputs = CellOutput . all
1111+ cell_outputs . each do |cell_output |
1112+ tx = cell_output . ckb_transaction
1113+ tx . display_outputs
1114+ assert_not_nil Rails . cache . realize ( "normal_tx_display_outputs_previews_false_#{ tx . id } " )
1115+ end
11081116
1117+ local_block = node_data_processor . process_block ( node_block )
11091118 assert_empty local_block . cell_inputs . where ( from_cell_base : false , previous_cell_output_id : nil )
1119+ cell_outputs . each do |cell_output |
1120+ tx = cell_output . ckb_transaction
1121+ assert_nil Rails . cache . realize ( "normal_tx_display_outputs_previews_false_#{ tx . id } " )
1122+ end
11101123 end
11111124 end
11121125
0 commit comments