Skip to content

Commit

Permalink
Less diff
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhly committed Apr 17, 2024
1 parent 3d9177d commit 338b55b
Show file tree
Hide file tree
Showing 28 changed files with 8 additions and 33 deletions.
1 change: 0 additions & 1 deletion src/solana/_layouts/vote_instructions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Byte layouts for vote program instructions."""

from enum import IntEnum

from construct import (
Expand Down
1 change: 0 additions & 1 deletion src/solana/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Exceptions native to solana-py."""

from typing import Any, Callable


Expand Down
1 change: 0 additions & 1 deletion src/solana/rpc/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""API client to interact with the Solana JSON RPC Endpoint.""" # pylint: disable=too-many-lines

from __future__ import annotations

from time import sleep, time
Expand Down
1 change: 0 additions & 1 deletion src/solana/rpc/async_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Async API client to interact with the Solana JSON RPC Endpoint.""" # pylint: disable=too-many-lines

import asyncio
from time import time
from typing import Dict, List, Optional, Sequence, Union
Expand Down
1 change: 0 additions & 1 deletion src/solana/rpc/commitment.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
In descending order of commitment (most finalized to least finalized), clients may specify:
"""

from typing import NewType

Commitment = NewType("Commitment", str)
Expand Down
1 change: 0 additions & 1 deletion src/solana/rpc/providers/async_base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Async base RPC Provider."""

from typing import Type

from solders.rpc.requests import Body
Expand Down
1 change: 0 additions & 1 deletion src/solana/rpc/providers/async_http.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Async HTTP RPC Provider."""

from typing import Dict, Optional, Tuple, Type, overload

import httpx
Expand Down
1 change: 0 additions & 1 deletion src/solana/rpc/providers/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Base RPC Provider."""

from solders.rpc.requests import Body
from typing_extensions import Type

Expand Down
1 change: 0 additions & 1 deletion src/solana/rpc/providers/core.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Helper code for HTTP provider classes."""

import itertools
import logging
import os
Expand Down
1 change: 0 additions & 1 deletion src/solana/rpc/providers/http.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""HTTP RPC Provider."""

from typing import Tuple, Type, overload

import httpx
Expand Down
1 change: 0 additions & 1 deletion src/solana/rpc/types.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""RPC types."""

from typing import NamedTuple, NewType, Optional

from solders.pubkey import Pubkey
Expand Down
1 change: 0 additions & 1 deletion src/solana/transaction.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Library to package an atomic sequence of instructions to a transaction."""

from __future__ import annotations

from typing import Any, List, NamedTuple, Optional, Sequence, Tuple, Union
Expand Down
1 change: 1 addition & 0 deletions src/solana/utils/security_txt.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Utils for security.txt."""


from dataclasses import dataclass, fields
from typing import Any, List, Optional

Expand Down
1 change: 0 additions & 1 deletion src/solana/utils/validate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Validation utilities."""

from __future__ import annotations

from enum import IntEnum
Expand Down
1 change: 0 additions & 1 deletion src/solana/vote_program.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Library to interface with the vote program."""

from __future__ import annotations

from typing import NamedTuple
Expand Down
1 change: 0 additions & 1 deletion src/spl/memo/constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Memo program constants."""

from solders.pubkey import Pubkey

MEMO_PROGRAM_ID: Pubkey = Pubkey.from_string("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr")
Expand Down
1 change: 0 additions & 1 deletion src/spl/memo/instructions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Memo program instructions."""

from __future__ import annotations

from typing import NamedTuple
Expand Down
1 change: 0 additions & 1 deletion src/spl/token/_layouts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Token instruction layouts."""

from enum import IntEnum

from construct import Bytes, Int8ul, Int32ul, Int64ul, Pass, Switch
Expand Down
6 changes: 3 additions & 3 deletions src/spl/token/instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ def decode_initialize_mint(instruction: Instruction) -> InitializeMintParams:
program_id=instruction.program_id,
mint=instruction.accounts[0].pubkey,
mint_authority=Pubkey(parsed_data.args.mint_authority),
freeze_authority=(
Pubkey(parsed_data.args.freeze_authority) if parsed_data.args.freeze_authority_option else None
),
freeze_authority=Pubkey(parsed_data.args.freeze_authority)
if parsed_data.args.freeze_authority_option
else None,
)


Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Fixtures for pytest."""

import asyncio
import time
from typing import NamedTuple
Expand Down
5 changes: 2 additions & 3 deletions tests/integration/test_async_http_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for the HTTP API Client."""

from typing import Tuple

import pytest
Expand Down Expand Up @@ -541,8 +540,8 @@ async def test_batch_request(test_http_client_async: AsyncClient):
parsers = (GetBlockHeightResp, GetFirstAvailableBlockResp)
resp: Tuple[
Resp[GetBlockHeightResp], Resp[GetFirstAvailableBlockResp]
] = await test_http_client_async._provider.make_batch_request(
] = await test_http_client_async._provider.make_batch_request( # pylint: disable=protected-access
reqs, parsers
) # pylint: disable=protected-access
)
assert_valid_response(resp[0])
assert_valid_response(resp[1])
5 changes: 2 additions & 3 deletions tests/integration/test_http_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for the HTTP API Client."""

from typing import Tuple

import pytest
Expand Down Expand Up @@ -525,8 +524,8 @@ def test_batch_request(test_http_client: Client):
parsers = (GetBlockHeightResp, GetFirstAvailableBlockResp)
resp: Tuple[
Resp[GetBlockHeightResp], Resp[GetFirstAvailableBlockResp]
] = test_http_client._provider.make_batch_request(
] = test_http_client._provider.make_batch_request( # pylint: disable=protected-access
reqs, parsers
) # pylint: disable=protected-access
)
assert_valid_response(resp[0])
assert_valid_response(resp[1])
1 change: 0 additions & 1 deletion tests/integration/test_memo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Tests for the Memo program."""

import pytest
from solders.keypair import Keypair
from solders.transaction_status import ParsedInstruction
Expand Down
1 change: 0 additions & 1 deletion tests/unit/test_async_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Test async client."""

from unittest.mock import patch

import pytest
Expand Down
1 change: 0 additions & 1 deletion tests/unit/test_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Test sync client."""

from unittest.mock import patch

import pytest
Expand Down
1 change: 0 additions & 1 deletion tests/unit/test_spl_token_instructions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Unit tests for SPL-token instructions."""

import spl.token.instructions as spl_token
from solders.pubkey import Pubkey
from spl.token.constants import TOKEN_PROGRAM_ID, WRAPPED_SOL_MINT
Expand Down
1 change: 0 additions & 1 deletion tests/unit/test_transaction.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Unit tests for solana.transaction."""

from base64 import b64decode, b64encode

import pytest
Expand Down
1 change: 0 additions & 1 deletion tests/unit/test_vote_program.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Unit tests for solana.vote_program."""

import base64

from solders.hash import Hash
Expand Down

0 comments on commit 338b55b

Please sign in to comment.