Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix transaction input json encoding #2341

Merged
merged 3 commits into from
Jul 11, 2019
Merged

fix transaction input json encoding #2341

merged 3 commits into from
Jul 11, 2019

Conversation

ayrat555
Copy link
Contributor

fixes

2019-07-09T15:39:42.194 [error] GenServer BlockScoutWeb.RealtimeEventHandler terminating
** (FunctionClauseError) no function clause matching in Poison.Encoder.BitString.chunk_size/3
    (poison) lib/poison/encoder.ex:139: Poison.Encoder.BitString.chunk_size(<<128, 96, 64, 82, 96, 4, 54, 16, 97, 0, 219, 87, 96, 0, 53, 124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 4, 99, 255, 255, ...>>, nil, 1)
    (poison) lib/poison/encoder.ex:134: Poison.Encoder.BitString.escape/2
    (poison) lib/poison/encoder.ex:88: Poison.Encoder.BitString.encode/2
    (poison) lib/poison/encoder.ex:227: anonymous fn/4 in Poison.Encoder.Map.encode/3
    (poison) lib/poison/encoder.ex:228: Poison.Encoder.Map."-encode/3-lists^foldl/2-0-"/3
    (poison) lib/poison/encoder.ex:228: Poison.Encoder.Map.encode/3
    (poison) lib/poison/encoder.ex:227: anonymous fn/4 in Poison.Encoder.Map.encode/3
    (poison) lib/poison/encoder.ex:228: Poison.Encoder.Map."-encode/3-lists^foldl/2-0-"/3
Last message: {:chain_event, :transactions, :realtime, [%Explorer.Chain.Transaction{cumulative_gas_used: nil, logs: #Ecto.Association.NotLoaded<association :logs is not loaded>, v: #Decimal<236>, from_address: #Ecto.Association.NotLoaded<association :from_address is not loaded>, forks: #Ecto.Association.NotLoaded<association :forks is not loaded>, __meta__: #Ecto.Schema.Metadata<:loaded, "transactions">, from_address_hash: %Explorer.Chain.Hash{byte_count: 20, bytes: <<210, 30, 179, 65, 213, 26, 95, 48, 217, 168, 193, 152, 25, 183, 87, 7, 200, 248, 1, 64>>}, nonce: 47, hash: %Explorer.Chain.Hash{byte_count: 32, bytes: <<178, 49, 100, 197, 109, 28, 224, 42, 223, 67, 75, 246, 206, 114, 137, 203, 80, 122, 106, 146, 132, 247, 172, 94, 46, 169, 59, 117, 244, 141, 34, 190>>}, s: #Decimal<19515337392081919860089388580137965793002383404738727612092998645409469442506>, value: #Explorer.Chain.Wei<0>, block_number: nil, gas: #Decimal<100000>, r: #Decimal<102217967354370895151243546254428380050887774153609442160504420085353768501203>, inserted_at: #DateTime<2019-07-09 15:39:40.438511Z>, 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, ...>>}, created_contract_address: #Ecto.Association.NotLoaded<association :created_contract_address is not loaded>, created_contract_address_hash: nil, internal_transactions: #Ecto.Association.NotLoaded<association :internal_transactions is not loaded>, error: nil, internal_transactions_indexed_at: nil, block_hash: nil, gas_used: nil, token_transfers: #Ecto.Association.NotLoaded<association :token_transfers is not loaded>, updated_at: #DateTime<2019-07-09 15:39:40.438511Z>, uncles: #Ecto.Association.NotLoaded<association :uncles is not loaded>, status: nil, to_address: #Ecto.Association.NotLoaded<association :to_address is not loaded>, to_address_hash: %Explorer.Chain.Hash{byte_count: 20, bytes: <<237, 243, 234, 173, 135, 42, 182, 84, 42, 107, 19, 195, 33, 222, ...>>}, index: nil, gas_price: #Explorer.Chain.Wei<10000000000>, block: #Ecto.Association.NotLoaded<association :block is not loaded>, created_contract_code_indexed_at: nil, old_block_hash: nil, earliest_processing_start: #DateTime<2019-07-09 15:39:40.430412Z>}]}
State: []

Motivation

We didn't define encoder for Data

Changelog

  • fix transaction input json encoding

@coveralls
Copy link

coveralls commented Jul 10, 2019

Pull Request Test Coverage Report for Build db7c8f10-22a6-40ec-ac25-e18850839133

  • 2 of 4 (50.0%) changed or added relevant lines in 1 file are covered.
  • 138 unchanged lines in 12 files lost coverage.
  • Overall coverage increased (+0.02%) to 80.952%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/explorer/lib/explorer/chain/data.ex 2 4 50.0%
Files with Coverage Reduction New Missed Lines %
apps/explorer/lib/explorer/chain/smart_contract.ex 1 50.0%
apps/indexer/lib/indexer/fetcher/coin_balance_on_demand.ex 1 96.3%
apps/block_scout_web/lib/block_scout_web/notifier.ex 2 95.74%
apps/explorer/lib/explorer/chain/address.ex 2 93.94%
apps/block_scout_web/lib/block_scout_web/router.ex 3 81.82%
apps/block_scout_web/lib/block_scout_web/controllers/address_contract_verification_controller.ex 3 66.67%
apps/block_scout_web/lib/block_scout_web/controllers/address_validation_controller.ex 6 0.0%
apps/explorer/lib/explorer/market/market.ex 8 21.43%
apps/indexer/lib/indexer/block/fetcher.ex 8 88.31%
apps/block_scout_web/lib/block_scout_web/channels/address_channel.ex 10 50.0%
Totals Coverage Status
Change from base Build 6013ba72-a286-4c3e-8ae1-a3b4d19289de: 0.02%
Covered Lines: 5172
Relevant Lines: 6389

💛 - Coveralls

@vbaranov vbaranov merged commit 3ae1e63 into master Jul 11, 2019
@vbaranov vbaranov deleted the ab-transaction-input branch July 11, 2019 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants