Skip to content

Commit

Permalink
refactor: speed up finalizes current forming block and inserts new on…
Browse files Browse the repository at this point in the history
…e if transaction limit for a block is reached test
  • Loading branch information
pgebal committed Oct 9, 2020
1 parent d3c7567 commit c23be95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/engine/test/engine/callbacks/deposit_test.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Engine.Callbacks.DepositTest do
@moduledoc false

use Engine.DB.DataCase, async: true
use Engine.DB.DataCase, async: false

alias Engine.Callbacks.Deposit
alias Engine.DB.ListenerState
Expand Down
5 changes: 2 additions & 3 deletions apps/engine/test/engine/db/transaction_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,11 @@ defmodule Engine.DB.TransactionTest do
assert expected_position == actual_positions
end

@tag timeout: :infinity
@tag :integration
test "finalizes current forming block and inserts new one if transaction limit for a block is reached" do
block = insert(:block)

_ = Enum.map(1..@max_txcount, fn index -> insert(:payment_v1_transaction, %{block: block, tx_index: index}) end)
# we determine number of transactions in a block by querying for max transaction index in the block
_ = insert(:payment_v1_transaction, %{block: block, tx_index: @max_txcount})

tx_bytes = transaction_bytes()
{:ok, %{transaction: transaction}} = Transaction.insert(tx_bytes)
Expand Down

0 comments on commit c23be95

Please sign in to comment.