manually add bch uri fixes from 28da2b8900

This commit is contained in:
julian 2022-11-10 09:54:58 -06:00
parent 9d7a052ca0
commit be952d3e35
2 changed files with 25 additions and 6 deletions

View file

@ -111,9 +111,17 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
queryParams["message"] = noteString;
}
String receivingAddress = widget.receivingAddress;
if ((widget.coin == Coin.bitcoincash ||
widget.coin == Coin.bitcoincashTestnet) &&
receivingAddress.contains(":")) {
// remove cash addr prefix
receivingAddress = receivingAddress.split(":").sublist(1).join();
}
final uriString = AddressUtils.buildUriString(
widget.coin,
widget.receivingAddress,
receivingAddress,
queryParams,
);
@ -225,10 +233,21 @@ class _GenerateUriQrCodeViewState extends State<GenerateUriQrCodeView> {
@override
void initState() {
isDesktop = Util.isDesktop;
_uriString = Uri(
scheme: widget.coin.uriScheme,
host: widget.receivingAddress,
).toString().replaceFirst("://", ":");
String receivingAddress = widget.receivingAddress;
if ((widget.coin == Coin.bitcoincash ||
widget.coin == Coin.bitcoincashTestnet) &&
receivingAddress.contains(":")) {
// remove cash addr prefix
receivingAddress = receivingAddress.split(":").sublist(1).join();
}
_uriString = AddressUtils.buildUriString(
widget.coin,
receivingAddress,
{},
);
amountController = TextEditingController();
noteController = TextEditingController();
super.initState();

View file

@ -132,7 +132,7 @@ extension CoinExt on Coin {
case Coin.litecoinTestNet:
return "litecoin";
case Coin.bitcoincashTestnet:
return "bitcoincash";
return "bchtest";
case Coin.firoTestNet:
return "firo";
case Coin.dogecoinTestNet: