Network.fromJson constructor
Network.fromJson(
- Map<String, dynamic> json
)
Implementation
factory Network.fromJson(Map<String, dynamic> json) {
Batch lastBatch = Batch.fromJson(json['lastBatch']);
var forgersFromJson = json['nextForgers'] as List;
List<Forger> forgersList =
forgersFromJson.map((i) => Forger.fromJson(i)).toList();
return Network(
lastEthereumBlock: json['lastEthereumBlock'],
lastSynchedBlock: json['lastSynchedBlock'],
lastBatch: lastBatch,
currentSlot: json['currentSlot'],
nextForgers: forgersList,
);
}