ProcessingEvent_FetchNextBlockFailed.fromMap constructor

ProcessingEvent_FetchNextBlockFailed.fromMap(
  1. Map<String, dynamic> map
)

Implementation

ProcessingEvent_FetchNextBlockFailed.fromMap(Map<String, dynamic> map) {
  if (!map.containsKey('type') || map['type'] != 'FetchNextBlockFailed') {
    throw ('Wrong map data');
  } else {
    _type = 'FetchNextBlockFailed';
  }
  if (map.containsKey('shard_block_id') && (map['shard_block_id'] != null)) {
    _shard_block_id = map['shard_block_id'];
  } else {
    throw ('Wrong map data');
  }
  if (map.containsKey('message_id') && (map['message_id'] != null)) {
    _message_id = map['message_id'];
  } else {
    throw ('Wrong map data');
  }
  if (map.containsKey('message') && (map['message'] != null)) {
    _message = map['message'];
  } else {
    throw ('Wrong map data');
  }
  if (map.containsKey('error') && (map['error'] != null)) {
    _error = ClientError.fromMap(map['error']);
  } else {
    throw ('Wrong map data');
  }
}