Skip to content

Commit

Permalink
Use our own errors
Browse files Browse the repository at this point in the history
  • Loading branch information
thewhaleking committed Dec 16, 2024
1 parent e00c941 commit f432ef6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
14 changes: 12 additions & 2 deletions bittensor/core/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,22 @@

from typing import Optional, TYPE_CHECKING

from substrateinterface.exceptions import SubstrateRequestException

if TYPE_CHECKING:
from bittensor.core.synapse import Synapse


class SubstrateRequestException(Exception):
pass


class BlockNotFound(Exception):
pass


class ExtrinsicNotFound(Exception):
pass


class ChainError(SubstrateRequestException):
"""Base error for any chain related errors."""

Expand Down
10 changes: 5 additions & 5 deletions bittensor/utils/substrate_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
from scalecodec.base import ScaleBytes, ScaleType, RuntimeConfigurationObject
from scalecodec.type_registry import load_type_registry_preset
from scalecodec.types import GenericCall, GenericRuntimeCallDefinition
from substrateinterface.exceptions import (
SubstrateRequestException,
ExtrinsicNotFound,
BlockNotFound,
)
from substrateinterface.storage import StorageKey
from websockets.asyncio.client import connect
from websockets.exceptions import ConnectionClosed

from bittensor.core.errors import (
SubstrateRequestException,
ExtrinsicNotFound,
BlockNotFound,
)
from bittensor.utils import hex_to_bytes
from bittensor.utils.btlogging import logging

Expand Down

0 comments on commit f432ef6

Please sign in to comment.