diff --git a/lib/ae_mdw_web/router.ex b/lib/ae_mdw_web/router.ex index 44a18c85f..8fa43e73c 100644 --- a/lib/ae_mdw_web/router.ex +++ b/lib/ae_mdw_web/router.ex @@ -56,6 +56,8 @@ defmodule AeMdwWeb.Router do get "/micro-blocks/:hash", BlockController, :micro_block get "/micro-blocks/:hash/transactions", TxController, :micro_block_txs + get "/transactions/count", TxController, :count + get "/transactions/count/:id", TxController, :count_id get "/transactions", TxController, :txs get "/transactions/:hash", TxController, :tx @@ -93,9 +95,6 @@ defmodule AeMdwWeb.Router do get "/statistics/blocks", StatsController, :blocks_statistics get "/statistics/names", StatsController, :names_statistics - get "/transactions/count", TxController, :count - get "/transactions/count/:id", TxController, :count_id - get "/transfers", TransferController, :transfers get "/contracts/logs", ContractController, :logs get "/contracts/calls", ContractController, :calls diff --git a/test/ae_mdw_web/controllers/tx_controller_test.exs b/test/ae_mdw_web/controllers/tx_controller_test.exs index 202486588..fc5a0c57f 100644 --- a/test/ae_mdw_web/controllers/tx_controller_test.exs +++ b/test/ae_mdw_web/controllers/tx_controller_test.exs @@ -1622,7 +1622,7 @@ defmodule AeMdwWeb.TxControllerTest do assert ^tx_index = conn |> with_store(store) - |> get("/v2/txs/count") + |> get("/v3/transactions/count") |> json_response(200) end @@ -1632,7 +1632,7 @@ defmodule AeMdwWeb.TxControllerTest do assert 101 = conn - |> get("/v2/txs/count", scope: "txi:#{first_txi}-#{last_txi}") + |> get("/v3/transactions/count", scope: "txi:#{first_txi}-#{last_txi}") |> json_response(200) end @@ -1648,7 +1648,7 @@ defmodule AeMdwWeb.TxControllerTest do assert 100 = conn |> with_store(store) - |> get("/v2/txs/count", scope: "gen:#{first_gen}-#{last_gen}") + |> get("/v3/transactions/count", scope: "gen:#{first_gen}-#{last_gen}") |> json_response(200) end @@ -1665,19 +1665,19 @@ defmodule AeMdwWeb.TxControllerTest do assert ^count = conn |> with_store(store) - |> get("/v2/txs/count", type: "oracle_register") + |> get("/v3/transactions/count", type: "oracle_register") |> json_response(200) assert ^count = conn |> with_store(store) - |> get("/v2/txs/count", tx_type: "oracle_register") + |> get("/v3/transactions/count", tx_type: "oracle_register") |> json_response(200) assert 0 = conn |> with_store(store) - |> get("/v2/txs/count", tx_type: "oracle_response") + |> get("/v3/transactions/count", tx_type: "oracle_response") |> json_response(200) end @@ -1694,7 +1694,7 @@ defmodule AeMdwWeb.TxControllerTest do assert ^count = conn |> with_store(store) - |> get("/v2/txs/count", tx_type: "oracle_register") + |> get("/v3/transactions/count", tx_type: "oracle_register") |> json_response(200) end @@ -1717,7 +1717,7 @@ defmodule AeMdwWeb.TxControllerTest do assert 5 = conn |> with_store(store) - |> get("/v2/txs/count", id: account_id, type: "spend") + |> get("/v3/transactions/count", id: account_id, type: "spend") |> json_response(200) end end @@ -1742,7 +1742,7 @@ defmodule AeMdwWeb.TxControllerTest do assert 15 = conn |> with_store(store) - |> get("/v2/txs/count", id: enc_address) + |> get("/v3/transactions/count", id: enc_address) |> json_response(200) end @@ -1767,7 +1767,7 @@ defmodule AeMdwWeb.TxControllerTest do assert 14 = conn |> with_store(store) - |> get("/v2/txs/count", id: enc_address) + |> get("/v3/transactions/count", id: enc_address) |> json_response(200) end @@ -1790,7 +1790,7 @@ defmodule AeMdwWeb.TxControllerTest do assert 5 = conn |> with_store(store) - |> get("/v2/txs/count/#{enc_address}", type: "spend") + |> get("/v3/transactions/count/#{enc_address}", type: "spend") |> json_response(200) end @@ -1823,7 +1823,7 @@ defmodule AeMdwWeb.TxControllerTest do assert 12 = conn |> with_store(store) - |> get("/v2/txs/count/#{enc_address}", type_group: "contract") + |> get("/v3/transactions/count/#{enc_address}", type_group: "contract") |> json_response(200) end @@ -1857,7 +1857,7 @@ defmodule AeMdwWeb.TxControllerTest do assert %{"data" => 3} = conn |> with_store(store) - |> get("/v2/txs/count", mb_hash: encoded_mb_hash) + |> get("/v3/transactions/count", mb_hash: encoded_mb_hash) |> json_response(200) end end @@ -1895,7 +1895,7 @@ defmodule AeMdwWeb.TxControllerTest do assert %{"data" => 2} = conn |> with_store(store) - |> get("/v2/txs/count", mb_hash: encoded_mb_hash, type: "contract_call") + |> get("/v3/transactions/count", mb_hash: encoded_mb_hash, type: "contract_call") |> json_response(200) end end @@ -1923,7 +1923,7 @@ defmodule AeMdwWeb.TxControllerTest do assert %{"error" => ^error_msg} = conn |> with_store(store) - |> get("/v2/txs/count", mb_hash: encoded_mb_hash) + |> get("/v3/transactions/count", mb_hash: encoded_mb_hash) |> json_response(404) end end @@ -1933,7 +1933,7 @@ defmodule AeMdwWeb.TxControllerTest do assert %{"error" => ^error_msg} = conn - |> get("/v2/txs/count", type: "oracle_foo") + |> get("/v3/transactions/count", type: "oracle_foo") |> json_response(400) end @@ -1942,7 +1942,7 @@ defmodule AeMdwWeb.TxControllerTest do assert %{"error" => ^error_msg} = conn - |> get("/v2/txs/count", id: "foo") + |> get("/v3/transactions/count", id: "foo") |> json_response(400) end @@ -1951,7 +1951,7 @@ defmodule AeMdwWeb.TxControllerTest do assert %{"error" => ^error_msg} = conn - |> get("/v2/txs/count/foo", type: "oracle_query") + |> get("/v3/transactions/count/foo", type: "oracle_query") |> json_response(400) end @@ -1960,7 +1960,7 @@ defmodule AeMdwWeb.TxControllerTest do assert %{"error" => ^error_msg} = conn - |> get("/v2/txs/count/foo", type_group: "oracle") + |> get("/v3/transactions/count/foo", type_group: "oracle") |> json_response(400) end @@ -1970,7 +1970,7 @@ defmodule AeMdwWeb.TxControllerTest do assert %{"error" => ^error_msg} = conn - |> get("/v2/txs/count", id: id, scope: "gen:1-2") + |> get("/v3/transactions/count", id: id, scope: "gen:1-2") |> json_response(400) end end