CW-834 Empty error when spending in wownero (#1870)

* CW-834 Empty error when spending in wownero * monero -> wownero

cyan committed Dec 11, 2024 at 16:03 UTC fd6801cafb6d3c61b4738e06ca7985a64d48ab35
1 file changed +12 -2
cw_wownero/lib/api/transaction_history.dart
+12 -2
@@ -181,13 +181,23 @@ void commitTransaction({required wownero.PendingTransaction transactionPointer})
181
182 final txCommit = wownero.PendingTransaction_commit(transactionPointer, filename: '', overwrite: false);
183
184 - final String? error = (() {
184 + String? error = (() {
185 final status = wownero.PendingTransaction_status(transactionPointer.cast());
186 if (status == 0) {
187 return null;
188 }
189 - return wownero.Wallet_errorString(wptr!);
189 + return wownero.PendingTransaction_errorString(transactionPointer.cast());
190 })();
191 + if (error == null) {
192 + error = (() {
193 + final status = wownero.Wallet_status(wptr!);
194 + if (status == 0) {
195 + return null;
196 + }
197 + return wownero.Wallet_errorString(wptr!);
198 + })();
199 +
200 + }
201
202 if (error != null) {
203 throw CreationTransactionException(message: error);