diff --git a/apps/explorer_web/assets/js/pages/address.js b/apps/explorer_web/assets/js/pages/address.js index 18988837a7..0f9cce25e6 100644 --- a/apps/explorer_web/assets/js/pages/address.js +++ b/apps/explorer_web/assets/js/pages/address.js @@ -43,13 +43,13 @@ router.when('/addresses/:addressHash').then(({ addressHash, blockNumber, filter msgs = humps.camelizeKeys(msgs) if (filter === 'to') { - msgs = msgs.filter(({toAddressHash})=>toAddressHash===addressHash) + msgs = msgs.filter(({toAddressHash}) => toAddressHash === addressHash) } if (filter === 'from') { - msgs = msgs.filter(({fromAddressHash})=>fromAddressHash===addressHash) + msgs = msgs.filter(({fromAddressHash}) => fromAddressHash === addressHash) } - const transactionsHtml = msgs.map(({transactionHtml})=>transactionHtml).join('') + const transactionsHtml = msgs.map(({transactionHtml}) => transactionHtml).join('') $transactionsList.prepend(transactionsHtml) })) } diff --git a/apps/explorer_web/lib/explorer_web/chain.ex b/apps/explorer_web/lib/explorer_web/chain.ex index efdf24b327..baf595d84b 100644 --- a/apps/explorer_web/lib/explorer_web/chain.ex +++ b/apps/explorer_web/lib/explorer_web/chain.ex @@ -37,6 +37,7 @@ defmodule ExplorerWeb.Chain do end def next_page_params([], _list, _params), do: nil + def next_page_params(_, list, params) do Map.merge(params, paging_params(List.last(list))) end diff --git a/apps/explorer_web/test/explorer_web/controllers/address_internal_transaction_controller_test.exs b/apps/explorer_web/test/explorer_web/controllers/address_internal_transaction_controller_test.exs index cf0fed65fc..36243100f3 100644 --- a/apps/explorer_web/test/explorer_web/controllers/address_internal_transaction_controller_test.exs +++ b/apps/explorer_web/test/explorer_web/controllers/address_internal_transaction_controller_test.exs @@ -154,7 +154,8 @@ defmodule ExplorerWeb.AddressInternalTransactionControllerTest do conn = get(conn, address_internal_transaction_path(ExplorerWeb.Endpoint, :index, :en, address.hash)) - assert %{block_number: ^number, index: 11, transaction_index: ^transaction_index} = conn.assigns.next_page_params + assert %{"block_number" => ^number, "index" => 11, "transaction_index" => ^transaction_index} = + conn.assigns.next_page_params end test "next_page_params are empty if on last page", %{conn: conn} do diff --git a/apps/explorer_web/test/explorer_web/controllers/address_transaction_controller_test.exs b/apps/explorer_web/test/explorer_web/controllers/address_transaction_controller_test.exs index 12c8f20d67..2eb7253331 100644 --- a/apps/explorer_web/test/explorer_web/controllers/address_transaction_controller_test.exs +++ b/apps/explorer_web/test/explorer_web/controllers/address_transaction_controller_test.exs @@ -105,7 +105,7 @@ defmodule ExplorerWeb.AddressTransactionControllerTest do conn = get(conn, address_transaction_path(ExplorerWeb.Endpoint, :index, :en, address.hash)) - assert %{block_number: ^number, index: 10} = conn.assigns.next_page_params + assert %{"block_number" => ^number, "index" => 10} = conn.assigns.next_page_params end test "next_page_params are empty if on last page", %{conn: conn} do diff --git a/apps/explorer_web/test/explorer_web/controllers/block_controller_test.exs b/apps/explorer_web/test/explorer_web/controllers/block_controller_test.exs index 8f0412239a..b675622ae7 100644 --- a/apps/explorer_web/test/explorer_web/controllers/block_controller_test.exs +++ b/apps/explorer_web/test/explorer_web/controllers/block_controller_test.exs @@ -66,7 +66,7 @@ defmodule ExplorerWeb.BlockControllerTest do conn = get(conn, block_path(conn, :index, @locale)) - assert %{block_number: ^number} = conn.assigns.next_page_params + assert %{"block_number" => ^number} = conn.assigns.next_page_params end test "next_page_params are empty if on last page", %{conn: conn} do diff --git a/apps/explorer_web/test/explorer_web/controllers/block_transaction_controller_test.exs b/apps/explorer_web/test/explorer_web/controllers/block_transaction_controller_test.exs index c0bcbd1b8c..82ac1ff261 100644 --- a/apps/explorer_web/test/explorer_web/controllers/block_transaction_controller_test.exs +++ b/apps/explorer_web/test/explorer_web/controllers/block_transaction_controller_test.exs @@ -58,7 +58,7 @@ defmodule ExplorerWeb.BlockTransactionControllerTest do conn = get(conn, block_transaction_path(ExplorerWeb.Endpoint, :index, :en, block)) - assert %{block_number: ^number, index: 10} = conn.assigns.next_page_params + assert %{"block_number" => ^number, "index" => 10} = conn.assigns.next_page_params end test "next_page_params are empty if on last page", %{conn: conn} do diff --git a/apps/explorer_web/test/explorer_web/controllers/pending_transaction_controller_test.exs b/apps/explorer_web/test/explorer_web/controllers/pending_transaction_controller_test.exs index 097b2d33f7..5d1f7a8e7d 100644 --- a/apps/explorer_web/test/explorer_web/controllers/pending_transaction_controller_test.exs +++ b/apps/explorer_web/test/explorer_web/controllers/pending_transaction_controller_test.exs @@ -87,7 +87,7 @@ defmodule ExplorerWeb.PendingTransactionControllerTest do conn = get(conn, pending_transaction_path(ExplorerWeb.Endpoint, :index, :en)) - assert %{inserted_at: ^converted_date, hash: ^hash} = conn.assigns.next_page_params + assert %{"inserted_at" => ^converted_date, "hash" => ^hash} = conn.assigns.next_page_params end test "next_page_params are empty if on last page", %{conn: conn} do diff --git a/apps/explorer_web/test/explorer_web/controllers/transaction_controller_test.exs b/apps/explorer_web/test/explorer_web/controllers/transaction_controller_test.exs index b978114a1a..0dbdb8ea50 100644 --- a/apps/explorer_web/test/explorer_web/controllers/transaction_controller_test.exs +++ b/apps/explorer_web/test/explorer_web/controllers/transaction_controller_test.exs @@ -75,7 +75,7 @@ defmodule ExplorerWeb.TransactionControllerTest do conn = get(conn, "/en/transactions") - assert %{block_number: ^number, index: 10} = conn.assigns.next_page_params + assert %{"block_number" => ^number, "index" => 10} = conn.assigns.next_page_params end test "next_page_params are empty if on last page", %{conn: conn} do diff --git a/apps/explorer_web/test/explorer_web/controllers/transaction_internal_transaction_controller_test.exs b/apps/explorer_web/test/explorer_web/controllers/transaction_internal_transaction_controller_test.exs index 4d80858d41..a1444ed2f8 100644 --- a/apps/explorer_web/test/explorer_web/controllers/transaction_internal_transaction_controller_test.exs +++ b/apps/explorer_web/test/explorer_web/controllers/transaction_internal_transaction_controller_test.exs @@ -128,7 +128,8 @@ defmodule ExplorerWeb.TransactionInternalTransactionControllerTest do conn = get(conn, transaction_internal_transaction_path(ExplorerWeb.Endpoint, :index, :en, transaction.hash)) - assert %{block_number: ^number, index: 11, transaction_index: ^transaction_index} = conn.assigns.next_page_params + assert %{"block_number" => ^number, "index" => 11, "transaction_index" => ^transaction_index} = + conn.assigns.next_page_params end test "next_page_params are empty if on last page", %{conn: conn} do diff --git a/apps/explorer_web/test/explorer_web/controllers/transaction_log_controller_test.exs b/apps/explorer_web/test/explorer_web/controllers/transaction_log_controller_test.exs index fa17e9a7a1..683197bd28 100644 --- a/apps/explorer_web/test/explorer_web/controllers/transaction_log_controller_test.exs +++ b/apps/explorer_web/test/explorer_web/controllers/transaction_log_controller_test.exs @@ -97,7 +97,7 @@ defmodule ExplorerWeb.TransactionLogControllerTest do conn = get(conn, transaction_log_path(conn, :index, :en, transaction)) - assert %{index: 50} = conn.assigns.next_page_params + assert %{"index" => 50} = conn.assigns.next_page_params end test "next_page_params are empty if on last page", %{conn: conn} do