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

Better Accounting #3960

Closed
wants to merge 249 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
249 commits
Select commit Hold shift + click to select a range
2aa9cba
Removes chifra monitors --watch
tjayrush Feb 5, 2025
1bd013c
Cleans khedra a bit, adds tests
tjayrush Feb 5, 2025
eceb5c3
Improves convertObjectToArray
tjayrush Feb 5, 2025
8c0bb27
Identifies NOTIFY_CODE
tjayrush Feb 5, 2025
572a9da
Small cleanings
tjayrush Feb 5, 2025
b33286c
Creates topics package
tjayrush Feb 5, 2025
5dfe72f
SetContexts doesn't use the chain param - removed it
tjayrush Feb 5, 2025
bd33623
Enables an in-memory balance cache in Connetion
tjayrush Feb 5, 2025
d40db59
Enables an on-disc cache for statement.
tjayrush Feb 5, 2025
6079632
Make Ledger::AccountFor private
tjayrush Feb 5, 2025
2cee518
Makes all fields of the Ledger private (since it's possible)
tjayrush Feb 5, 2025
e5077a8
Cleans up Ledger and Statement types
tjayrush Feb 6, 2025
47a3ff8
Adds tests to Statement type
tjayrush Feb 6, 2025
2755f7b
A few small bits of cleaning
tjayrush Feb 6, 2025
b36da4f
Cleanings
tjayrush Feb 6, 2025
77ff8d7
Adds a much better NormalizeLog
tjayrush Feb 6, 2025
ca5700e
Small cleanings
tjayrush Feb 6, 2025
9d067bf
Small cleanings
tjayrush Feb 6, 2025
a39b1fc
Adds NormalizeTransfer to articulation
tjayrush Feb 6, 2025
fa990e0
Broken
tjayrush Feb 6, 2025
3ef476a
Best version yet
tjayrush Feb 7, 2025
a3c57d2
Best version yet
tjayrush Feb 7, 2025
95d950b
A little bit more cleanings
tjayrush Feb 7, 2025
45e0cdc
Adds testing
tjayrush Feb 7, 2025
9692e99
Adds assetContext but does not yet use it
tjayrush Feb 7, 2025
ad7fad0
Testing
tjayrush Feb 7, 2025
c82dfe1
Best version yet
tjayrush Feb 7, 2025
021177e
Reenables a bunch of --accounting tests. Fixes a bug in block zero be…
tjayrush Feb 7, 2025
548f41c
Best version yet - turns on a bunch of accounting tests
tjayrush Feb 8, 2025
d273d0e
Adds rollingBalance to Statement
tjayrush Feb 9, 2025
d890381
Adds rollingBalance to Statement
tjayrush Feb 9, 2025
a19e8f8
Adds rollingBalance to Statement
tjayrush Feb 9, 2025
0b142b8
Improves base.Wei and base.Ether testing
tjayrush Feb 9, 2025
65efdab
Uses only address for assetContexts
tjayrush Feb 9, 2025
6353ffb
Fixed spelling of SentinalAddr to SentinelAddr
tjayrush Feb 9, 2025
3d840f5
Various small cleanings and better testing around base.Address and ty…
tjayrush Feb 9, 2025
c06d6cf
Adds comparisons to base.Address and tests
tjayrush Feb 9, 2025
0f5d199
Improves and tests IsImplicitAddress
tjayrush Feb 10, 2025
e23e33c
Other small improvements for IsImplicitAddress and addToAddressMap
tjayrush Feb 10, 2025
d20e318
Prepares for re-write of IsPrecompile
tjayrush Feb 10, 2025
1c125ea
Makes IsPrecompile and streamAppearance accept name base.Address
tjayrush Feb 10, 2025
30d6fd2
Updates
tjayrush Feb 11, 2025
ec20f7e
Updates go.mods
tjayrush Feb 11, 2025
56f7ee1
Improves AddressFromPath
tjayrush Feb 11, 2025
7467a13
Removes some unused tests
tjayrush Feb 11, 2025
46183df
Added a test
tjayrush Feb 11, 2025
8138e0e
Updates github workflow
tjayrush Feb 11, 2025
50939c0
Small cleaning
tjayrush Feb 11, 2025
1f0770f
Rename LedgerContexter to Balancer and adds RunningBal method to inte…
tjayrush Feb 11, 2025
ab6e92c
Moves DebugStatement to ledger package to make things clearer and easier
tjayrush Feb 11, 2025
b63c679
Renames appContext to appBalancer throughout to make more sense
tjayrush Feb 11, 2025
eeca32e
Renames assetContext to assetBalancer throughout to make more sense
tjayrush Feb 11, 2025
3699d75
Adds a few tests for updaters
tjayrush Feb 14, 2025
e75fdb8
Corrects spelling o Sentinel
tjayrush Feb 14, 2025
7df5a85
Best version yet - very wonky still but passes all tests
tjayrush Feb 14, 2025
05ea3bb
Best version yet - very wonky still but passes all tests
tjayrush Feb 15, 2025
4910669
Some cleanings around Posting, Statement, and AssetTransfer
tjayrush Feb 15, 2025
60656e9
Removes assetBalancers as ineffective
tjayrush Feb 16, 2025
97971d4
Fixes build
tjayrush Feb 16, 2025
e490eb0
Enhances base package with Equals, LessThan, etc.
tjayrush Feb 16, 2025
ecfb7a5
Move DebugStatement to types. General cleanup
tjayrush Feb 16, 2025
fbb9141
Updates README - first draft
tjayrush Feb 16, 2025
d00b858
Removes the idea of a Balancer as no longer needed.
tjayrush Feb 16, 2025
a326099
Improves debugging
tjayrush Feb 16, 2025
5b044b9
Moving towards a new way of doing balancer contexts
tjayrush Feb 16, 2025
628a749
Smalling cleanings leading to new Reconciler
tjayrush Feb 17, 2025
bd29651
Lots of changes related to reconcilition
tjayrush Feb 17, 2025
54a30c5
Cleanings
tjayrush Feb 17, 2025
0c5c1f4
Cleanings
tjayrush Feb 17, 2025
4530104
New ledger2 code
tjayrush Feb 17, 2025
62cc92c
Fixes to build for ledger2
tjayrush Feb 17, 2025
a0c01e8
Fixes to build for ledger2
tjayrush Feb 17, 2025
1a7218f
Fixes to build for ledger2
tjayrush Feb 17, 2025
99e7e5f
Fixes to build for ledger2
tjayrush Feb 17, 2025
903dd3b
Cleanings
tjayrush Feb 17, 2025
dd0d557
Cleanings
tjayrush Feb 17, 2025
c3ffddc
Updates khedra README
tjayrush Feb 18, 2025
94508e6
Improves validators for blocks and export
tjayrush Feb 18, 2025
904b0d3
Fixes a latent bug in accounting when using first_block
tjayrush Feb 18, 2025
8b13090
Cleanings
tjayrush Feb 18, 2025
13ade91
Uses AppPosition in an effort to move to new Reconciler
tjayrush Feb 18, 2025
5dd26df
Cleanings NotEqual to base, UnmarshalJson for ReconType
tjayrush Feb 18, 2025
c602f25
Best version yet - moving towards new code for --accounting
tjayrush Feb 18, 2025
91c85e6
Adds AssetOfInterest filter to new reconciler. Removes NFTs from acco…
tjayrush Feb 18, 2025
a4f8c19
Cleanings
tjayrush Feb 18, 2025
75819da
Adds --nfts to chifra export
tjayrush Feb 18, 2025
2c28669
Cleanings
tjayrush Feb 18, 2025
5c7ec10
Cleaning tests
tjayrush Feb 18, 2025
b6ef084
Cleanings
tjayrush Feb 19, 2025
5c3269a
Removes troublesome PostType
tjayrush Feb 19, 2025
cdc14e9
Turns on a bunch of test cases in export
tjayrush Feb 19, 2025
368de5a
Merge branch 'develop' into feature/improved-accounting
tjayrush Feb 19, 2025
5b75028
Adds Display to Address
tjayrush Feb 23, 2025
31c4343
Updates examples
tjayrush Feb 23, 2025
4adc5c6
Updates examples
tjayrush Feb 23, 2025
75c5d03
Updates GetBalanceAtToken
tjayrush Feb 23, 2025
ad9bd48
Cleanings
tjayrush Feb 23, 2025
e3f14c8
Cleanings in ledger2 package
tjayrush Feb 23, 2025
218c9b9
Some cleanings
tjayrush Feb 23, 2025
adce310
Renames AssetType to PostAssetType
tjayrush Feb 23, 2025
f12254a
FIxing lint
tjayrush Feb 23, 2025
a44910a
Relaxes linters
tjayrush Feb 23, 2025
644d663
Updates submodules
tjayrush Feb 24, 2025
b4c64a8
Much better linting
tjayrush Feb 24, 2025
5f7ce3b
Clean up lints
tjayrush Feb 24, 2025
b781b56
Cleanings
tjayrush Feb 24, 2025
406d19a
Moves Posting to types
tjayrush Feb 24, 2025
bdbbe16
Updates accounting example
tjayrush Feb 24, 2025
6274132
Best version yet of accounting
tjayrush Feb 25, 2025
de5d674
Updating
tjayrush Feb 25, 2025
90faa2a
Cleanings
tjayrush Feb 25, 2025
2220a6e
Allows 0xeeee.... (i.e., ETH) to chifra tokens
tjayrush Feb 27, 2025
b1bd597
Updating
tjayrush Feb 27, 2025
a4b4b51
Updating
tjayrush Feb 27, 2025
8dd435d
Updating
tjayrush Feb 28, 2025
fa965ae
Cleaning
tjayrush Feb 28, 2025
126fe59
Cleaning
tjayrush Feb 28, 2025
227b658
Updates examples
tjayrush Mar 1, 2025
2564d8e
Implements chifra export --transfers
tjayrush Mar 1, 2025
6894ed7
Fixes a ton of tests related to chifra export --tranfer
tjayrush Mar 1, 2025
555728c
So deep in, not sure where the sky is
tjayrush Mar 1, 2025
b0929df
Removes blockNumberNext/Prev and postType
tjayrush Mar 1, 2025
e43e515
Still working on reconciliation
tjayrush Mar 1, 2025
21e7617
Fixes lint
tjayrush Mar 1, 2025
394c28c
Best version yet. Still a bit broken
tjayrush Mar 1, 2025
6016df4
Cleanings
tjayrush Mar 2, 2025
6fe9a72
Cleans up caching code
tjayrush Mar 2, 2025
cb5c349
Best version yet. Cleaning up caching code to make reconciliation cod…
tjayrush Mar 2, 2025
75e9662
Lots of changes to remove a dependancy on cache package in base. Allo…
tjayrush Mar 2, 2025
e4f50bd
Re-writes cache writing code to make it easier to understand and manage
tjayrush Mar 2, 2025
5310816
Cleaning
tjayrush Mar 2, 2025
556e770
Cleanings
tjayrush Mar 2, 2025
8ac076b
Adds testing to Store
tjayrush Mar 3, 2025
67862e0
Really making a push now for reconcilation
tjayrush Mar 3, 2025
f6ac4b6
Trying to consolidate all the work
tjayrush Mar 3, 2025
b27a989
Pulling things together
tjayrush Mar 3, 2025
8f40757
Moved ledger package to ledger1
tjayrush Mar 4, 2025
c691310
Moves new ledger from examples/accounting to ledger3
tjayrush Mar 4, 2025
6a8b0bb
Cleanings
tjayrush Mar 4, 2025
ebb71dd
Cleanings
tjayrush Mar 4, 2025
e8aa488
Fixes linter
tjayrush Mar 4, 2025
5e3565e
Cleanings
tjayrush Mar 4, 2025
4a7a9cb
Best Version Yet - Uses live data on accounting tests
tjayrush Mar 4, 2025
249cee4
Moves apps out of ledger3
tjayrush Mar 4, 2025
2ffe6a2
Removes more mocks from examples/accounting
tjayrush Mar 4, 2025
4ddff53
More cleaning
tjayrush Mar 5, 2025
4e969e0
Some weird shit
tjayrush Mar 6, 2025
202b25a
Some weird shit
tjayrush Mar 6, 2025
f1e7a4d
Nothing to see here
tjayrush Mar 7, 2025
c8d06d6
Trying now to finish it. Let's see.
tjayrush Mar 7, 2025
8cfc389
This is best version yet - starting to separate transfers from reconc…
tjayrush Mar 8, 2025
88c219a
Fixes lints
tjayrush Mar 8, 2025
acdbbc7
Fixes tests
tjayrush Mar 8, 2025
e6c3a04
Fixes tests
tjayrush Mar 8, 2025
256233f
Cleanings
tjayrush Mar 9, 2025
6675a78
Best version yet
tjayrush Mar 9, 2025
4769ec8
Best version yet
tjayrush Mar 9, 2025
ca17549
Best version yet
tjayrush Mar 9, 2025
8ee2774
Best version yet
tjayrush Mar 9, 2025
7c01211
Working but a bit ugly
tjayrush Mar 9, 2025
81479ce
Getting better
tjayrush Mar 9, 2025
e8c44c1
Getting better
tjayrush Mar 9, 2025
4c4993c
Getting better
tjayrush Mar 9, 2025
c74c66e
The best version ever
tjayrush Mar 9, 2025
c62d15a
The best version ever
tjayrush Mar 9, 2025
96b902e
We are ready to move forward
tjayrush Mar 9, 2025
c48d195
Fixes lints
tjayrush Mar 9, 2025
a780b78
Updates tests by printing transfers
tjayrush Mar 9, 2025
e70e209
Better than best version yet - fixes a test case
tjayrush Mar 9, 2025
c2c41be
Cleaning up TEST_MODE
tjayrush Mar 10, 2025
f8e32ee
Cleanings
tjayrush Mar 10, 2025
4725b13
Cleanings removes ledger10
tjayrush Mar 10, 2025
77a6568
Adds chifra export --assets option
tjayrush Mar 11, 2025
1c264c2
Cleans up some names
tjayrush Mar 12, 2025
dd79389
Cleans up around names and autonaming
tjayrush Mar 12, 2025
8e37bae
More easily allows for eliminating airdrops from reconcilations (now …
tjayrush Mar 12, 2025
a579329
Best version yet
tjayrush Mar 12, 2025
973a454
A whole bunch of cleanings
tjayrush Mar 12, 2025
e3640f1
Finally trying to fix the problem of intra-block transfers
tjayrush Mar 13, 2025
5144bc9
Could be best version yet - has running balance
tjayrush Mar 13, 2025
55704e6
Fixes lints
tjayrush Mar 13, 2025
475a580
Fixes dependabot warnings
tjayrush Mar 13, 2025
cdabcca
More crazy cleaning
tjayrush Mar 13, 2025
bba7f2e
Separates GetTransfers
tjayrush Mar 13, 2025
e302faa
Six hours later fixes on test case - Best Version Ever
tjayrush Mar 14, 2025
0e6fb8b
Linting, cleaning, first stab at statement caching
tjayrush Mar 14, 2025
61683ab
Cleans up testing
tjayrush Mar 14, 2025
b0ed3e9
Partial
tjayrush Mar 14, 2025
3c1a41e
Some cleaning
tjayrush Mar 15, 2025
ef9d22e
Breaks out different types of corrections
tjayrush Mar 16, 2025
890c3bc
Cleaning
tjayrush Mar 16, 2025
2a8a9b5
Cleaning
tjayrush Mar 16, 2025
8d9aa79
AppPosition to AppNode - still trying to fix reconciler
tjayrush Mar 16, 2025
ba87b57
Use linked list for next/prev during reconcilation
tjayrush Mar 16, 2025
d584bba
Use linked list for next/prev during reconcilation
tjayrush Mar 16, 2025
59a3df7
This is easily the best version yet. All but two test cases pass.
tjayrush Mar 17, 2025
78b1dd8
Best version yet by far
tjayrush Mar 17, 2025
a88379f
Cleans tests
tjayrush Mar 17, 2025
7c86059
Small cleanings
tjayrush Mar 17, 2025
b4ef0f6
Small cleanings
tjayrush Mar 18, 2025
8a285e2
Makes Decimal a field on Transfer
tjayrush Mar 18, 2025
386e47e
Small cleanings
tjayrush Mar 18, 2025
6a0fc0e
Small cleanings
tjayrush Mar 18, 2025
acc2e10
Small cleanings
tjayrush Mar 18, 2025
7908f9c
Uses a NodeAppearance (has type and logId) instead of Appearance in A…
tjayrush Mar 18, 2025
f60a4f0
Adds a Transaction pointer and Type method to Statement
tjayrush Mar 18, 2025
9db9034
Transfers now have all fields needed for full accounting.
tjayrush Mar 19, 2025
c1e25b0
Slow movement towards where we're going. Test all work.
tjayrush Mar 19, 2025
515bcb4
More cleaning
tjayrush Mar 19, 2025
30691ef
Mostly back
tjayrush Mar 19, 2025
bd1448e
Quite a good version.
tjayrush Mar 19, 2025
ba86e6a
BEST VERSION YET YET. BEST EVER
tjayrush Mar 19, 2025
dfabdee
Fixes lints
tjayrush Mar 19, 2025
daa02a1
Small cleanings
tjayrush Mar 19, 2025
06d11ec
Small cleanings
tjayrush Mar 20, 2025
55619fb
Removes --accounting as a separte option. Simply ignore it.
tjayrush Mar 20, 2025
4910cfd
More cleanings removes --accounting optoin
tjayrush Mar 20, 2025
fb036e6
Stupid cleaning. Still trying to incorporate getUnreconciledTransfers…
tjayrush Mar 20, 2025
c298be9
Best version yet has two pass statements
tjayrush Mar 20, 2025
e16a03b
A little bit of cleanup moving towards seperate reconcilers for each …
tjayrush Mar 20, 2025
edbb184
Good
tjayrush Mar 20, 2025
5b1f846
Better
tjayrush Mar 20, 2025
c6383dd
Best version ever. I think we may be almost done.
tjayrush Mar 21, 2025
309eb21
Better chifra export --assets
tjayrush Mar 21, 2025
6dc53df
Preparing for caching statements and transfers
tjayrush Mar 22, 2025
ed231a9
Prepares for caching of transfers and statements
tjayrush Mar 22, 2025
731eccd
Starting to get balances during creation of transfers - not done yet
tjayrush Mar 22, 2025
ad80e66
Removes balance querying from trialBalance to balances map
tjayrush Mar 23, 2025
8d316d0
Renames Store.WriteToCache to WriteToStore. Hides the call inside of …
tjayrush Mar 23, 2025
7c1d746
Store.Read => Store.ReadFromStore
tjayrush Mar 23, 2025
095e9bf
Cleans cache reading code throughout.
tjayrush Mar 23, 2025
356f7f0
First version of statements cache - not complete
tjayrush Mar 23, 2025
52b566b
Fixes lints
tjayrush Mar 23, 2025
2b54e62
Removes transfers as a cache type - uses transactions cache after all
tjayrush Mar 24, 2025
026c0e6
All export tests are working. Statements, Transfers, Assets all worki…
tjayrush Mar 24, 2025
eaa32fa
Linting
tjayrush Mar 24, 2025
ea14b2c
Cleaning
tjayrush Mar 24, 2025
f1f7d54
Fixes tests
tjayrush Mar 24, 2025
6c5aad9
Cleanings
tjayrush Mar 24, 2025
903c722
CLeanings
tjayrush Mar 26, 2025
9f4437d
Will eventually remove Ether type and replace it with Float
tjayrush Mar 26, 2025
ecaab88
Auto code gen
tjayrush Mar 26, 2025
a79b892
Removes Ether type in favour of Float type
tjayrush Mar 26, 2025
cb49989
Fixes tests
tjayrush Mar 26, 2025
132ed1c
Update go mods
tjayrush Mar 27, 2025
580a16b
Fixes caching for base.Float and types.Statement
tjayrush Mar 27, 2025
d90d63b
Cleanings
tjayrush Mar 27, 2025
c697fec
Fixes tests
tjayrush Mar 27, 2025
44cfed7
Fixes tests
tjayrush Mar 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
skip-pkg-cache: true
Build:
needs: Lint
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout TrueBlocks repo
uses: actions/checkout@v4
Expand Down
58 changes: 58 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# ./.golangci.yml
run:
timeout: 5m
modules-download-mode: readonly

linters:
enable:
- gofmt # enforces formatting
- revive # custom rules like unused-parameter
- errcheck # unchecked errors
- staticcheck # static analysis
- unused # unused code
- misspell # catches typos
- ineffassign # ineffective assignments
- prealloc # suggests pre-allocation
# - goconst # finds repeated strings for consts
# - gosec # basic security checks
disable-all: true

linters-settings:
gofmt:
simplify: true
revive:
rules:
# - name: var-naming
# severity: warning
- name: unused-parameter
severity: warning
goconst:
min-len: 3 # Minimum length of repeated string
min-occurrences: 3 # Minimum times it must appear
gosec:
excludes:
- G104 # Ignore some noisy security rules (e.g., error handling)

issues:
exclude-rules:
- path: src/apps/chifra/internal/scrape/handle_show.go
linters:
- ineffassign
- path: src/apps/chifra/internal/[^/]+/options\.go
linters:
- ineffassign
- path: src/apps/chifra/pkg/types/types_
linters:
- ineffassign
- path: _test\.go
linters:
- gofmt
- revive
- errcheck
- staticcheck
- unused
- misspell
- goconst
- ineffassign
- prealloc
- gosec
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.0
4.3.0
35 changes: 21 additions & 14 deletions core.code-workspace
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
{
"folders": [
{
"path": "."
},
{
"path": "sdk"
},
{
"path": "examples"
},
{
"path": "khedra"
}
]
"folders": [
{
"path": "."
},
{
"path": "sdk"
},
{
"path": "examples"
},
{
"path": "khedra"
}
],
"settings": {
"gopls": {
"analyses": {
"infertypeargs": false
}
}
}
}
Loading
Loading