from eth_utils import (
    is_address,
    is_checksum_address,
    is_checksum_formatted_address,
    is_dict,
    is_list_like,
)


def validate_abi(abi):
    """
    Helper function for validating an ABI
    """
    if not is_list_like(abi):
        raise ValueError("'abi' is not a list")
    for e in abi:
        if not is_dict(e):
            raise ValueError("The elements of 'abi' are not all dictionaries")


def validate_address(value):
    """
    Helper function for validating an address
    """
    if not is_address(value):
        raise ValueError("'{0}' is not an address".format(value))
    validate_address_checksum(value)


def validate_address_checksum(value):
    """
    Helper function for validating an address EIP55 checksum
    """
    if is_checksum_formatted_address(value):
        if not is_checksum_address(value):
            raise ValueError("'{0}' has an invalid EIP55 checksum".format(value))

from eth_utils import (
    is_address,
    is_checksum_address,
    is_checksum_formatted_address,
    is_dict,
    is_list_like,
)


def validate_abi(abi):
    """
    Helper function for validating an ABI
    """
    if not is_list_like(abi):
        raise ValueError("'abi' is not a list")
    for e in abi:
        if not is_dict(e):
            raise ValueError("The elements of 'abi' are not all dictionaries")


def validate_address(value):
    """
    Helper function for validating an address
    """
    validate_address_checksum(value)
    if not is_address(value):
        raise ValueError("'{0}' is not an address".format(value))


def validate_address_checksum(value):
    """
    Helper function for validating an address EIP55 checksum
    """
    if is_checksum_formatted_address(value):
        if not is_checksum_address(value):
            raise ValueError("'{0}' has an invalid EIP55 checksum".format(value))

Raise error specific to address checksum failure
Raise error specific to address checksum failure

Because is_address() also checks for a valid checksum, the old code showed a generic "not an address" error if the checksum failed.
  from eth_utils import (
      is_address,
      is_checksum_address,
      is_checksum_formatted_address,
      is_dict,
      is_list_like,
  )
  
  
  def validate_abi(abi):
      """
      Helper function for validating an ABI
      """
      if not is_list_like(abi):
          raise ValueError("'abi' is not a list")
      for e in abi:
          if not is_dict(e):
              raise ValueError("The elements of 'abi' are not all dictionaries")
  
  
  def validate_address(value):
      """
      Helper function for validating an address
      """
+     validate_address_checksum(value)
      if not is_address(value):
          raise ValueError("'{0}' is not an address".format(value))
-     validate_address_checksum(value)
  
  
  def validate_address_checksum(value):
      """
      Helper function for validating an address EIP55 checksum
      """
      if is_checksum_formatted_address(value):
          if not is_checksum_address(value):
              raise ValueError("'{0}' has an invalid EIP55 checksum".format(value))
  
Raise error specific to address checksum failure
## Code Before:
from eth_utils import (
    is_address,
    is_checksum_address,
    is_checksum_formatted_address,
    is_dict,
    is_list_like,
)


def validate_abi(abi):
    """
    Helper function for validating an ABI
    """
    if not is_list_like(abi):
        raise ValueError("'abi' is not a list")
    for e in abi:
        if not is_dict(e):
            raise ValueError("The elements of 'abi' are not all dictionaries")


def validate_address(value):
    """
    Helper function for validating an address
    """
    if not is_address(value):
        raise ValueError("'{0}' is not an address".format(value))
    validate_address_checksum(value)


def validate_address_checksum(value):
    """
    Helper function for validating an address EIP55 checksum
    """
    if is_checksum_formatted_address(value):
        if not is_checksum_address(value):
            raise ValueError("'{0}' has an invalid EIP55 checksum".format(value))

## Instruction:
Raise error specific to address checksum failure
## Code After:
from eth_utils import (
    is_address,
    is_checksum_address,
    is_checksum_formatted_address,
    is_dict,
    is_list_like,
)


def validate_abi(abi):
    """
    Helper function for validating an ABI
    """
    if not is_list_like(abi):
        raise ValueError("'abi' is not a list")
    for e in abi:
        if not is_dict(e):
            raise ValueError("The elements of 'abi' are not all dictionaries")


def validate_address(value):
    """
    Helper function for validating an address
    """
    validate_address_checksum(value)
    if not is_address(value):
        raise ValueError("'{0}' is not an address".format(value))


def validate_address_checksum(value):
    """
    Helper function for validating an address EIP55 checksum
    """
    if is_checksum_formatted_address(value):
        if not is_checksum_address(value):
            raise ValueError("'{0}' has an invalid EIP55 checksum".format(value))
