code: def attrdict_middleware(make_request, web3):
      
      def middleware(method, params):
          response = make_request(method, params)
  
          if 'result' in response:
              result = response['result']
              if is_dict(result) and not isinstance(result, AttributeDict):
                  return assoc(response, 'result', AttributeDict.recursive(result))
              else:
                  return response
          else:
              return response
      return middleware
docs: Converts any result which is a dictionary into an a