This change affects only Qt5 users, since Qt4 QUrl don't forces lower case for urls. Also bitcoin-qt builds against Qt4 on linux.
PR for #11645
Travis CI failed on 30 minutes timeout in multiple jobs.
utACK https://github.com/bitcoin/bitcoin/pull/12723/commits/98dd40ee5dc5faf83c88672437f639272ca76a4f - needs testing, but this seems to implement #11645.
211 | @@ -212,11 +212,14 @@ bool parseBitcoinURI(QString uri, SendCoinsRecipient *out) 212 | // Convert bitcoin:// to bitcoin: 213 | // 214 | // Cannot handle this later, because bitcoin:// will cause Qt to see the part after // as host, 215 | - // which will lower-case it (and thus invalidate the address). 216 | + // which will lower-case it (and thus invalidate the address). Workaround only for Qt4 support. 217 | + 218 | +#if QT_VERSION < 0x050000
IMO just drop these lines of code (and comment), so that it gets to the error message for Qt4 too. This makes behavior under both consistent. Also: Qt4 support is under-tested and going to be removed in the not-so-far future, so might be better to not have a special, not strictly necessary workaround for it.
Concept ACK The URI tests need updating:
FAIL! : URITests::uriTests() 'rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W")' returned FALSE. ()
Loc: [qt/test/uritests.cpp(55)]
403 | @@ -404,7 +404,12 @@ void PaymentServer::handleURIOrFile(const QString& s) 404 | return; 405 | } 406 | 407 | - if (s.startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive)) // bitcoin: URI 408 | + if (s.startsWith("bitcoin://", Qt::CaseInsensitive)) 409 | + { 410 | + Q_EMIT message(tr("URI handling"), tr("'bitcoin://' it's not a correct URI. Use 'bitcoin:' instead."),
nit s/its/is
utACK 2ad827fd6a3a9d59a13b7226d9159929ec5ab718
utACK after squash, this should be one commit
i'm not sure if it's possible to squash all commits into single one without recreating PR
That is possible, we do it all the time. See here: https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits
Tested on macOS 10.13.3 with Qt 5.10.1 All these used
bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu?amount=1.337&message=Payment&label=Satoshi
with and without '//' as the URI. Tested master(9b8b1079ddab64ac955766536c38d23dc57bc499) "bitcoin:" : <img width="831" alt="" src="https://user-images.githubusercontent.com/863730/37697620-c30f3136-2d18-11e8-8eed-48178b0e6693.png">
master(9b8b1079ddab64ac955766536c38d23dc57bc499) "bitcoin://" : <img width="830" alt="" src="https://user-images.githubusercontent.com/863730/37697628-cc9400ec-2d18-11e8-8e4c-8cc4e3e56243.png">
This PR: 7ddb674 "bitcoin:" : <img width="828" alt="" src="https://user-images.githubusercontent.com/863730/37697729-7209ed3e-2d19-11e8-8aca-fce8c0030559.png">
7ddb674 "bitcoin://" : <img width="829" alt="" src="https://user-images.githubusercontent.com/863730/37697733-796ece14-2d19-11e8-9aea-69a8c955a5bd.png">
My only nit would be to swap 'correct' for 'valid' in "'bitcoin://' is not a correct URI". tACK 7ddb674b55b99ee645517699a4946cb841417cee
tACK b7fbcc5
This seems to cause the URI to fail, not just warn. It also affects Qt4 and Qt5 equally. Am I missing something?
I thought this logic avoided the error?