File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -361,12 +361,22 @@ class XelisWallet extends LibXelisWallet {
361361 await libXelisWallet! .rescan (topoheight: BigInt .from (pruningHeight));
362362 }
363363
364- final txList = objTransactions ??
365- (await libXelisWallet! .allHistory ())
366- .map ((jsonStr) => xelis_sdk.TransactionEntry .fromJson (
367- json.decode (jsonStr),
368- ) as xelis_sdk.TransactionEntry )
369- .toList ();
364+ xelis_sdk.TransactionEntry _checkDecodeJsonStringTxEntry (
365+ String jsonString,
366+ ) {
367+ final json = jsonDecode (jsonString);
368+ if (json is Map ) {
369+ return xelis_sdk.TransactionEntry .fromJson (json.cast ());
370+ }
371+
372+ throw Exception ("Not a Map on jsonDecode($jsonString )" );
373+ }
374+
375+ final txList =
376+ objTransactions ??
377+ (await libXelisWallet! .allHistory ())
378+ .map (_checkDecodeJsonStringTxEntry)
379+ .toList ();
370380
371381 final List <TransactionV2 > txns = [];
372382
You can’t perform that action at this time.
0 commit comments