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/explorer/transaction_receipt_test.exs

22 lines
714 B

defmodule Explorer.TransactionReceiptTest do
use Explorer.DataCase
alias Explorer.TransactionReceipt
describe "changeset/2" do
test "accepts valid attributes" do
transaction = insert(:transaction)
params = params_for(:transaction_receipt, transaction: transaction)
changeset = TransactionReceipt.changeset(%TransactionReceipt{}, params)
assert changeset.valid?
end
test "rejects missing attributes" do
transaction = insert(:transaction)
params = params_for(:transaction_receipt, transaction: transaction, cumulative_gas_used: nil)
changeset = TransactionReceipt.changeset(%TransactionReceipt{}, params)
refute changeset.valid?
end
end
end