From c7e835178165fffadb3155c68139397940c9ce4c Mon Sep 17 00:00:00 2001 From: saneery Date: Mon, 22 Jul 2019 15:26:57 +0300 Subject: [PATCH] Return gasPrice at gettxinfo API's method --- apps/block_scout_web/lib/block_scout_web/etherscan.ex | 2 ++ .../lib/block_scout_web/views/api/rpc/transaction_view.ex | 1 + .../controllers/api/rpc/transaction_controller_test.exs | 1 + 3 files changed, 4 insertions(+) diff --git a/apps/block_scout_web/lib/block_scout_web/etherscan.ex b/apps/block_scout_web/lib/block_scout_web/etherscan.ex index 2191a86fa2..73f1967900 100644 --- a/apps/block_scout_web/lib/block_scout_web/etherscan.ex +++ b/apps/block_scout_web/lib/block_scout_web/etherscan.ex @@ -440,6 +440,7 @@ defmodule BlockScoutWeb.Etherscan do "from" => "0x000000000000000000000000000000000000000c", "gasLimit" => "91966", "gasUsed" => "95123", + "gasPrice" => "100000", "hash" => "0x0000000000000000000000000000000000000000000000000000000000000004", "input" => "0x04", "logs" => [ @@ -986,6 +987,7 @@ defmodule BlockScoutWeb.Etherscan do input: @input_type, gasLimit: @wei_type, gasUsed: @gas_type, + gasPrice: @wei_type, logs: %{ type: "array", array_type: @logs_details diff --git a/apps/block_scout_web/lib/block_scout_web/views/api/rpc/transaction_view.ex b/apps/block_scout_web/lib/block_scout_web/views/api/rpc/transaction_view.ex index e792be8f40..b9e8f7430d 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/api/rpc/transaction_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/api/rpc/transaction_view.ex @@ -68,6 +68,7 @@ defmodule BlockScoutWeb.API.RPC.TransactionView do "input" => "#{transaction.input}", "gasLimit" => "#{transaction.gas}", "gasUsed" => "#{transaction.gas_used}", + "gasPrice" => "#{transaction.gas_price.value}", "logs" => Enum.map(logs, &prepare_log/1), "next_page_params" => next_page_params } diff --git a/apps/block_scout_web/test/block_scout_web/controllers/api/rpc/transaction_controller_test.exs b/apps/block_scout_web/test/block_scout_web/controllers/api/rpc/transaction_controller_test.exs index 9d151e382c..1ac026bc3c 100644 --- a/apps/block_scout_web/test/block_scout_web/controllers/api/rpc/transaction_controller_test.exs +++ b/apps/block_scout_web/test/block_scout_web/controllers/api/rpc/transaction_controller_test.exs @@ -456,6 +456,7 @@ defmodule BlockScoutWeb.API.RPC.TransactionControllerTest do "input" => "#{transaction.input}", "gasLimit" => "#{transaction.gas}", "gasUsed" => "#{transaction.gas_used}", + "gasPrice" => "#{transaction.gas_price.value}", "logs" => [ %{ "address" => "#{address.hash}",