Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
blockscout/test/support/factories/block_factory.ex

21 lines
607 B

defmodule Explorer.BlockFactory do
defmacro __using__(_opts) do
quote do
def block_factory do
%Explorer.Block{
number: sequence(""),
hash: sequence("0x"),
parent_hash: sequence("0x"),
nonce: sequence(""),
miner: sequence("0x"),
difficulty: Enum.random(1..100_000),
total_difficulty: Enum.random(1..100_000),
size: Enum.random(1..100_000),
gas_limit: Enum.random(1..100_000),
gas_used: Enum.random(1..100_000),
timestamp: DateTime.utc_now,
}
end
end
end
end