code: def decode_event_to_internal(abi, log_event):
      
      # Note: All addresses inside the event_data must be decoded.
  
      decoded_event = decode_event(abi, log_event)
  
      if not decoded_event:
          raise UnknownEventType()
  
      # copy the attribute dict because that data structure is immutable
      data = dict(decoded_event)
      args = dict(data['args'])
  
      data['args'] = args
      # translate from web3's to raiden's name convention
      data['block_number'] = log_event.pop('blockNumber')
      data['transaction_hash'] = log_event.pop('transactionHash')
      data['block_hash'] = bytes(log_event.pop('blockHash'))
  
      assert data['block_number'], 'The event must have the block_number'
      assert data['transaction_hash'], 'The event must have the transaction hash field'
  
      event = data['event']
      if event == EVENT_TOKEN_NETWORK_CREATED:
          args['token_network_address'] = to_canonical_address(args['token_network_address'])
          args['token_address'] = to_canonical_address(args['token_address'])
  
      elif event == ChannelEvent.OPENED:
          args['participant1'] = to_canonical_address(args['participant1'])
          args['participant2'] = to_canonical_address(args['participant2'])
  
      elif event == ChannelEvent.DEPOSIT:
          args['participant'] = to_canonical_address(args['participant'])
  
      elif event == ChannelEvent.BALANCE_PROOF_UPDATED:
          args['closing_participant'] = to_canonical_address(args['closing_participant'])
  
      elif event == ChannelEvent.CLOSED:
          args['closing_participant'] = to_canonical_address(args['closing_participant'])
  
      elif event == ChannelEvent.UNLOCKED:
          args['participant'] = to_canonical_address(args['participant'])
          args['partner'] = to_canonical_address(args['partner'])
  
      return Event(
          originating_contract=to_canonical_address(log_event['address']),
          event_data=data,
      )
docs: Enforce the binary for internal usage.