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

View file

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