fixed lookup references

This commit is contained in:
Zachary Atkins
2021-04-10 15:36:05 -05:00
parent ad62f5f1b0
commit dceeb18513
2 changed files with 5 additions and 4 deletions

View File

@@ -9,13 +9,14 @@ import 'dart:io';
class Transaction {
Transaction({required this.hash}) {
SharedPreferences.getInstance().then((s) => _id = s.getString('id') ?? '0');
SharedPreferences.getInstance()
.then((s) => _id = s.getString('userName') ?? '0');
}
late final String _id;
final String hash;
static Future<String> makeTransactionHash(String otherUserId) async {
static Future<String> signTransaction(String otherUserId) async {
String id = await SharedPreferences.getInstance()
.then((s) => s.getString('id') ?? '');
.then((s) => s.getString('userName') ?? '');
bool idLess = id.compareTo(otherUserId) < 0;
var lesser = idLess ? id : otherUserId;
var greater = idLess ? otherUserId : id;