Page MenuHomePhabricator

Rename wallet database classes
ClosedPublic

Authored by deadalnix on Jul 9 2019, 18:59.

Details

Summary

This is a backport of Core PR11851:

  • scripted-diff: Rename wallet database classes

-BEGIN VERIFY SCRIPT-

sed -i 's/\<CWalletDBWrapper\>/BerkeleyDatabase/g' src/wallet/db.h src/wallet/db.cpp
sed -i '/statuses/i/** Backend-agnostic database type. */\nusing WalletDatabase = BerkeleyDatabase\;\n' src/wallet/walletdb.h
ren() { git grep -l "\<$1\>" 'src/*.cpp' 'src/*.h' ':(exclude)*dbwrapper*' test | xargs sed -i "s:\<$1\>:$2:g"; }
ren CDBEnv BerkeleyEnvironment
ren CDB BerkeleyBatch
ren CWalletDBWrapper WalletDatabase
ren CWalletDB WalletBatch
ren dbw database
ren m_dbw m_database
ren walletdb batch
ren pwalletdb batch
ren pwalletdbIn batch_in
ren wallet/batch.h wallet/walletdb.h
ren pwalletdbEncryption encrypted_batch

-END VERIFY SCRIPT-

  • Update walletdb comment after renaming.

Text from https://github.com/bitcoin/bitcoin/pull/11851#issuecomment-350320608
by John Newbery <john@johnnewbery.com>.

  • Add m_ prefix to WalletBatch::m_batch
Test Plan
make check
test/functional/test_runner.py --extended

Diff Detail

Repository
rABC Bitcoin ABC
Branch
pr11851
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6799
Build 11645: Bitcoin ABC Buildbot (legacy)
Build 11644: arc lint + arc unit

Event Timeline

Fabien requested changes to this revision.Jul 10 2019, 08:03
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/wallet/db.cpp
125 ↗(On Diff #10151)

How can this build ?

src/wallet/test/walletdb_tests.cpp
16 ↗(On Diff #10151)

Please split this refactor out from this diff, it is unrelated.

src/wallet/wallet.cpp
862 ↗(On Diff #10151)

Revert.

1281 ↗(On Diff #10151)

Revert.

3684 ↗(On Diff #10151)

Dito

src/wallet/wallet.h
675 ↗(On Diff #10151)

There is a missing dependency here.
Edit: PR12785

1054 ↗(On Diff #10151)

Unrelated, but OK (oversight from D2673)

This revision now requires changes to proceed.Jul 10 2019, 08:03

iRebase on top of D3618 and fix comments.

src/wallet/db.cpp
125 ↗(On Diff #10151)

Because it is a type from BDB.

src/wallet/test/walletdb_tests.cpp
16 ↗(On Diff #10151)

I don't see any real benefit doing so considering this needs to be modified regardless.

Fabien added inline comments.
src/wallet/db.cpp
125 ↗(On Diff #10151)

Oh, this is really confusing !

This revision is now accepted and ready to land.Jul 10 2019, 15:59
This revision was automatically updated to reflect the committed changes.