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: cw20 statistic #258

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

fix: cw20 statistic #258

wants to merge 9 commits into from

Conversation

phamphong9981
Copy link
Collaborator

No description provided.

@phamphong9981 phamphong9981 changed the title fix: statistics fix: cw20 statistic Jul 22, 2023
@phamphong9981
Copy link
Collaborator Author

phamphong9981 commented Jul 22, 2023

@peara Pull này fix statistic những contract ko có holder thì lưu là 0 và sửa lỗi: hôm thứ 6 start cw20 ko được vì statistic startBlock là 0 thì bị sai ạ

src/services/cw20/cw20.service.ts Show resolved Hide resolved
src/services/cw20/cw20.service.ts Show resolved Hide resolved
@@ -266,10 +269,13 @@ export default class Cw20Service extends BullableService {
.alias('cw20_contract')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alias này khác gì đâu?

.groupBy('holders.cw20_contract_id')
.select('holders.cw20_contract_id');
.select(
'holders.cw20_contract_id',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cw20_contract.id?

.select(
'holders.cw20_contract_id',
knex.raw(
'count(CASE when holders.amount > 0 THEN 1 ELSE null END) as count'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hình như left join count là đc?

await Block.query()
.where('height', startBlock + 1)
.first()
.throwIfNotFound()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (lastUpdatedDate && lastUpdatedDate >= systemDate) return;

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.

2 participants