Skip to content

Commit

Permalink
feat: PragmaAPIClient clean up (#113)
Browse files Browse the repository at this point in the history
* feat: refactor offchain mixin into PragmaAPIClient

* fix: format

* fix: leftover

* fix: interval enum

* fix: vrf test

---------

Co-authored-by: JordyRo1 <jordy.romu@orange.fr>
  • Loading branch information
EvolveArt and JordyRo1 authored Jun 14, 2024
1 parent bd6ffb7 commit 81e6c13
Show file tree
Hide file tree
Showing 9 changed files with 162 additions and 283 deletions.
12 changes: 0 additions & 12 deletions pragma/core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from pragma.core.contract import Contract
from pragma.core.mixins import (
NonceMixin,
OffchainMixin,
OracleMixin,
PublisherRegistryMixin,
RandomnessMixin,
Expand All @@ -18,7 +17,6 @@
from pragma.core.types import (
CHAIN_IDS,
CONTRACT_ADDRESSES,
PRAGMA_API_URL,
ClientException,
ContractAddresses,
get_client_from_network,
Expand All @@ -34,7 +32,6 @@ class PragmaClient(
OracleMixin,
PublisherRegistryMixin,
TransactionMixin,
OffchainMixin,
RandomnessMixin,
):
is_user_client: bool = False
Expand All @@ -50,8 +47,6 @@ def __init__(
contract_addresses_config: Optional[ContractAddresses] = None,
port: Optional[int] = None,
chain_name: Optional[str] = None,
api_url: Optional[str] = PRAGMA_API_URL,
api_key: Optional[str] = None,
):
"""
Client for interacting with Pragma on Starknet.
Expand All @@ -65,14 +60,7 @@ def __init__(
:param port: Optional port to interact with local node. Will default to 5050.
:param chain_name: A str-representation of the chain if a URL string is given for `network`.
Must be one of ``"mainnet"``, ``"sepolia"``, ``"pragma_testnet"``, ``"sharingan"`` or ``"devnet"``.
:param api_url: Optional URL for the Pragma API. Defaults to http://localhost:8080
:param api_key: Optional API key for the Pragma API.
"""
self.ssl_context = None
self.api_url = api_url

if api_key is not None:
self.api_key = api_key

full_node_client: FullNodeClient = get_client_from_network(network, port=port)
self.full_node_client = full_node_client
Expand Down
1 change: 0 additions & 1 deletion pragma/core/mixins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from pragma.core.mixins.nonce import NonceMixin
from pragma.core.mixins.offchain import OffchainMixin
from pragma.core.mixins.oracle import OracleMixin
from pragma.core.mixins.publisher_registry import PublisherRegistryMixin
from pragma.core.mixins.randomness import RandomnessMixin
Expand Down
225 changes: 0 additions & 225 deletions pragma/core/mixins/offchain.py

This file was deleted.

1 change: 0 additions & 1 deletion pragma/publisher/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
from .client import PragmaAPIClient, PragmaPublisherClient
Loading

0 comments on commit 81e6c13

Please sign in to comment.