Page MenuHomePhabricator

Use user configured encoding in receive request
ClosedPublic

Authored by deadalnix on Dec 13 2017, 11:48.

Details

Summary

The address associated with a receive request is encoded using the
configuration of the client at the time. This can be either base58 or
cashaddr.

When displaying an existing receive request, display with the currently
configured encoding.

Test Plan
  • Added test.
  • Create two requests, one running with -usecashaddr and one without.
  • Start client with and without -usercashaddr, observe that requests are displayed correct.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dagurval added a reviewer: Restricted Project.Dec 13 2017, 13:39
deadalnix added inline comments.
src/qt/receiverequestdialog.cpp
115 ↗(On Diff #2108)

Why do we return what we have as input when the input is invalid ? Is it a desired behavior ?

src/qt/test/guiutiltests.cpp
14 ↗(On Diff #2108)

UtilDummyConfig

We don't want to have random word swapping and/or shortening in all parts of the codebase.

46 ↗(On Diff #2108)

config

deadalnix requested changes to this revision.Dec 15 2017, 00:00
This revision now requires changes to proceed.Dec 15 2017, 00:00
dagurval added inline comments.
src/qt/receiverequestdialog.cpp
115 ↗(On Diff #2108)

Because basically that's what we did before. Just displayed it.

I don't know what cruft could be in the database or if adresses were stored differently somehow. This is also not really the right place to validate, that should be done when reading from the database.

I don't know what state the qt client goes into if we throw here.

An alternative is also to just to return an empty string.

Suggestions?

deadalnix edited reviewers, added: dagurval; removed: deadalnix.

Rebase
Add comment in case the conversion function gets a sketchy input.

This revision is now accepted and ready to land.Dec 19 2017, 18:31
This revision was automatically updated to reflect the committed changes.