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

Implement token --by-acct #3965

Closed

Conversation

vincentmele
Copy link

Fixes Issue #3964 where chifra token --by-acct was not implemented.

Description

Implemented the --by-acct option for chifra token to the documentation explanation.

Fixes Issue TrueBlocks#3964 where `chifra token --by-acct` was not implemented.

Signed-off-by: Vincent Mele <[email protected]>
@tjayrush
Copy link
Member

tjayrush commented Feb 18, 2025

This is excellent. Thanks so much.

Ignore the failed test run below (it's failing for a different reason), but I ran the tests locally, and it is failing one of the tests.

chifra tokens  0xb9e7f8568e08d5659f5d29c4997173d84cdf2607 0xa25d04fa348f107428708ba19c95d1c79b3744bf 4285364 3510999 2510010 --by_acct

It produces this result:

blockNumber	holder	address	name	symbol	decimals	balance	balanceDec
4285364	0xa25d04fa348f107428708ba19c95d1c79b3744bf	0xb9e7f8568e08d5659f5d29c4997173d84cdf2607	Swarm City Token	SWT	18	435000000000000000000000	435000
3510999	0xa25d04fa348f107428708ba19c95d1c79b3744bf	0xa25d04fa348f107428708ba19c95d1c79b3744bf			18	0	0
2510010	0xa25d04fa348f107428708ba19c95d1c79b3744bf	0xa25d04fa348f107428708ba19c95d1c79b3744bf			18	0	0

Which is wrong, I believe (and please correct me if I'm wrong). It should be:

blockNumber	holder	address	name	symbol	decimals	balance	balanceDec
4285364	0xa25d04fa348f107428708ba19c95d1c79b3744bf	0xb9e7f8568e08d5659f5d29c4997173d84cdf2607	Swarm City Token	SWT	18	435000000000000000000000	435000
3510999	0xa25d04fa348f107428708ba19c95d1c79b3744bf	0xb9e7f8568e08d5659f5d29c4997173d84cdf2607	Swarm City Token	SWT	18	0	0
2510010	0xa25d04fa348f107428708ba19c95d1c79b3744bf	0xb9e7f8568e08d5659f5d29c4997173d84cdf2607	Swarm City Token	SWT	18	0	0

With multiple blocks specified on the command line, it appears to forget which one is the token.

@tjayrush
Copy link
Member

I'll merge it if you correct that issue. Thanks so much, again.

@vincentmele
Copy link
Author

vincentmele commented Feb 18, 2025

Fixed. Added example below for byAcct with multiple tokens and multiple blocks.

chifra tokens  0xb9e7f8568e08d5659f5d29c4997173d84cdf2607 0x58b6A8A3302369DAEc383334672404Ee733aB239 0xa25d04fa348f107428708ba19c95d1c79b3744bf 4285364 3510999 2510010 latest --by_acct

should return

blockNumber     holder  address name    symbol  decimals        balance balanceDec
4285364 0xa25d04fa348f107428708ba19c95d1c79b3744bf      0xb9e7f8568e08d5659f5d29c4997173d84cdf2607      Swarm City Token        SWT     18      435000000000000000000000        435000
3510999 0xa25d04fa348f107428708ba19c95d1c79b3744bf      0xb9e7f8568e08d5659f5d29c4997173d84cdf2607      Swarm City Token        SWT     18      0       0
2510010 0xa25d04fa348f107428708ba19c95d1c79b3744bf      0xb9e7f8568e08d5659f5d29c4997173d84cdf2607      Swarm City Token        SWT     18      0       0
21872537        0xa25d04fa348f107428708ba19c95d1c79b3744bf      0xb9e7f8568e08d5659f5d29c4997173d84cdf2607      Swarm City Token        SWT     18      0       0
4285364 0xa25d04fa348f107428708ba19c95d1c79b3744bf      0x58b6a8a3302369daec383334672404ee733ab239      Livepeer Token  LPT     18      0       0
3510999 0xa25d04fa348f107428708ba19c95d1c79b3744bf      0x58b6a8a3302369daec383334672404ee733ab239      Livepeer Token  LPT     18      0       0
2510010 0xa25d04fa348f107428708ba19c95d1c79b3744bf      0x58b6a8a3302369daec383334672404ee733ab239      Livepeer Token  LPT     18      0       0
21872537        0xa25d04fa348f107428708ba19c95d1c79b3744bf      0x58b6a8a3302369daec383334672404ee733ab239      Livepeer Token  LPT     18      2236860321384596495     2.236860321384596495

@tjayrush
Copy link
Member

I fixed it. Thanks. I will close this PR and merge the corrected one #3966. This will be included in the next release to master, but you can use it from develop for now.

@tjayrush tjayrush closed this Feb 18, 2025
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