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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

deadalnix created this revision.Jul 9 2019, 18:59
Herald added a reviewer: Restricted Project. · View Herald TranscriptJul 9 2019, 18:59
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
deadalnix updated this revision to Diff 10196.Jul 10 2019, 14:40

iRebase on top of D3618 and fix comments.

deadalnix added inline comments.Jul 10 2019, 14:41
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 accepted this revision.Jul 10 2019, 15:59
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.