Add command line util to calculate total supply of assets and validate total coins for XLM.
Description
Add command line util to calculate total supply of assets and validate total coins for XLM. Only works for assets with total supply up to INT64_MAX.
Checklist
- [ ] Reviewed the contributing document
- [ ] Rebased on top of master (no merge commits)
- [ ] Ran
clang-formatv8.0.0 (viamake formator the Visual Studio extension) - [ ] Compiles
- [ ] Ran all tests
- [ ] If change impacts performance, include supporting evidence per the performance document
I wonder if this change is necessary vs using
dump-ledger(with the changes that allow querying hot archive). There is a little bit of additional code required to build a query for an asset (for determining the asset code), but that shouldn't be too hard to add to our query language. That's still likely much less code to write and maintain, with the benefit of being reusable for other use cases. WDYT?
Nico and I actually discussed this yesterday. If we're able to do the functionality in this PR with dump-ledger, that would allow for the ability to write more invariants - even contract specific ones. I wasn't sure if we should get rid of this PR though due to how easy it is to use vs building a query, unless we keep the new command line option and call into dump-ledger in the code.
I wasn't sure if we should get rid of this PR though due to how easy it is to use vs building a query, unless we keep the new command line option and call into dump-ledger in the code.
Well, if we want to run the check continuously, then we still need a command line that for the core, so we don't need to write the query more than once. We do need to fail based on the query results though, but that seems like an ok tradeoff to have. That said, I don't mind merging this for now and then we can remove it if we can achieve the same with dump-ledger + a small check in the script.