Skip to content
Snippets Groups Projects
Commit 26a2c978 authored by poka's avatar poka
Browse files

Fix transaction amount parding for multi receivers

parent 231a82a4
No related branches found
No related tags found
No related merge requests found
...@@ -63,7 +63,9 @@ class HistoryProvider with ChangeNotifier { ...@@ -63,7 +63,9 @@ class HistoryProvider with ChangeNotifier {
return ''; return '';
} }
List parseHistory(txs) { // Boris: JE6mkuzSpT3ePciCPRTpuMT9fqPUVVLJz2618d33p7tn
List parseHistory(txs, _pubkey) {
var transBC = []; var transBC = [];
int i = 0; int i = 0;
...@@ -73,7 +75,15 @@ class HistoryProvider with ChangeNotifier { ...@@ -73,7 +75,15 @@ class HistoryProvider with ChangeNotifier {
for (final trans in txs) { for (final trans in txs) {
var direction = trans['direction']; var direction = trans['direction'];
final transaction = trans['node']; final transaction = trans['node'];
var output = transaction['outputs'][0]; var output;
for (String line in transaction['outputs']) {
if (line.contains(_pubkey)) {
output = line;
}
}
if (output == null) {
continue;
}
transBC.add(i); transBC.add(i);
transBC[i] = []; transBC[i] = [];
...@@ -108,7 +118,7 @@ class HistoryProvider with ChangeNotifier { ...@@ -108,7 +118,7 @@ class HistoryProvider with ChangeNotifier {
return transBC; return transBC;
} }
FetchMoreOptions checkQueryResult(result, opts) { FetchMoreOptions checkQueryResult(result, opts, _pubkey) {
final List<dynamic> blockchainTX = final List<dynamic> blockchainTX =
(result.data['txsHistoryBc']['both']['edges'] as List<dynamic>); (result.data['txsHistoryBc']['both']['edges'] as List<dynamic>);
...@@ -136,7 +146,7 @@ class HistoryProvider with ChangeNotifier { ...@@ -136,7 +146,7 @@ class HistoryProvider with ChangeNotifier {
print( print(
"###### DEBUG H Parse blockchainTX list. Cursor: $fetchMoreCursor ######"); "###### DEBUG H Parse blockchainTX list. Cursor: $fetchMoreCursor ######");
if (fetchMoreCursor != null) { if (fetchMoreCursor != null) {
transBC = parseHistory(blockchainTX); transBC = parseHistory(blockchainTX, _pubkey);
isTheEnd = false; isTheEnd = false;
} else { } else {
print("###### DEBUG H - Début de l'historique"); print("###### DEBUG H - Début de l'historique");
......
...@@ -126,7 +126,8 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier { ...@@ -126,7 +126,8 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
final num balance = _historyProvider final num balance = _historyProvider
.removeDecimalZero(result.data['balance']['amount'] / 100); .removeDecimalZero(result.data['balance']['amount'] / 100);
opts = _historyProvider.checkQueryResult(result, opts); opts = _historyProvider.checkQueryResult(
result, opts, _outputPubkey.text);
// Build history list // Build history list
// _cesiumPlusProvider.cesiumName.text = "NAMEE"; // _cesiumPlusProvider.cesiumName.text = "NAMEE";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment