Skip to content

Commit

Permalink
test: fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Miles Zhang <mingchang555@hotmail.com>
  • Loading branch information
zmcNotafraid committed Sep 5, 2024
1 parent 11d74a5 commit c728b57
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/models/ckb_sync/node_data_processor_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ class NodeDataProcessorTest < ActiveSupport::TestCase
),
)
VCR.use_cassette("blocks/11") do
timestamp = Time.now.to_i * 1000
tx = create(:pending_transaction,
tx_hash: "0x4298daf91148df9093c844d2ae7d16bee6b74e7ab1ccccd108ce834d1ca1a56c")
tx_hash: "0x4298daf91148df9093c844d2ae7d16bee6b74e7ab1ccccd108ce834d1ca1a56c", confirmation_time: timestamp)
node_block = CkbSync::Api.instance.get_block_by_number(11)
create(:block, :with_block_hash, number: node_block.header.number - 1)
node_block.transactions.first.hash = tx.tx_hash
Expand All @@ -159,7 +160,7 @@ class NodeDataProcessorTest < ActiveSupport::TestCase
node_data_processor.process_block(node_block)
end
assert_equal tx.reload.confirmation_time,
tx.reload.block_timestamp.to_i / 1000 - tx.created_at.to_i
(tx.reload.block_timestamp.to_i - timestamp) / 1000
end
end

Expand Down

0 comments on commit c728b57

Please sign in to comment.