-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fetch TokenBalances values in Realtime and Catchup Indexers #583
Conversation
68bd356
to
31a6756
Compare
9222b21
to
7fd5768
Compare
apps/explorer/lib/explorer/chain.ex
Outdated
from( | ||
tb in TokenBalance, | ||
where: is_nil(tb.value_fetched_at), | ||
select: %TokenBalance{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we want to send the TokenBalance struct
, I think we don't need to select the specific fields. Even we don't need the whole TokenBalance
, IMO sending the all attributes it's not a problem at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed it already. Please, take a look and see if it makes sense to you as well.
cc @igorffs
dd232fe
to
3d26a79
Compare
ecdc3f5
to
a4ebffa
Compare
0d42fff
to
60bc01d
Compare
params = [%{to: address, data: data}] | ||
request(%{id: id, method: "eth_call", params: params}) | ||
end | ||
|
||
# Block.block_number() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✂️
02cb530
to
900bb22
Compare
a4ebffa
to
1f4951a
Compare
900bb22
to
2cb5ba9
Compare
Rebased on iff-index-token-balances after iff-index-token-balances was rebased on master |
1f4951a
to
717ea05
Compare
17bc6c8
to
49226a1
Compare
717ea05
to
518c9da
Compare
49226a1
to
47cd800
Compare
518c9da
to
0f7ba5d
Compare
47cd800
to
e83209c
Compare
e83209c
to
a7b9272
Compare
939a613
to
b05196d
Compare
c8bd5b5
to
09752d3
Compare
Changed to be against |
022a515
to
0a5b735
Compare
Hey @KronicDeth, I applied your suggestions. Could please you take a look again? 🙏 |
@feliperenan you fixed |
0a5b735
to
c765560
Compare
@KronicDeth fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Great work!
@gfreh This one is ready for QA :). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍 !
c765560
to
fdf5d8c
Compare
fdf5d8c
to
59c60e3
Compare
Pull Request Test Coverage Report for Build b05dc011-82e2-4f18-9dce-289f9ebf9e11
💛 - Coveralls |
We're now able to get the balances from a Address given it's address_hash, block_number and token_contract_address_hash.
59c60e3
to
ad50a21
Compare
4277b53
to
e4a9463
Compare
@igorffs @feliperenan Is there any further work that needs to be completed on this PR? If not I would like to get this merged asap. We have a DApp that needs this data today through an API endpoint. |
@acravenho done!, we are just doing some tests here 😅. |
@feliperenan Thank you for the quick work 👍 @sabondano This has now been merged which was a previous blocker to the tokenbalance API endpoint. |
#514
Motivation
This PR makes the Indexers to fetch the TokenBalances
value
andvalue_fetched_at
both in their own way:WIP