Skip to content

Commit

Permalink
app: Fix type error in eth transaction serialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
patniemeyer committed Nov 21, 2024
1 parent 0ca99db commit 6436d99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions gui-orchid/lib/api/orchid_eth/eth_transaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ class EthereumTransaction /*extends EthereumTransactionParams*/ {
Map<String, dynamic> toJson() {
// Export flat json
var json = params.toJson();
json.addAll(<String, dynamic>{'data': data});
json['data'] = data;

// Exclude nonce if null
if (nonce != null) {
json.addAll({
'nonce': nonce, // decimal int
});
json['nonce'] = nonce;
}
return json;
}
Expand All @@ -34,8 +33,7 @@ class EthereumTransaction /*extends EthereumTransactionParams*/ {
@override
bool operator ==(Object other) =>
identical(this, other) ||
super == other &&
other is EthereumTransaction &&
other is EthereumTransaction &&
runtimeType == other.runtimeType &&
params == other.params &&
data == other.data &&
Expand Down
1 change: 1 addition & 0 deletions gui-orchid/test/pac_transaction_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:flutter_test/flutter_test.dart';
import 'package:orchid/api/orchid_crypto.dart';
import 'package:orchid/api/orchid_eth/eth_transaction.dart';
import 'package:orchid/api/orchid_keys.dart';
import 'package:orchid/vpn/purchase/orchid_pac_transaction.dart';

import 'expect.dart';
Expand Down

0 comments on commit 6436d99

Please sign in to comment.