Comments (6)
I'm updating this as I don't believe a 404 page is the right approach. I believe what we should actually show is a 0 balance Address with no transactions to/from it.
from blockscout.
@jimmay5469 That's correct. A user should see the full page with 0 balances.
from blockscout.
I can handle this issue.
from blockscout.
Have you guys already started working on it? @acravenho
from blockscout.
@Lokraan No, we haven't started working on this yet. That would be great!
from blockscout.
I have a solution that utilizes this function to get addresses:
def find_or_insert_address_from_hash(%Hash{byte_count: unquote(Hash.Address.byte_count())} = hash) do
case Chain.hash_to_address(hash) do
{:ok, address} ->
{:ok, address}
{:error, :not_found} ->
Chain.create_address(%{hash: to_string(hash)})
:error ->
:error
end
end
As a result of this AddressView.contract?/1
throws an error because the created address has this: smart_contract: #Ecto.Association.NotLoaded<association :smart_contract is not loaded>
. I am able to solve this by setting smart_contract
to :nil
in the by passing the value into the changeset, but I was wondering why contract_code
gets set to :nil
when smart_contract
doesn't?
%Explorer.Chain.Address{__meta__: #Ecto.Schema.Metadata<:loaded, "addresses">, contract_code: nil, contracts_creation_internal_transaction: #Ecto.Association.NotLoaded<association :contracts_creation_internal_transaction is not loaded>, fetched_coin_balance: nil, fetched_coin_balance_block_number: nil, hash: %Explorer.Chain.Hash{byte_count: 20, bytes: <<203, 188, 213, 172, 134, 249, 165, 14, 19, 49, 54, 51, 178, 98, 225, 111, 105, 90, 144, 195>>}, inserted_at: #DateTime<2018-10-13 02:14:20.341184Z>, names: #Ecto.Association.NotLoaded<association :names is not loaded>, smart_contract: #Ecto.Association.NotLoaded<association :smart_contract is not loaded>, token: #Ecto.Association.NotLoaded<association :token is not loaded>, updated_at: #DateTime<2018-10-13 02:14:20.341192Z>}
from blockscout.
Related Issues (20)
- log file taking too much space quickly HOT 2
- Support for zkSync smart-contracts dataset
- cant find where my token went on a transaction HOT 1
- Return COIN_BALANCE_HISTORY_DAYS in the response of /api/v2/addresses/${hash}/coin-balance-history-by-day
- send me test BTC HOT 1
- Slow response from token transfers API on token page
- API not retrieving all transactions and blocks on Gnosis
- Не пришли монеты HOT 1
- after a swap with apertureswap, I didn't receive my tokens HOT 2
- Slow response from getTokenHolders API V1
- Degen (Degen) to Degen (Base) swap not showing
- Add the latest block height to response of`/blocks/{number}` endpoint
- Slow response from /transactions API v2 from specific keyset
- My transaction is stuck HOT 1
- Error connecting Binance web3 wallet to Manta Pacific Network.
- Rework `log_index` usage for zkEVM chain type
- Missing contract preloads in /api/v2/tokens/*/transfers
- Improve memory limiting algorithm
- PROMtest coin transfer error. HOT 1
- 404 when requesting CSV HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blockscout.