Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add test for 64_000 txs block hash #1729

Merged
merged 2 commits into from
Sep 9, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions apps/omg/test/omg/block_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,23 @@ defmodule OMG.BlockTest do
}
end

@tag fixtures: [:stable_alice, :stable_bob]
test "correctly calculates hash for a lot of transactions", %{
stable_alice: alice,
stable_bob: bob
} do
transactions =
Enum.map(1..64_000, fn index ->
TestHelper.create_recovered([{1, index, index, alice}], eth(), [{bob, 100}])
end)

block = Block.hashed_txs_at(transactions, 10)

assert block.hash ==
<<12, 40, 202, 7, 16, 175, 119, 138, 7, 95, 8, 3, 148, 93, 162, 168, 136, 226, 196, 236, 83, 62, 220, 75,
59, 52, 6, 18, 249, 52, 124, 228>>
end

test "handles an empty list of transactions" do
assert Block.hashed_txs_at([], 10) == %Block{
hash:
Expand Down