standard firo send fixes

This commit is contained in:
julian 2023-12-18 12:53:11 -06:00
parent 4e96ce5438
commit cdd9b30cb7
2 changed files with 19 additions and 10 deletions

View file

@ -142,15 +142,14 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
if ((coin == Coin.firo || coin == Coin.firoTestNet)) { if ((coin == Coin.firo || coin == Coin.firoTestNet)) {
if (ref.read(publicPrivateBalanceStateProvider.state).state == if (ref.read(publicPrivateBalanceStateProvider.state).state ==
"Private") { "Private") {
availableBalance = wallet.info.cachedBalance.spendable; availableBalance = wallet.info.cachedBalanceSecondary.spendable;
// (manager.wallet as FiroWallet).availablePrivateBalance(); // (manager.wallet as FiroWallet).availablePrivateBalance();
} else { } else {
availableBalance = wallet.info.cachedBalanceSecondary.spendable; availableBalance = wallet.info.cachedBalance.spendable;
// (manager.wallet as FiroWallet).availablePublicBalance(); // (manager.wallet as FiroWallet).availablePublicBalance();
} }
} else { } else {
availableBalance = wallet.info.cachedBalance.spendable; availableBalance = wallet.info.cachedBalance.spendable;
;
} }
final coinControlEnabled = final coinControlEnabled =
@ -821,7 +820,7 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
const SizedBox( const SizedBox(
height: 4, height: 4,
), ),
if (coin == Coin.firo) if (coin == Coin.firo || coin == Coin.firoTestNet)
Text( Text(
"Send from", "Send from",
style: STextStyles.desktopTextExtraSmall(context).copyWith( style: STextStyles.desktopTextExtraSmall(context).copyWith(
@ -831,11 +830,11 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
), ),
textAlign: TextAlign.left, textAlign: TextAlign.left,
), ),
if (coin == Coin.firo) if (coin == Coin.firo || coin == Coin.firoTestNet)
const SizedBox( const SizedBox(
height: 10, height: 10,
), ),
if (coin == Coin.firo) if (coin == Coin.firo || coin == Coin.firoTestNet)
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
child: DropdownButton2( child: DropdownButton2(
isExpanded: true, isExpanded: true,
@ -917,7 +916,7 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
), ),
), ),
), ),
if (coin == Coin.firo) if (coin == Coin.firo || coin == Coin.firoTestNet)
const SizedBox( const SizedBox(
height: 20, height: 20,
), ),
@ -1486,7 +1485,7 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
.read( .read(
publicPrivateBalanceStateProvider publicPrivateBalanceStateProvider
.state) .state)
.state != .state ==
"Private") { "Private") {
throw UnimplementedError("FIXME"); throw UnimplementedError("FIXME");
// TODO: [prio=high] firo fee fix // TODO: [prio=high] firo fee fix

View file

@ -625,9 +625,19 @@ mixin ElectrumXInterface on Bip39HDWallet {
// TODO: use coinlib // TODO: use coinlib
final txb = bitcoindart.TransactionBuilder( final txb = bitcoindart.TransactionBuilder(
network: bitcoindart.testnet, network: bitcoindart.NetworkType(
messagePrefix: cryptoCurrency.networkParams.messagePrefix,
bech32: cryptoCurrency.networkParams.bech32Hrp,
bip32: bitcoindart.Bip32Type(
public: cryptoCurrency.networkParams.pubHDPrefix,
private: cryptoCurrency.networkParams.privHDPrefix,
),
pubKeyHash: cryptoCurrency.networkParams.p2pkhPrefix,
scriptHash: cryptoCurrency.networkParams.p2shPrefix,
wif: cryptoCurrency.networkParams.wifPrefix,
),
); );
txb.setVersion(1); txb.setVersion(1); // TODO possibly override this for certain coins?
// Add transaction inputs // Add transaction inputs
for (var i = 0; i < utxoSigningData.length; i++) { for (var i = 0; i < utxoSigningData.length; i++) {