Skip to content

Commit

Permalink
feat: delete InputUtxo unnecessary adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
gabaldon committed Feb 29, 2024
1 parent ed8d65c commit bba67c0
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions lib/src/network/explorer/explorer_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1175,27 +1175,11 @@ class InputUtxo {
};
}

factory InputUtxo.fromExplorerJson(Map<String, dynamic> json) => InputUtxo(
factory InputUtxo.fromJson(Map<String, dynamic> json) => InputUtxo(
address: json["address"],
inputUtxo: json["input_utxo"],
value: json["value"]);

// TODO: move this to myWitWallet
factory InputUtxo.fromDBJson(Map<String, dynamic> json) => InputUtxo(
address: json["pkh"],
inputUtxo: json["output_pointer"],
value: json["value"]);

factory InputUtxo.fromJson(Map<String, dynamic> json) {
bool dbJson = json["pkh"] != null;
if (dbJson) {
// TODO: move this to myWitWallet
return InputUtxo.fromDBJson(json);
} else {
return InputUtxo.fromExplorerJson(json);
}
}

@override
String toString() {
// TODO: implement toString
Expand Down

0 comments on commit bba67c0

Please sign in to comment.