Refactor: checking Insufficient reserve to use helper function#5844
Refactor: checking Insufficient reserve to use helper function#5844tequdev wants to merge 13 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5844 +/- ##
=======================================
Coverage 78.3% 78.3%
=======================================
Files 816 816
Lines 68887 68923 +36
Branches 8303 8301 -2
=======================================
+ Hits 53943 53989 +46
+ Misses 14944 14934 -10
🚀 New features to boost your workflow:
|
|
Can you add tests for the unchecked codecov lines as well? I know it's not technically relevant to this PR, but while we're here we may as well, since it's pretty easy. |
vvysokikh1
left a comment
There was a problem hiding this comment.
taking off my approval for now
vvysokikh1
left a comment
There was a problem hiding this comment.
check for amendment gating potentially required
@vvysokikh1 Some context that may be useful: these refactors were originally included in the XLS-68 PR (to be opened). I suggested pulling some out and putting them in other PRs, as that has been a useful strategy in other amendments. Perhaps we can comment out the changes wherever we think an amendment would be needed? Or are you concerned about all calls to this helper function? |
I'm concerned about the changes in the last commit. Previous commits where pretty obvious to me, but this last change is quite interesting. I'm not yet sure there's no change in behavior and I wanted to pull back my approval, it's just unfortunate that I don't know any other way except requesting a change :) |
d3fa030 to
d024dab
Compare
| auto const accountSle = ctx.view.read(keylet::account(accountID)); | ||
| if (auto const ret = checkInsufficientReserve( | ||
| ctx.view, accountSle, accountSle->getFieldAmount(sfBalance), 1); | ||
| !isTesSuccess(ret)) | ||
| { |
There was a problem hiding this comment.
could you please add a check for accountSle being valid in every place you changed xrpLiquid to checkInsufficientReserve
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
|
We recently merged a refactor to One-time setupIf you don't already have clang-tidy working in your env, on macOS: brew install llvm@21
# Follow brew's hint to put $(brew --prefix llvm@21)/bin on PATH so run-clang-tidy is found.Workflow on your branch (before merging develop)1. Grab the new git remote -v # should show 'upstream' among others; if not:
# git remote set-url upstream git@github.com:XRPLF/rippled.git
git fetch upstream
git checkout upstream/develop -- .clang-tidy2. Reconfigure conan/cmake so 3. Apply renames for the files modified in your PR: git diff --name-only $(git merge-base HEAD upstream/develop) HEAD \
| grep -E '\.(cpp|h|hpp|ipp)$' \
| xargs run-clang-tidy -p build -fix -allow-no-checks
# or -p .build, or whatever your build dir is called4. Build + test, then commit as a single dedicated commit: cmake --build build -j8
git commit -am "refactor: Align identifier naming with develop"5. Now merge develop: git merge upstream/developExtraRun clang-tidy once more after the merge to catch any stragglers introduced from develop's side: run-clang-tidy -p build -fix -allow-no-checks src tests
# or -p .build, or whatever your build dir is called |
|
@tequdev what's the status of this PR? Would you be able to resolve the conflicts in case it is still relevant? |
High Level Overview of Change
Added helper function
checkInsufficientReserve()fortecINSUFFICIENT_RESERVEcheckType of Change