@ -4,6 +4,7 @@
- [#2294](https://github.com/poanetwork/blockscout/pull/2294) - add healthy block period checking endpoint
### Fixes
- [#2341](https://github.com/poanetwork/blockscout/pull/2341) - fix transaction input json encoding
- [#2311](https://github.com/poanetwork/blockscout/pull/2311) - fix market history overriding with zeroes
- [#2310](https://github.com/poanetwork/blockscout/pull/2310) - parse url for api docs
- [#2299](https://github.com/poanetwork/blockscout/pull/2299) - fix interpolation in error message
@ -7,6 +7,7 @@ defmodule Explorer.Chain.Data do
"""
alias Explorer.Chain.Data
alias Poison.Encoder.BitString
@behaviour Ecto.Type
@ -380,4 +381,22 @@ defmodule Explorer.Chain.Data do
@for.to_string(data)
end
defimpl Poison.Encoder do
def encode(data, options) do
data
|> to_string()
|> BitString.encode(options)
defimpl Jason.Encoder do
alias Jason.Encode
def encode(data, opts) do
|> Encode.string(opts)
@ -286,4 +286,18 @@ defmodule Explorer.Chain.TransactionTest do
assert Transaction.decoded_input_data(transaction) == {:ok, "60fe47b1", "set(uint256 x)", [{"x", "uint256", 10}]}
describe "Poison.encode!/1" do
test "encodes transaction input" do
assert %{
insert(:transaction)
| input: %Explorer.Chain.Data{
bytes:
<<169, 5, 156, 187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 193, 108, 45, 196, 42, 228, 149, 239, 119,
191, 128, 248>>
}
|> Poison.encode!()