construct method
Ethereum log objects, returned by Construct from the supplied Map, only check for the keys we need.
Implementation
void construct(Map<String, dynamic> data) {
if (data[EthereumConstants.ethResultKey] == null) {
return;
}
if (data[EthereumConstants.ethResultKey].isNotEmpty) {
if (data[EthereumConstants.ethResultKey][0] is String) {
// Hashes
_hashes = EthereumData.toList(data[EthereumConstants.ethResultKey]);
} else {
// Logs
_logs = <EthereumLog>[];
for (final Map<String, dynamic> log
in data[EthereumConstants.ethResultKey]) {
final buildLog = <String, dynamic>{
EthereumConstants.ethResultKey: log
};
final entry = EthereumLog.fromMap(buildLog);
_logs!.add(entry);
}
}
}
}