Skip to content

Commit 75f36e1

Browse files
Fix Dao weights and loading
1 parent a66b92b commit 75f36e1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/tfchain_client/lib/models/dao.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ class ProposalInfo {
4545
if (entry.value == null) {
4646
args[entry.key] = entry.value;
4747
} else {
48-
args[entry.key] = String.fromCharCodes(entry.value);
48+
try {
49+
args[entry.key] = String.fromCharCodes(entry.value);
50+
} catch (e) {
51+
args[entry.key] = entry.value;
52+
}
4953
}
5054
}
5155
}

packages/tfchain_client/lib/src/dao.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ class QueryDao {
101101
final total = totalAyeWeight + totalNayeWeight;
102102
if (total > 0) {
103103
if (typeAye) {
104-
return ((totalAyeWeight / total) * 100).toInt();
104+
return ((totalAyeWeight / total) * 100).round();
105105
}
106106

107-
return ((totalNayeWeight / total) * 100).toInt();
107+
return ((totalNayeWeight / total) * 100).round();
108108
}
109109
return 0;
110110
}

0 commit comments

Comments
 (0)