API v2: Add block_hash to logs (#7891)

* Add block_hash to logs

* Changelog
pull/7898/head
nikitosing 1 year ago committed by GitHub
parent f9cbb1072a
commit 8c07aece2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 3
      apps/block_scout_web/lib/block_scout_web/views/api/v2/transaction_view.ex
  3. 1
      apps/block_scout_web/test/block_scout_web/controllers/api/v2/address_controller_test.exs

@ -25,7 +25,7 @@
- [#7863](https://github.com/blockscout/blockscout/pull/7863) - Add max_age for account sessions
- [#7841](https://github.com/blockscout/blockscout/pull/7841) - CORS setup for docker-compose config with new frontend
- [#7832](https://github.com/blockscout/blockscout/pull/7832) - API v2: Add block_number to logs
- [#7832](https://github.com/blockscout/blockscout/pull/7832), [#7891](https://github.com/blockscout/blockscout/pull/7891) - API v2: Add block_number, block_hash to logs
- [#7789](https://github.com/blockscout/blockscout/pull/7789) - Fix test warnings; Fix name of `MICROSERVICE_ETH_BYTECODE_DB_INTERVAL_BETWEEN_LOOKUPS` env variable
- [#7819](https://github.com/blockscout/blockscout/pull/7819) - Add logging for unknown error verification result
- [#7781](https://github.com/blockscout/blockscout/pull/7781) - Add `/api/v1/health/liveness` and `/api/v1/health/readiness`

@ -285,7 +285,8 @@ defmodule BlockScoutWeb.API.V2.TransactionView do
"index" => log.index,
"decoded" => decoded,
"smart_contract" => smart_contract_info(transaction_or_hash),
"block_number" => log.block_number
"block_number" => log.block_number,
"block_hash" => log.block_hash
}
end

@ -1729,6 +1729,7 @@ defmodule BlockScoutWeb.API.V2.AddressControllerTest do
assert Address.checksum(log.address_hash) == json["address"]["hash"]
assert to_string(log.transaction_hash) == json["tx_hash"]
assert json["block_number"] == log.block_number
assert json["block_hash"] == to_string(log.block_hash)
end
defp compare_item(%Withdrawal{} = withdrawal, json) do

Loading…
Cancel
Save