show failed instead of cancelled for eth failed txns

This commit is contained in:
julian 2023-07-20 15:08:43 -06:00
parent 69aa1fb885
commit 8a84c89824

View file

@ -358,7 +358,6 @@ class _TransactionDetailsViewState
final currentHeight = ref.watch(walletsChangeNotifierProvider final currentHeight = ref.watch(walletsChangeNotifierProvider
.select((value) => value.getManager(walletId).currentHeight)); .select((value) => value.getManager(walletId).currentHeight));
print("THIS TRANSACTION IS $_transaction"); print("THIS TRANSACTION IS $_transaction");
return ConditionalParent( return ConditionalParent(
@ -474,7 +473,9 @@ class _TransactionDetailsViewState
), ),
SelectableText( SelectableText(
_transaction.isCancelled _transaction.isCancelled
? "Cancelled" ? coin == Coin.ethereum
? "Failed"
: "Cancelled"
: whatIsIt( : whatIsIt(
_transaction, _transaction,
currentHeight, currentHeight,
@ -585,7 +586,9 @@ class _TransactionDetailsViewState
// child: // child:
SelectableText( SelectableText(
_transaction.isCancelled _transaction.isCancelled
? "Cancelled" ? coin == Coin.ethereum
? "Failed"
: "Cancelled"
: whatIsIt( : whatIsIt(
_transaction, _transaction,
currentHeight, currentHeight,
@ -781,8 +784,8 @@ class _TransactionDetailsViewState
isDesktop isDesktop
? const _Divider() ? const _Divider()
: const SizedBox( : const SizedBox(
height: 12, height: 12,
), ),
if (coin == Coin.epicCash) if (coin == Coin.epicCash)
RoundedWhiteContainer( RoundedWhiteContainer(
padding: isDesktop padding: isDesktop
@ -790,22 +793,22 @@ class _TransactionDetailsViewState
: const EdgeInsets.all(12), : const EdgeInsets.all(12),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"On chain note", "On chain note",
style: isDesktop style: isDesktop
? STextStyles ? STextStyles
.desktopTextExtraExtraSmall( .desktopTextExtraExtraSmall(
context) context)
: STextStyles.itemSubtitle( : STextStyles.itemSubtitle(
context), context),
), ),
const SizedBox( const SizedBox(
height: 8, height: 8,
@ -814,18 +817,16 @@ class _TransactionDetailsViewState
_transaction.otherData ?? "", _transaction.otherData ?? "",
style: isDesktop style: isDesktop
? STextStyles ? STextStyles
.desktopTextExtraExtraSmall( .desktopTextExtraExtraSmall(
context) context)
.copyWith( .copyWith(
color: Theme.of( color: Theme.of(context)
context) .extension<
.extension< StackColors>()!
StackColors>()! .textDark,
.textDark, )
) : STextStyles.itemSubtitle12(
: STextStyles context),
.itemSubtitle12(
context),
), ),
], ],
), ),
@ -854,7 +855,9 @@ class _TransactionDetailsViewState
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
(coin == Coin.epicCash) ? "Local Note" : "Note ", (coin == Coin.epicCash)
? "Local Note"
: "Note ",
style: isDesktop style: isDesktop
? STextStyles ? STextStyles
.desktopTextExtraExtraSmall( .desktopTextExtraExtraSmall(
@ -923,7 +926,9 @@ class _TransactionDetailsViewState
notesServiceChangeNotifierProvider( notesServiceChangeNotifierProvider(
walletId) walletId)
.select((value) => value.getNoteFor( .select((value) => value.getNoteFor(
txid: (coin == Coin.epicCash)? _transaction.slateId! : _transaction.txid ))), txid: (coin == Coin.epicCash)
? _transaction.slateId!
: _transaction.txid))),
builder: (builderContext, builder: (builderContext,
AsyncSnapshot<String> snapshot) { AsyncSnapshot<String> snapshot) {
if (snapshot.connectionState == if (snapshot.connectionState ==