code: func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error) {
  	var filter *filters.Filter
  	if query.BlockHash != nil {
  		// Block filter requested, construct a single-shot filter
  		filter = filters.NewBlockFilter(&filterBackend{b.database, b.blockchain}, *query.BlockHash, query.Addresses, query.Topics)
  	} else {
  		// Initialize unset filter boundaried to run from genesis to chain head
  		from := int64(0)
  		if query.FromBlock != nil {
  			from = query.FromBlock.Int64()
  		}
  		to := int64(-1)
  		if query.ToBlock != nil {
  			to = query.ToBlock.Int64()
  		}
  		// Construct the range filter
  		filter = filters.NewRangeFilter(&filterBackend{b.database, b.blockchain}, from, to, query.Addresses, query.Topics)
  	}
  	// Run the filter and return all the logs
  	logs, err := filter.Logs(ctx)
  	if err != nil {
  		return nil, err
  	}
  	res := make([]types.Log, len(logs))
  	for i, log := range logs {
  		res[i] = *log
  	}
  	return res, nil
  }
docs: // FilterLogs executes a log filter operation, blocking during execution and
  // returning all the results in one batch.
  //
  // TODO(karalabe): Deprecate when the subscription one can return past data too.