tx parsing fix

This commit is contained in:
julian 2023-03-01 15:19:53 -06:00
parent bfbf175f44
commit 11177b50c3
2 changed files with 8 additions and 7 deletions

View file

@ -168,8 +168,8 @@ class EthereumWallet extends CoinServiceAPI
@override @override
Future<String> get currentReceivingAddress async { Future<String> get currentReceivingAddress async {
final address = await _currentReceivingAddress; final address = await _currentReceivingAddress;
return address?.value ?? return checksumEthereumAddress(
checksumEthereumAddress(_credentials.address.toString()); address?.value ?? _credentials.address.toString());
} }
Future<Address?> get _currentReceivingAddress => db Future<Address?> get _currentReceivingAddress => db
@ -569,7 +569,8 @@ class EthereumWallet extends CoinServiceAPI
var allOwnAddresses = await _fetchAllOwnAddresses(); var allOwnAddresses = await _fetchAllOwnAddresses();
AddressTransaction addressTransactions = AddressTransaction addressTransactions =
await EthereumAPI.fetchAddressTransactions( await EthereumAPI.fetchAddressTransactions(
allOwnAddresses.elementAt(0).value, "txlist"); allOwnAddresses.elementAt(0).value,
);
if (addressTransactions.message == "OK") { if (addressTransactions.message == "OK") {
final allTxs = addressTransactions.result; final allTxs = addressTransactions.result;
for (final element in allTxs) { for (final element in allTxs) {
@ -845,7 +846,7 @@ class EthereumWallet extends CoinServiceAPI
String thisAddress = await currentReceivingAddress; String thisAddress = await currentReceivingAddress;
AddressTransaction txs = AddressTransaction txs =
await EthereumAPI.fetchAddressTransactions(thisAddress, "txlist"); await EthereumAPI.fetchAddressTransactions(thisAddress);
if (txs.message == "OK") { if (txs.message == "OK") {
final allTxs = txs.result; final allTxs = txs.result;
@ -875,7 +876,7 @@ class EthereumWallet extends CoinServiceAPI
final txn = Transaction( final txn = Transaction(
walletId: walletId, walletId: walletId,
txid: element["hash"] as String, txid: element["hash"] as String,
timestamp: element["timeStamp"] as int, timestamp: int.parse(element["timeStamp"].toString()),
type: type:
isIncoming ? TransactionType.incoming : TransactionType.outgoing, isIncoming ? TransactionType.incoming : TransactionType.outgoing,
subType: TransactionSubType.none, subType: TransactionSubType.none,

View file

@ -86,8 +86,8 @@ class EthereumTokenService extends ChangeNotifier with EthTokenCache {
Future<String> get currentReceivingAddress async { Future<String> get currentReceivingAddress async {
final address = await _currentReceivingAddress; final address = await _currentReceivingAddress;
return address?.value ?? return checksumEthereumAddress(
checksumEthereumAddress(_credentials.address.toString()); address?.value ?? _credentials.address.toString());
} }
Future<Address?> get _currentReceivingAddress => ethWallet.db Future<Address?> get _currentReceivingAddress => ethWallet.db