Page MenuHomePhabricator

Update the undo operation so they return a success/error code rather than taking out parameter
ClosedPublic

Authored by deadalnix on Jul 21 2017, 18:53.

Details

Summary

This is backport from core. It makes the API much more understandable. See https://github.com/bitcoin/bitcoin/pull/10297/commits/db994b2de93f52c9e7bed8529ca925de5064a46f for details.

I would rather return some object that forces you to check, but we have this and it is needed for the utxo work, so be it.

Test Plan
make check
../qa/pull-tester/rpc-tests.py -extended

Diff Detail

Repository
rABC Bitcoin ABC
Branch
pertxometadata
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 561
Build 561: arc lint + arc unit

Event Timeline

CCulianu added inline comments.
src/test/undo_tests.cpp
27

Nit: consider ++i instead of i++? (as long as we're being nitty)

freetrader added inline comments.
src/test/undo_tests.cpp
39 ↗(On Diff #913)

The returned DisconnectResult is not used.

Why?

If still planned, please add a TODO.
If not, it might be appropriate to add a comment about why return value can be ignored here.

This revision now requires changes to proceed.Jul 22 2017, 20:29

LGTM, just have a question about why return value is ignored in one place.

deadalnix edited edge metadata.
deadalnix added inline comments.
src/test/undo_tests.cpp
39 ↗(On Diff #913)

It is a test and it is checking in the test that this does the right thing. This is not really changing anything so I'm not sure why that is blocking the diff.

This revision is now accepted and ready to land.Jul 23 2017, 09:38
This revision was automatically updated to reflect the committed changes.