Fix missed pinning

Showed up as unused variables
pull/1260/head
Luke Imhoff 6 years ago
parent 254d6b46a1
commit ef02ae0504
  1. 22
      apps/explorer/test/explorer/validator/metadata_importer_test.exs
  2. 2
      apps/explorer/test/explorer/validator/metadata_retriever_test.exs

@ -14,17 +14,19 @@ defmodule Explorer.Validator.MetadataImporterTest do
test "inserts new address names when there's none for the validators" do
address = insert(:address)
[%{address_hash: address.hash, name: "Testinit Unitorius", primary: true, metadata: %{"test" => "toast"}}]
address_hash = address.hash
[%{address_hash: address_hash, name: "Testinit Unitorius", primary: true, metadata: %{"test" => "toast"}}]
|> MetadataImporter.import_metadata()
address_names =
from(an in Address.Name, where: an.address_hash == ^address.hash and an.primary == true)
from(an in Address.Name, where: an.address_hash == ^address_hash and an.primary == true)
|> Repo.all()
expected_name = %Address.Name{address_hash: address.hash, name: "Testit Unitorus", metadata: %{"test" => "toast"}}
assert length(address_names) == 1
assert expected_name = hd(address_names)
assert %Address.Name{address_hash: ^address_hash, name: "Testinit Unitorius", metadata: %{"test" => "toast"}} =
hd(address_names)
end
test "updates the primary address name if the validator already has one" do
@ -32,17 +34,19 @@ defmodule Explorer.Validator.MetadataImporterTest do
insert(:address_name, address: address, primary: true, name: "Nodealus Faileddi")
[%{address_hash: address.hash, name: "Testit Unitorus", primary: true, metadata: %{"test" => "toast"}}]
address_hash = address.hash
[%{address_hash: address_hash, name: "Testit Unitorus", primary: true, metadata: %{"test" => "toast"}}]
|> MetadataImporter.import_metadata()
address_names =
from(an in Address.Name, where: an.address_hash == ^address.hash and an.primary == true)
|> Repo.all()
expected_name = %Address.Name{address_hash: address.hash, name: "Testit Unitorus", metadata: %{"test" => "toast"}}
assert length(address_names) == 1
assert expected_name = hd(address_names)
assert %Address.Name{address_hash: ^address_hash, name: "Testit Unitorus", metadata: %{"test" => "toast"}} =
hd(address_names)
end
end
end

@ -47,7 +47,7 @@ defmodule Explorer.Validator.MetadataRetrieverTest do
expect(
EthereumJSONRPC.Mox,
:json_rpc,
fn [%{id: id, method: _, params: _}], _options ->
fn [%{id: ^id, method: _, params: _}], _options ->
{:ok,
[
%{

Loading…
Cancel
Save