Display the last five Transactions on the homepage.

pull/2/head
CJ Bryan and Matt Olenick 7 years ago
parent b5644efc8b
commit b39bc5d25f
  1. 1
      assets/css/components/_all.scss
  2. 9
      assets/css/components/_transactions.scss
  3. 1
      lib/explorer/block.ex
  4. 16
      lib/explorer/fetcher.ex
  5. 3
      lib/explorer/transaction.ex
  6. 10
      lib/explorer_web/controllers/page_controller.ex
  7. 24
      lib/explorer_web/templates/page/index.html.eex
  8. 14
      priv/gettext/default.pot
  9. 14
      priv/gettext/en/LC_MESSAGES/default.po
  10. 9
      priv/repo/migrations/20180124003303_add_value_to_transactions.exs
  11. 143
      test/explorer/fetcher_test.exs
  12. 4
      test/explorer/transaction_test.exs
  13. 22
      test/explorer_web/controllers/page_controller_test.exs
  14. 12
      test/explorer_web/features/contributor_browsing_test.exs
  15. 13
      test/support/factories/transaction_factory.ex
  16. 1
      test/support/factory.ex
  17. 30
      test/support/fixture/vcr_cassettes/fetcher_fetch_with_a_zero_value_transaction.json
  18. 30
      test/support/fixture/vcr_cassettes/fetcher_fetch_with_transaction.json
  19. 30
      test/support/fixture/vcr_cassettes/fetcher_validate_block.json

@ -1,2 +1,3 @@
@import "blocks";
@import "header";
@import "transactions";

@ -0,0 +1,9 @@
.transactions {
&__title {
@extend h2;
}
&__table {
@extend .table;
}
}

@ -33,6 +33,7 @@ defmodule Explorer.Block do
def changeset(%Block{} = block, attrs) do
block
|> cast(attrs, @required_attrs, @optional_attrs)
|> cast_assoc(:transactions)
|> validate_required(@required_attrs)
|> update_change(:hash, &String.downcase/1)
|> unique_constraint(:hash)

@ -31,11 +31,23 @@ defmodule Explorer.Fetcher do
size: block["size"] |> decode_integer_field,
gas_limit: block["gasLimit"] |> decode_integer_field,
nonce: block["nonce"] || "0",
transactions: block["transactions"] |> extract_transactions,
}
end
def validate_block(attrs) do
Block.changeset(%Block{}, attrs)
def extract_transactions(transactions) do
transactions |> Enum.map(&extract_transaction/1)
end
def extract_transaction(transaction) do
%{
hash: transaction["hash"],
value: transaction["value"] |> decode_integer_field,
}
end
def validate_block(block) do
Block.changeset(%Block{}, block)
end
def decode_integer_field(hex) do

@ -10,12 +10,13 @@ defmodule Explorer.Transaction do
schema "transactions" do
field :hash, :string
field :value, :decimal
timestamps()
belongs_to :block, Explorer.Block
end
@required_attrs ~w(hash)a
@required_attrs ~w(hash value)a
@optional_attrs ~w()a
@doc false

@ -2,6 +2,7 @@ defmodule ExplorerWeb.PageController do
use ExplorerWeb, :controller
import Ecto.Query
alias Explorer.Block
alias Explorer.Transaction
alias Explorer.Repo
def index(conn, _params) do
@ -10,6 +11,13 @@ defmodule ExplorerWeb.PageController do
|> limit(5)
|> Repo.all
render(conn, "index.html", blocks: blocks)
transactions = Transaction
|> join(:left, [t, b], b in assoc(t, :block))
|> order_by([t, b], desc: b.timestamp)
|> limit(5)
|> Repo.all
|> Repo.preload(:block)
render(conn, "index.html", blocks: blocks, transactions: transactions)
end
end

@ -21,3 +21,27 @@
</tbody>
</table>
</div>
<div class="transactions">
<div class="transactions__title"><%= gettext "Transactions" %></div>
<table class="transactions__table">
<thead class="transactions__header">
<tr>
<th><%= gettext "Hash" %></th>
<th><%= gettext "Block" %></th>
<th><%= gettext "Age" %></th>
<th><%= gettext "Value" %></th>
</tr>
</thead>
<tbody>
<%= for transaction <- @transactions do %>
<tr class="transactions__row">
<td class="transactions__column--hash"><%= transaction.hash %></td>
<td class="transactions__column--block"><%= transaction.block.number %></td>
<td class="transactions__column--age"><%= transaction.block.timestamp |> Timex.from_now %></td>
<td class="transactions__column--value"><%= transaction.value %></td>
</tr>
<% end %>
</tbody>
</table>
</div>

@ -23,7 +23,7 @@ msgstr ""
msgid "blocks-title"
msgstr ""
#: lib/explorer_web/templates/page/index.html.eex:9
#: lib/explorer_web/templates/page/index.html.eex:10
msgid "Gas Used"
msgstr ""
@ -34,3 +34,15 @@ msgstr ""
#: lib/explorer_web/templates/page/index.html.eex:10
msgid "Validated"
msgstr ""
#: lib/explorer_web/templates/page/index.html.eex:9
msgid "Age"
msgstr ""
#: lib/explorer_web/templates/page/index.html.eex:30
msgid "Hash"
msgstr ""
#: lib/explorer_web/templates/page/index.html.eex:26
msgid "Transactions"
msgstr ""

@ -23,7 +23,7 @@ msgstr "Welcome to our blockchain explorer."
msgid "blocks-title"
msgstr "Blocks"
#: lib/explorer_web/templates/page/index.html.eex:9
#: lib/explorer_web/templates/page/index.html.eex:10
msgid "Gas Used"
msgstr "Gas Used"
@ -32,5 +32,17 @@ msgid "Height"
msgstr "Height"
#: lib/explorer_web/templates/page/index.html.eex:10
msgid "Validated"
msgstr "Validated"
#: lib/explorer_web/templates/page/index.html.eex:9
msgid "Age"
msgstr "Age"
#: lib/explorer_web/templates/page/index.html.eex:30
msgid "Hash"
msgstr "Hash"
#: lib/explorer_web/templates/page/index.html.eex:26
msgid "Transactions"
msgstr "Transactions"

@ -0,0 +1,9 @@
defmodule Explorer.Repo.Migrations.AddValueToTransactions do
use Ecto.Migration
def change do
alter table(:transactions) do
add :value, :numeric, precision: 100, null: false
end
end
end

@ -4,6 +4,48 @@ defmodule Explorer.FetcherTest do
alias Explorer.Block
alias Explorer.Repo
alias Explorer.Fetcher
alias Explorer.Transaction
@raw_block %{
"difficulty" => "0xfffffffffffffffffffffffffffffffe",
"gasLimit" => "0x02",
"gasUsed" => "0x19522",
"hash" => "bananas",
"miner" => "0xdb1207770e0a4258d7a4ce49ab037f92564fea85",
"number" => "0x7f2fb",
"parentHash" => "0x70029f66ea5a3b2b1ede95079d95a2ab74b649b5b17cdcf6f29b6317e7c7efa6",
"size" => "0x10",
"timestamp" => "0x12",
"totalDifficulty" => "0xff",
"nonce" => nil,
"transactions" => []
}
@processed_block %{
difficulty: 340282366920938463463374607431768211454,
gas_limit: 2,
gas_used: 103714,
hash: "bananas",
nonce: "0xfb6e1a62d119228b",
miner: "0xdb1207770e0a4258d7a4ce49ab037f92564fea85",
number: 520955,
parent_hash: "0x70029f66ea5a3b2b1ede95079d95a2ab74b649b5b17cdcf6f29b6317e7c7efa6",
size: 16,
timestamp: Timex.parse!("1970-01-01T00:00:18-00:00", "{ISO:Extended}"),
total_difficulty: 255,
transactions: [],
}
@raw_transaction %{
"block_id" => "1",
"hash" => "pepino",
"value" => "0xde0b6b3a7640000",
}
@processed_transaction %{
hash: "pepino",
value: 1000000000000000000,
}
describe "fetch/1" do
test "the latest block is copied over from the blockchain" do
@ -19,6 +61,35 @@ defmodule Explorer.FetcherTest do
assert last_block.number == 563491
end
end
test "when the block has a transaction it should be created" do
use_cassette "fetcher_fetch_with_transaction" do
Fetcher.fetch("0x8d2a8")
last_transaction = Transaction
|> order_by(desc: :inserted_at)
|> limit(1)
|> Repo.all
|> List.first
assert last_transaction.value == Decimal.new(1000000000000000000)
assert last_transaction.hash == "0x8cea0c5ffdd96a4dada74066f7416a0957dca278d45a1caec439ba68cbf3f4d6"
end
end
test "when the block has a transaction with zero value it should store that zero value" do
use_cassette "fetcher_fetch_with_a_zero_value_transaction" do
Fetcher.fetch("0x918c1")
last_transaction = Transaction
|> order_by(desc: :inserted_at)
|> limit(1)
|> Repo.all
|> List.first
assert last_transaction.value == Decimal.new(0)
end
end
end
describe "download_block/1" do
@ -30,40 +101,35 @@ defmodule Explorer.FetcherTest do
end
describe "extract_block/1" do
@raw_block %{
"difficulty" => "0xfffffffffffffffffffffffffffffffe",
"gasLimit" => "0x02",
"gasUsed" => "0x19522",
"hash" => "bananas",
"miner" => "0xdb1207770e0a4258d7a4ce49ab037f92564fea85",
"number" => "0x7f2fb",
"parentHash" => "0x70029f66ea5a3b2b1ede95079d95a2ab74b649b5b17cdcf6f29b6317e7c7efa6",
"size" => "0x10",
"timestamp" => "0x12",
"totalDifficulty" => "0xff",
"nonce" => nil
}
test "returns the struct of a block" do
processed_block = %{
difficulty: 340282366920938463463374607431768211454,
gas_limit: 2,
gas_used: 103714,
hash: "bananas",
nonce: "0xfb6e1a62d119228b",
miner: "0xdb1207770e0a4258d7a4ce49ab037f92564fea85",
number: 520955,
parent_hash: "0x70029f66ea5a3b2b1ede95079d95a2ab74b649b5b17cdcf6f29b6317e7c7efa6",
size: 16,
timestamp: Timex.parse!("1970-01-01T00:00:18-00:00", "{ISO:Extended}"),
total_difficulty: 255,
}
assert Fetcher.extract_block(%{@raw_block | "nonce" => "0xfb6e1a62d119228b"}) == processed_block
assert Fetcher.extract_block(%{@raw_block | "nonce" => "0xfb6e1a62d119228b"}) == @processed_block
end
test "when there is no nonce" do
assert Fetcher.extract_block(@raw_block).nonce == "0"
end
test "when there is a transaction" do
assert Fetcher.extract_block(@raw_block).transactions
end
end
describe "extract_transactions/1" do
test "that it parses a list of transactions" do
transactions = Fetcher.extract_transactions([@raw_transaction])
assert transactions == [@processed_transaction]
end
end
describe "extract_transaction/1" do
test "that it extracts the transaction" do
assert Fetcher.extract_transaction(@raw_transaction) == @processed_transaction
end
test "when the transaction value is zero it returns a decimal" do
transaction = %{@raw_transaction | "value" => "0x0"}
assert Fetcher.extract_transaction(transaction).value == 0
end
end
describe "decode_integer_field/1" do
@ -81,10 +147,23 @@ defmodule Explorer.FetcherTest do
describe "validate_block/1" do
test "returns a valid changeset for an extracted block" do
use_cassette "fetcher_validate_block" do
changeset = Fetcher.download_block("0x89923") |> Fetcher.extract_block |> Fetcher.validate_block
assert(changeset.valid?)
end
changeset = @raw_block |> Fetcher.extract_block |> Fetcher.validate_block
assert changeset.valid?
end
test "that it puts a nested transaction into a changeset" do
block = %{@raw_block | "transactions" => [@raw_transaction]}
changeset = block |> Fetcher.extract_block |> Fetcher.validate_block
first_transaction = changeset.changes.transactions |> List.first
assert first_transaction.changes.hash == "pepino"
end
test "that it validates a nested transaction" do
transaction = %{@raw_transaction | "hash" => ""}
block = %{@raw_block | "transactions" => [transaction]}
changeset = block |> Fetcher.extract_block |> Fetcher.validate_block
transaction_changeset = changeset.changes.transactions |> List.first
assert transaction_changeset.errors[:hash] == {"can't be blank", [validation: :required]}
end
end
end

@ -6,12 +6,12 @@ defmodule Explorer.TransactionTest do
describe "changeset/2" do
test "with valid attributes" do
block = insert(:block)
changeset = Transaction.changeset(%Transaction{}, %{hash: "0x0", block_id: block.id})
changeset = Transaction.changeset(%Transaction{}, %{hash: "0x0", block_id: block.id, value: 1})
assert changeset.valid?
end
test "with a block that does not exist in the database" do
{:error, changeset} = Transaction.changeset(%Transaction{}, %{hash: "0x0", block_id: 0}) |> Repo.insert
{:error, changeset} = Transaction.changeset(%Transaction{}, %{hash: "0x0", value: 1000000, block_id: 0}) |> Repo.insert
refute changeset.valid?
assert [block_id: {"does not exist", []}] = changeset.errors
end

@ -26,5 +26,27 @@ defmodule ExplorerWeb.PageControllerTest do
conn = get conn, "/en"
refute(Enum.member?(conn.assigns.blocks, old_block))
end
test "returns a transaction", %{conn: conn} do
block = insert(:block)
insert(:transaction, hash: "0xDECAFBAD", block: block)
conn = get conn, "/en"
assert(List.first(conn.assigns.transactions).hash == "0xDECAFBAD")
assert(List.first(conn.assigns.transactions).block == block)
end
test "returns only the five most recent transactions", %{conn: conn} do
block_mined_today = insert(:block, timestamp: Timex.now |> Timex.shift(hours: -2))
recently_mined_transaction = insert(:transaction, inserted_at: Timex.now |> Timex.shift(hours: -1), block: block_mined_today)
block_mined_last_week = insert(:block, timestamp: Timex.now |> Timex.shift(weeks: -1))
insert_list(5, :transaction, inserted_at: Timex.now, block: block_mined_last_week)
conn = get conn, "/en"
assert(Enum.count(conn.assigns.transactions) == 5)
assert(Enum.member?(conn.assigns.transactions, recently_mined_transaction))
end
end
end

@ -25,4 +25,16 @@ defmodule ExplorerWeb.UserListTest do
|> assert_has(css(".blocks__column--age", count: 5, text: "1 hour ago"))
|> assert_has(css(".blocks__column--gas-used", count: 5, text: "10"))
end
test "views transactions on the home page", %{session: session} do
transaction_block = insert(:block, timestamp: Timex.now |> Timex.shift(hours: -2))
insert_list(5, :transaction, block: transaction_block)
session
|> visit("/en")
|> assert_has(css(".transactions__title", text: "Transactions"))
|> assert_has(css(".transactions__column--hash", count: 5))
|> assert_has(css(".transactions__column--value", count: 5))
|> assert_has(css(".transactions__column--age", count: 5, text: "2 hours ago"))
end
end

@ -0,0 +1,13 @@
defmodule Explorer.TransactionFactory do
defmacro __using__(_opts) do
quote do
def transaction_factory do
%Explorer.Transaction{
block: build(:block),
hash: sequence("0x"),
value: Enum.random(1..100_000),
}
end
end
end
end

@ -1,4 +1,5 @@
defmodule Explorer.Factory do
use ExMachina.Ecto, repo: Explorer.Repo
use Explorer.BlockFactory
use Explorer.TransactionFactory
end

@ -0,0 +1,30 @@
[
{
"request": {
"body": "{\"params\":[\"0x918c1\",true],\"method\":\"eth_getBlockByNumber\",\"jsonrpc\":\"2.0\",\"id\":0}",
"headers": {
"Content-Type": "application/json"
},
"method": "post",
"options": [],
"request_body": "",
"url": "https://sokol.poa.network:443"
},
"response": {
"binary": false,
"body": "{\"jsonrpc\":\"2.0\",\"result\":{\"author\":\"0xe8ddc5c7a2d2f0d7a9798459c0104fdf5e987aca\",\"difficulty\":\"0xfffffffffffffffffffffffffffffffd\",\"extraData\":\"0xd5830108048650617269747986312e32322e31826c69\",\"gasLimit\":\"0x7a1200\",\"gasUsed\":\"0x7a1200\",\"hash\":\"0xadbdb56ed4646f087ba33526397ab627d0f4a6a9a3b167e2ad5a34858ca56912\",\"logsBloom\":\"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"miner\":\"0xe8ddc5c7a2d2f0d7a9798459c0104fdf5e987aca\",\"number\":\"0x918c1\",\"parentHash\":\"0x0ee8ca9dbc473df053c317b8b44ef3210ce6dd43ce95a9ef5c3855daccff2edc\",\"receiptsRoot\":\"0x1e7ea64145066ff4ffc94fc343a77ba4aafe1bf752870c6c37a66c38cf8dd624\",\"sealFields\":[\"0x841215030c\",\"0xb841eea7f72fba66fe7e2c673f45e0700d99e992572575b54f6cf22bdd73936d57a54afc0d1f5d5a752a9cd88687c463a3f29af0c5cd51d27138a7f5ec9b2ba1dc5f00\"],\"sha3Uncles\":\"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\",\"signature\":\"eea7f72fba66fe7e2c673f45e0700d99e992572575b54f6cf22bdd73936d57a54afc0d1f5d5a752a9cd88687c463a3f29af0c5cd51d27138a7f5ec9b2ba1dc5f00\",\"size\":\"0x2d4\",\"stateRoot\":\"0x3904497f0fa277effc1aa7c322c6d85a2b23c5564eae3fe4d3eb895bcff773ea\",\"step\":\"303366924\",\"timestamp\":\"0x5a690f3c\",\"totalDifficulty\":\"0x918c0ffffffffffffffffffffffffede3e433\",\"transactions\":[{\"blockHash\":\"0xadbdb56ed4646f087ba33526397ab627d0f4a6a9a3b167e2ad5a34858ca56912\",\"blockNumber\":\"0x918c1\",\"chainId\":\"0x4d\",\"condition\":null,\"creates\":null,\"from\":\"0x82e4e61e7f5139ff0a4157a5bc687ef42294c248\",\"gas\":\"0x7a1200\",\"gasPrice\":\"0x3b9aca00\",\"hash\":\"0x1383ccbe8f74c1f0ee74e0558cb4776cfaf35bc9fbe951a6db08335026243a7c\",\"input\":\"0x1003e2d2000000000000000000000000000000000000000000000000000000000000060e\",\"nonce\":\"0x17c\",\"publicKey\":\"0x750f765a7790aa361dde0ff1d4c9dadd0e1c62fe79dee9c3d6b953abe99ce79755568215a2524d0efe0d5a48d8082e86f317434b62964b0c2e3e3446ebe08099\",\"r\":\"0x661d8ed2c9045286d8ef683f7192ae4158dcb1f92572ef6ff65efe2b9b318f97\",\"raw\":\"0xf88b82017c843b9aca00837a120094fdf0769242684f48894b1d0ff68d54c136018e3980a41003e2d2000000000000000000000000000000000000000000000000000000000000060e81bda0661d8ed2c9045286d8ef683f7192ae4158dcb1f92572ef6ff65efe2b9b318f97a07f9977d48f2d8a0294b0e1bd65acc11f84a6d6cf0df3fa74fbd793133274e585\",\"s\":\"0x7f9977d48f2d8a0294b0e1bd65acc11f84a6d6cf0df3fa74fbd793133274e585\",\"standardV\":\"0x0\",\"to\":\"0xfdf0769242684f48894b1d0ff68d54c136018e39\",\"transactionIndex\":\"0x0\",\"v\":\"0xbd\",\"value\":\"0x0\"}],\"transactionsRoot\":\"0x6b90d094d219d6f415ce8a490e13a56f13f5f0501cc0e018150dc64eaceb1b24\",\"uncles\":[]},\"id\":0}\n",
"headers": {
"Date": "Thu, 25 Jan 2018 19:07:43 GMT",
"Content-Type": "application/json",
"Transfer-Encoding": "chunked",
"Connection": "keep-alive",
"Set-Cookie": "__cfduid=d4c42fb0033c832349c1ca857034595f01516907262; expires=Fri, 25-Jan-19 19:07:42 GMT; path=/; domain=.poa.network; HttpOnly; Secure",
"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
"Server": "cloudflare",
"CF-RAY": "3e2d84597f3828be-SJC"
},
"status_code": 200,
"type": "ok"
}
}
]

@ -0,0 +1,30 @@
[
{
"request": {
"body": "{\"params\":[\"0x8d2a8\",true],\"method\":\"eth_getBlockByNumber\",\"jsonrpc\":\"2.0\",\"id\":3}",
"headers": {
"Content-Type": "application/json"
},
"method": "post",
"options": [],
"request_body": "",
"url": "https://sokol.poa.network:443"
},
"response": {
"binary": false,
"body": "{\"jsonrpc\":\"2.0\",\"result\":{\"author\":\"0x82e4e61e7f5139ff0a4157a5bc687ef42294c248\",\"difficulty\":\"0xfffffffffffffffffffffffffffffffe\",\"extraData\":\"0xd5830108048650617269747986312e32322e31826c69\",\"gasLimit\":\"0x7a1200\",\"gasUsed\":\"0x5208\",\"hash\":\"0x9a57007d79c7643278f990e00ead1438c1435b0af5754f6c1f5c8a91c3235b74\",\"logsBloom\":\"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"miner\":\"0x82e4e61e7f5139ff0a4157a5bc687ef42294c248\",\"number\":\"0x8d2a8\",\"parentHash\":\"0xe6735536514c7b05246f79db85b7b815bb031fc09d9533720294ce5916a41466\",\"receiptsRoot\":\"0x056b23fbba480696b65fe5a59b8f2148a1299103c4f57df839233af2cf4ca2d2\",\"sealFields\":[\"0x841214b221\",\"0xb8412b4764ad025dcfdd5bf213960c60b9494ade6d3e7290f4b53ef9625c30f1f8c30cac231ec8125a9ca94a80c75552c8f0463b5e7e3cf10d443749cdd17354477c00\"],\"sha3Uncles\":\"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\",\"signature\":\"2b4764ad025dcfdd5bf213960c60b9494ade6d3e7290f4b53ef9625c30f1f8c30cac231ec8125a9ca94a80c75552c8f0463b5e7e3cf10d443749cdd17354477c00\",\"size\":\"0x2b4\",\"stateRoot\":\"0x90415320006f67d8bddf7d56c93318934dae56024afcdfb8e10b3ce80a1da9d7\",\"step\":\"303346209\",\"timestamp\":\"0x5a677aa5\",\"totalDifficulty\":\"0x8d2a7ffffffffffffffffffffffffede47b37\",\"transactions\":[{\"blockHash\":\"0x9a57007d79c7643278f990e00ead1438c1435b0af5754f6c1f5c8a91c3235b74\",\"blockNumber\":\"0x8d2a8\",\"chainId\":\"0x4d\",\"condition\":null,\"creates\":null,\"from\":\"0x9a4a90e2732f3fa4087b0bb4bf85c76d14833df1\",\"gas\":\"0x7b0c\",\"gasPrice\":\"0x77359400\",\"hash\":\"0x8cea0c5ffdd96a4dada74066f7416a0957dca278d45a1caec439ba68cbf3f4d6\",\"input\":\"0x\",\"nonce\":\"0x9\",\"publicKey\":\"0x7a2899627b1802d1f71e0e5a06416c85b6b96a6fb8d5f574cbcbc3963212a1e2b48a435461e6d2a4f9930e6a92988164e02a5e7f0b4763ca7d524461fcec67dc\",\"r\":\"0xc012855f7e8b552716ca1af2eaaeaee09a3b860179b56bbf7a68ccd31e43f92\",\"raw\":\"0xf86c098477359400827b0c94b7cffe2ac19b9d5705a24cbe14fef5663af905a6880de0b6b3a76400008081bea00c012855f7e8b552716ca1af2eaaeaee09a3b860179b56bbf7a68ccd31e43f92a03b6dcd71513064384b481a339e042236ef50655e96ba6d8354c7f800ebab0c42\",\"s\":\"0x3b6dcd71513064384b481a339e042236ef50655e96ba6d8354c7f800ebab0c42\",\"standardV\":\"0x1\",\"to\":\"0xb7cffe2ac19b9d5705a24cbe14fef5663af905a6\",\"transactionIndex\":\"0x0\",\"v\":\"0xbe\",\"value\":\"0xde0b6b3a7640000\"}],\"transactionsRoot\":\"0x58c9f8e81202d2212ed1a75fb714820ac5f2756d8408ad2750f5cf7450b8204e\",\"uncles\":[]},\"id\":3}\n",
"headers": {
"Date": "Tue, 23 Jan 2018 22:46:24 GMT",
"Content-Type": "application/json",
"Transfer-Encoding": "chunked",
"Connection": "keep-alive",
"Set-Cookie": "__cfduid=d678a1812702d81f56f94de246d58bd931516747584; expires=Wed, 23-Jan-19 22:46:24 GMT; path=/; domain=.poa.network; HttpOnly; Secure",
"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
"Server": "cloudflare",
"CF-RAY": "3e1e49f49fcb933c-SJC"
},
"status_code": 200,
"type": "ok"
}
}
]

@ -1,30 +0,0 @@
[
{
"request": {
"body": "{\"params\":[\"0x89923\",true],\"method\":\"eth_getBlockByNumber\",\"jsonrpc\":\"2.0\",\"id\":0}",
"headers": {
"Content-Type": "application/json"
},
"method": "post",
"options": [],
"request_body": "",
"url": "https://sokol.poa.network:443"
},
"response": {
"binary": false,
"body": "{\"jsonrpc\":\"2.0\",\"result\":{\"author\":\"0xdb1207770e0a4258d7a4ce49ab037f92564fea85\",\"difficulty\":\"0xfffffffffffffffffffffffffffffffe\",\"extraData\":\"0xd5830108048650617269747986312e32322e31826c69\",\"gasLimit\":\"0x7a1200\",\"gasUsed\":\"0x0\",\"hash\":\"0x342878f5a2c06bc6146f9440910bab9c5ddae5dbd13c9a01d8adaf51ff5593ae\",\"logsBloom\":\"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"miner\":\"0xdb1207770e0a4258d7a4ce49ab037f92564fea85\",\"number\":\"0x89923\",\"parentHash\":\"0x70029f66ea5a3b2b1ede95079d95a2ab74b649b5b17cdcf6f29b6317e7c7efa6\",\"receiptsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"sealFields\":[\"0x8412147192\",\"0xb841db669d5b8d22ef69c849a914682c242cde9492cbf1de381d0d4f1857d871963767470f38b1f63031fe47614175609989552ac5e8a6c2844f2d48dfdc48e9df4001\"],\"sha3Uncles\":\"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\",\"signature\":\"db669d5b8d22ef69c849a914682c242cde9492cbf1de381d0d4f1857d871963767470f38b1f63031fe47614175609989552ac5e8a6c2844f2d48dfdc48e9df4001\",\"size\":\"0x243\",\"stateRoot\":\"0x1ce8bea4dc0a87b99af15a65bb79980cb337e5bf4d1f5ad7d2d263572d177f1a\",\"step\":\"303329682\",\"timestamp\":\"0x5a6637da\",\"totalDifficulty\":\"0x89922ffffffffffffffffffffffffede4f54b\",\"transactions\":[],\"transactionsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"uncles\":[]},\"id\":0}\n",
"headers": {
"Date": "Mon, 22 Jan 2018 19:14:51 GMT",
"Content-Type": "application/json",
"Transfer-Encoding": "chunked",
"Connection": "keep-alive",
"Set-Cookie": "__cfduid=d6d7bf13bce28ec88dc130f482acb91ab1516648491; expires=Tue, 22-Jan-19 19:14:51 GMT; path=/; domain=.poa.network; HttpOnly; Secure",
"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
"Server": "cloudflare",
"CF-RAY": "3e14d6ad693128be-SJC"
},
"status_code": 200,
"type": "ok"
}
}
]
Loading…
Cancel
Save