Fix the tests

pull/376/head
Ryan Arthur 6 years ago committed by Stamates
parent 62e5c96943
commit 48ed461c88
  1. 166
      apps/explorer/package-lock.json
  2. 10
      apps/explorer_web/assets/css/components/_tile.scss
  3. 21
      apps/explorer_web/lib/explorer_web/templates/address/_link.html.eex
  4. 2
      apps/explorer_web/lib/explorer_web/templates/address/overview.html.eex
  5. 4
      apps/explorer_web/lib/explorer_web/templates/address_internal_transaction/_internal_transaction.html.eex
  6. 2
      apps/explorer_web/lib/explorer_web/templates/address_internal_transaction/index.html.eex
  7. 2
      apps/explorer_web/lib/explorer_web/templates/address_transaction/_transaction.html.eex
  8. 42
      apps/explorer_web/lib/explorer_web/templates/address_transaction/index.html.eex
  9. 2
      apps/explorer_web/test/explorer_web/features/pages/address_page.ex
  10. 10
      apps/explorer_web/test/explorer_web/features/viewing_addresses_test.exs

@ -18,7 +18,7 @@
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"requires": {
"balanced-match": "^1.0.0",
"balanced-match": "1.0.0",
"concat-map": "0.0.1"
}
},
@ -37,9 +37,9 @@
"resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
"integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
"requires": {
"string-width": "^1.0.1",
"strip-ansi": "^3.0.1",
"wrap-ansi": "^2.0.0"
"string-width": "1.0.2",
"strip-ansi": "3.0.1",
"wrap-ansi": "2.1.0"
}
},
"code-point-at": {
@ -62,7 +62,7 @@
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"requires": {
"is-arrayish": "^0.2.1"
"is-arrayish": "0.2.1"
}
},
"find-up": {
@ -70,8 +70,8 @@
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
"integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
"requires": {
"path-exists": "^2.0.0",
"pinkie-promise": "^2.0.0"
"path-exists": "2.1.0",
"pinkie-promise": "2.0.1"
}
},
"fs-extra": {
@ -79,11 +79,11 @@
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz",
"integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=",
"requires": {
"graceful-fs": "^4.1.2",
"jsonfile": "^2.1.0",
"klaw": "^1.0.0",
"path-is-absolute": "^1.0.0",
"rimraf": "^2.2.8"
"graceful-fs": "4.1.11",
"jsonfile": "2.4.0",
"klaw": "1.3.1",
"path-is-absolute": "1.0.1",
"rimraf": "2.6.2"
}
},
"fs.realpath": {
@ -101,12 +101,12 @@
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
}
},
"graceful-fs": {
@ -124,8 +124,8 @@
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"requires": {
"once": "^1.3.0",
"wrappy": "1"
"once": "1.4.0",
"wrappy": "1.0.2"
}
},
"inherits": {
@ -148,7 +148,7 @@
"resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
"integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
"requires": {
"builtin-modules": "^1.0.0"
"builtin-modules": "1.1.1"
}
},
"is-fullwidth-code-point": {
@ -156,7 +156,7 @@
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"requires": {
"number-is-nan": "^1.0.0"
"number-is-nan": "1.0.1"
}
},
"is-utf8": {
@ -169,7 +169,7 @@
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
"integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=",
"requires": {
"graceful-fs": "^4.1.6"
"graceful-fs": "4.1.11"
}
},
"klaw": {
@ -177,7 +177,7 @@
"resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz",
"integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=",
"requires": {
"graceful-fs": "^4.1.9"
"graceful-fs": "4.1.11"
}
},
"lcid": {
@ -185,7 +185,7 @@
"resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
"integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
"requires": {
"invert-kv": "^1.0.0"
"invert-kv": "1.0.0"
}
},
"load-json-file": {
@ -193,11 +193,11 @@
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
"integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
"requires": {
"graceful-fs": "^4.1.2",
"parse-json": "^2.2.0",
"pify": "^2.0.0",
"pinkie-promise": "^2.0.0",
"strip-bom": "^2.0.0"
"graceful-fs": "4.1.11",
"parse-json": "2.2.0",
"pify": "2.3.0",
"pinkie-promise": "2.0.1",
"strip-bom": "2.0.0"
}
},
"lodash.assign": {
@ -215,7 +215,7 @@
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"requires": {
"brace-expansion": "^1.1.7"
"brace-expansion": "1.1.11"
}
},
"normalize-package-data": {
@ -223,10 +223,10 @@
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
"integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==",
"requires": {
"hosted-git-info": "^2.1.4",
"is-builtin-module": "^1.0.0",
"semver": "2 || 3 || 4 || 5",
"validate-npm-package-license": "^3.0.1"
"hosted-git-info": "2.6.1",
"is-builtin-module": "1.0.0",
"semver": "5.5.0",
"validate-npm-package-license": "3.0.3"
}
},
"number-is-nan": {
@ -239,7 +239,7 @@
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"requires": {
"wrappy": "1"
"wrappy": "1.0.2"
}
},
"os-locale": {
@ -247,7 +247,7 @@
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
"integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
"requires": {
"lcid": "^1.0.0"
"lcid": "1.0.0"
}
},
"parse-json": {
@ -255,7 +255,7 @@
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
"integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
"requires": {
"error-ex": "^1.2.0"
"error-ex": "1.3.2"
}
},
"path-exists": {
@ -263,7 +263,7 @@
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
"integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
"requires": {
"pinkie-promise": "^2.0.0"
"pinkie-promise": "2.0.1"
}
},
"path-is-absolute": {
@ -276,9 +276,9 @@
"resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
"integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
"requires": {
"graceful-fs": "^4.1.2",
"pify": "^2.0.0",
"pinkie-promise": "^2.0.0"
"graceful-fs": "4.1.11",
"pify": "2.3.0",
"pinkie-promise": "2.0.1"
}
},
"pify": {
@ -296,7 +296,7 @@
"resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
"integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
"requires": {
"pinkie": "^2.0.0"
"pinkie": "2.0.4"
}
},
"read-pkg": {
@ -304,9 +304,9 @@
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
"integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
"requires": {
"load-json-file": "^1.0.0",
"normalize-package-data": "^2.3.2",
"path-type": "^1.0.0"
"load-json-file": "1.1.0",
"normalize-package-data": "2.4.0",
"path-type": "1.1.0"
}
},
"read-pkg-up": {
@ -314,8 +314,8 @@
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
"integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
"requires": {
"find-up": "^1.0.0",
"read-pkg": "^1.0.0"
"find-up": "1.1.2",
"read-pkg": "1.1.0"
}
},
"require-directory": {
@ -338,7 +338,7 @@
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
"integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
"requires": {
"glob": "^7.0.5"
"glob": "7.1.2"
}
},
"semver": {
@ -356,11 +356,11 @@
"resolved": "https://registry.npmjs.org/solc-js/-/solc-js-0.4.20.tgz",
"integrity": "sha1-tjCVsPcatkx6fi+C7YUtCzUxTlg=",
"requires": {
"fs-extra": "^0.30.0",
"memorystream": "^0.3.1",
"require-from-string": "^1.1.0",
"semver": "^5.3.0",
"yargs": "^4.7.1"
"fs-extra": "0.30.0",
"memorystream": "0.3.1",
"require-from-string": "1.2.1",
"semver": "5.5.0",
"yargs": "4.8.1"
}
},
"spdx-correct": {
@ -368,8 +368,8 @@
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz",
"integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==",
"requires": {
"spdx-expression-parse": "^3.0.0",
"spdx-license-ids": "^3.0.0"
"spdx-expression-parse": "3.0.0",
"spdx-license-ids": "3.0.0"
}
},
"spdx-exceptions": {
@ -382,8 +382,8 @@
"resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz",
"integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
"requires": {
"spdx-exceptions": "^2.1.0",
"spdx-license-ids": "^3.0.0"
"spdx-exceptions": "2.1.0",
"spdx-license-ids": "3.0.0"
}
},
"spdx-license-ids": {
@ -396,9 +396,9 @@
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
"strip-ansi": "^3.0.0"
"code-point-at": "1.1.0",
"is-fullwidth-code-point": "1.0.0",
"strip-ansi": "3.0.1"
}
},
"strip-ansi": {
@ -406,7 +406,7 @@
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"requires": {
"ansi-regex": "^2.0.0"
"ansi-regex": "2.1.1"
}
},
"strip-bom": {
@ -414,7 +414,7 @@
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
"integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
"requires": {
"is-utf8": "^0.2.0"
"is-utf8": "0.2.1"
}
},
"validate-npm-package-license": {
@ -422,8 +422,8 @@
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz",
"integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==",
"requires": {
"spdx-correct": "^3.0.0",
"spdx-expression-parse": "^3.0.0"
"spdx-correct": "3.0.0",
"spdx-expression-parse": "3.0.0"
}
},
"which-module": {
@ -441,8 +441,8 @@
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
"integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
"requires": {
"string-width": "^1.0.1",
"strip-ansi": "^3.0.1"
"string-width": "1.0.2",
"strip-ansi": "3.0.1"
}
},
"wrappy": {
@ -460,20 +460,20 @@
"resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz",
"integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=",
"requires": {
"cliui": "^3.2.0",
"decamelize": "^1.1.1",
"get-caller-file": "^1.0.1",
"lodash.assign": "^4.0.3",
"os-locale": "^1.4.0",
"read-pkg-up": "^1.0.1",
"require-directory": "^2.1.1",
"require-main-filename": "^1.0.1",
"set-blocking": "^2.0.0",
"string-width": "^1.0.1",
"which-module": "^1.0.0",
"window-size": "^0.2.0",
"y18n": "^3.2.1",
"yargs-parser": "^2.4.1"
"cliui": "3.2.0",
"decamelize": "1.2.0",
"get-caller-file": "1.0.2",
"lodash.assign": "4.2.0",
"os-locale": "1.4.0",
"read-pkg-up": "1.0.1",
"require-directory": "2.1.1",
"require-main-filename": "1.0.1",
"set-blocking": "2.0.0",
"string-width": "1.0.2",
"which-module": "1.0.0",
"window-size": "0.2.0",
"y18n": "3.2.1",
"yargs-parser": "2.4.1"
}
},
"yargs-parser": {
@ -481,8 +481,8 @@
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz",
"integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=",
"requires": {
"camelcase": "^3.0.0",
"lodash.assign": "^4.0.6"
"camelcase": "3.0.0",
"lodash.assign": "4.2.0"
}
}
}

@ -22,7 +22,7 @@
&-transaction {
border-left: 4px solid $blue;
.tile-label {
.tile-label, .tile-text-highlight {
color: $blue;
}
}
@ -30,7 +30,7 @@
&-contract {
border-left: 4px solid $green;
.tile-label {
.tile-label, .tile-text-highlight {
color: $green;
}
}
@ -38,7 +38,7 @@
&-contract-creation {
border-left: 4px solid $pink;
.tile-label {
.tile-label, .tile-text-highlight {
color: $pink;
}
}
@ -46,7 +46,7 @@
&-token {
border-left: 4px solid $orange;
.tile-label {
.tile-label, .tile-text-highlight {
color: $orange;
}
}
@ -54,7 +54,7 @@
&-internal-transaction {
border-left: 4px solid $teal;
.tile-label {
.tile-label, .tile-text-highlight {
color: $teal;
}
}

@ -1,11 +1,18 @@
<%= if @address_hash do %>
<%= link to: address_path(ExplorerWeb.Endpoint, :show, @locale, @address_hash), "data-address-hash": @address_hash do %>
<%= if @contract do %>
<span class="tile-text-highlight d-none d-md-none d-lg-inline"><%= @address_hash %></span>
<span class="tile-text-highlight d-md-block d-lg-none "><%= @address_hash |> to_string() |> String.slice(0..5) %>&ndash;<%= @address_hash |> to_string() |> String.slice(-6..-1) %></span>
<%= cond do %>
<% @address -> %>
<%= link to: address_path(ExplorerWeb.Endpoint, :show, @locale, @address), "data-address-hash": @address do %>
<%= if contract?(@address) do %>
<span class="tile-text-highlight d-none d-md-none d-lg-inline"><%= @address %></span>
<span class="tile-text-highlight d-md-block d-lg-none "><%= @address |> hash() |> String.slice(0..5) %>&ndash;<%= @address |> hash() |> String.slice(-6..-1) %></span>
<% else %>
<span class="d-none d-md-none d-lg-inline"> <%= @address_hash %></span>
<span class="d-lg-none"><%= @address_hash |> to_string() |> String.slice(0..5) %>&ndash;<%= @address_hash |> to_string() |> String.slice(-6..-1) %></span>
<span class="d-none d-md-none d-lg-inline"> <%= @address %></span>
<span class="d-lg-none"><%= @address |> hash() |> String.slice(0..5) %>&ndash;<%= @address |> hash() |> String.slice(-6..-1) %></span>
<% end %>
<% end %>
<% @address_hash -> %>
<%= link to: address_path(ExplorerWeb.Endpoint, :show, @locale, @address_hash), "data-address-hash": @address_hash do %>
<span class="tile-text-highlight d-none d-md-none d-lg-inline"><%= @address_hash %></span>
<span class="tile-text-highlight d-lg-none"><%= @address_hash |> to_string() |> String.slice(0..5) %>&ndash;<%= @address_hash |> to_string() |> String.slice(-6..-1) %></span>
<% end %>
<% true -> %>
<% end %>

@ -29,7 +29,7 @@
<h2 class="card-title text-white">Balance</h2>
<span></span>
<div class="text-right">
<h3 class="text-white"><%= balance(@address) %></h3>
<h3 class="text-white" data-test="address_balance"><%= balance(@address) %></h3>
<span class="text-light"><%= formatted_usd(@address, @exchange_rate) %></span>
</div>
</div>

@ -1,4 +1,4 @@
<div class="tile tile-type-internal-transaction fade-in">
<div class="tile tile-type-internal-transaction fade-in" data-test="internal_transaction">
<div class="row">
<div class="col-md-2 d-flex align-items-center justify-content-start justify-content-lg-center tile-label">
<%= gettext("Internal Transaction") %>
@ -8,7 +8,7 @@
<span>
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, address: @internal_transaction.from_address %>
&rarr;
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, address: @internal_transaction.to_address %>
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, address: @internal_transaction.to_address, address_hash: nil %>
</span>
<%= ExplorerWeb.TransactionView.value(@internal_transaction, include_label: false) %> POA
</div>

@ -116,7 +116,7 @@
<% end %>
<% else %>
<div class="tile tile-muted text-center">
<span><%= gettext "There are no Internal Transactions" %></span>
<span><%= gettext "There are no internal transactions for this address." %></span>
</div>
<% end %>
</div>

@ -1,4 +1,4 @@
<div class="tile <%= ExplorerWeb.TransactionView.tile_class(@transaction) %> fade-in">
<div class="tile tile-type-<%= ExplorerWeb.TransactionView.type_suffix(@transaction) %> fade-in">
<div class="row">
<div class="col-md-2 d-flex align-items-center justify-content-start justify-content-lg-center tile-label">
<%= ExplorerWeb.TransactionView.transaction_display_type(@transaction) %>

@ -120,51 +120,15 @@
</div>
</div>
<%= if Enum.count(@transactions) > 0 do %>
<div class="dropdown float-right u-push-sm">
<button data-test="filter_dropdown" class="button button--secondary button--xsmall dropdown-toggle" type="button"
id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Filter: <%= format_current_filter(@filter) %>
</button>
<div class="dropdown-menu dropdown-menu-right filter" aria-labelledby="dropdownMenu2">
<%= link(
gettext("All"),
to: address_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["address_id"]),
class: "address__link address__link--active dropdown-item",
"data-test": "filter_option"
) %>
<%= link(
gettext("To"),
to: address_transaction_path(
@conn,
:index,
@conn.assigns.locale,
@conn.params["address_id"],
filter: "to"
),
class: "address__link address__link--active dropdown-item",
"data-test": "filter_option"
) %>
<%= link(
gettext("From"),
to: address_transaction_path(
@conn,
:index,
@conn.assigns.locale,
@conn.params["address_id"],
filter: "from"
),
class: "address__link address__link--active dropdown-item",
"data-test": "filter_option"
) %>
</div>
</div>
<h2 class="card-title"><%= gettext "Transactions" %></h2>
<span data-selector="transactions-list">
<%= for transaction <- @transactions do %>
<%= render "_transaction.html", locale: @locale, address: @address, transaction: transaction %>
<% end %>
</span>
<% else %>
<div class="tile tile-muted text-center">
<span data-selector="empty-transactions-list"><%= gettext "There are no Internal Transactions" %></span>
<span data-selector="empty-transactions-list"><%= gettext "There are no transactions for this address." %></span>
</div>
<% end %>
</div>

@ -20,7 +20,7 @@ defmodule ExplorerWeb.AddressPage do
end
def contract_creation(%InternalTransaction{created_contract_address_hash: hash}) do
css("[data-address-hash='#{hash}']", text: "Contract Creation")
css("[data-address-hash='#{hash}']", text: to_string(hash))
end
def detail_hash(%Address{hash: address_hash}) do

@ -2,14 +2,15 @@ defmodule ExplorerWeb.ViewingAddressesTest do
use ExplorerWeb.FeatureCase, async: true
alias Explorer.Chain
alias Explorer.Chain.Address
alias Explorer.Chain.{Address, Wei}
alias Explorer.ExchangeRates.Token
alias ExplorerWeb.{AddressPage, HomePage}
setup do
block = insert(:block)
lincoln = insert(:address)
{:ok, balance} = Wei.cast(5)
lincoln = insert(:address, fetched_balance: balance)
taft = insert(:address)
from_taft =
@ -162,7 +163,10 @@ defmodule ExplorerWeb.ViewingAddressesTest do
|> with_block()
|> Repo.preload([:block, :from_address, :to_address])
ExplorerWeb.Endpoint.broadcast!("addresses:#{addresses.lincoln.hash}", "transaction", %{transaction: transaction})
ExplorerWeb.Endpoint.broadcast!("addresses:#{addresses.lincoln.hash}", "transaction", %{
address: addresses.lincoln,
transaction: transaction
})
assert_has(session, AddressPage.transaction(transaction))
end

Loading…
Cancel
Save