Skip to content

Commit

Permalink
first part of fixing the imports
Browse files Browse the repository at this point in the history
  • Loading branch information
popenta committed Jan 26, 2024
1 parent 913e624 commit 92e675f
Show file tree
Hide file tree
Showing 95 changed files with 379 additions and 383 deletions.
Empty file added multiversx_sdk/__init__.py
Empty file.
20 changes: 10 additions & 10 deletions multiversx_sdk/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from multiversx_sdk_core.account import AccountNonceHolder
from multiversx_sdk_core.address import (Address, AddressComputer,
from multiversx_sdk.core.account import AccountNonceHolder
from multiversx_sdk.core.address import (Address, AddressComputer,
AddressFactory)
from multiversx_sdk_core.code_metadata import CodeMetadata
from multiversx_sdk_core.contract_query import ContractQuery
from multiversx_sdk_core.contract_query_builder import ContractQueryBuilder
from multiversx_sdk_core.message import Message, MessageComputer
from multiversx_sdk_core.token_payment import TokenPayment
from multiversx_sdk_core.tokens import (Token, TokenComputer,
from multiversx_sdk.core.code_metadata import CodeMetadata
from multiversx_sdk.core.contract_query import ContractQuery
from multiversx_sdk.core.contract_query_builder import ContractQueryBuilder
from multiversx_sdk.core.message import Message, MessageComputer
from multiversx_sdk.core.token_payment import TokenPayment
from multiversx_sdk.core.tokens import (Token, TokenComputer,
TokenIdentifierParts, TokenTransfer)
from multiversx_sdk_core.transaction import Transaction, TransactionComputer
from multiversx_sdk_core.transaction_payload import TransactionPayload
from multiversx_sdk.core.transaction import Transaction, TransactionComputer
from multiversx_sdk.core.transaction_payload import TransactionPayload

__all__ = [
"AccountNonceHolder", "Address", "AddressFactory", "AddressComputer",
Expand Down
2 changes: 1 addition & 1 deletion multiversx_sdk/core/account.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from multiversx_sdk_core.interfaces import INonce
from multiversx_sdk.core.interfaces import INonce


class AccountNonceHolder():
Expand Down
2 changes: 1 addition & 1 deletion multiversx_sdk/core/account_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from multiversx_sdk_core.account import AccountNonceHolder
from multiversx_sdk.core.account import AccountNonceHolder


def test_account_nonce_holder():
Expand Down
6 changes: 3 additions & 3 deletions multiversx_sdk/core/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

from Cryptodome.Hash import keccak

from multiversx_sdk_core import bech32
from multiversx_sdk_core.constants import DEFAULT_HRP, METACHAIN_ID
from multiversx_sdk_core.errors import ErrBadAddress, ErrBadPubkeyLength
from multiversx_sdk.core import bech32
from multiversx_sdk.core.constants import DEFAULT_HRP, METACHAIN_ID
from multiversx_sdk.core.errors import ErrBadAddress, ErrBadPubkeyLength

SC_HEX_PUBKEY_PREFIX = "0" * 16
PUBKEY_LENGTH = 32
Expand Down
4 changes: 2 additions & 2 deletions multiversx_sdk/core/address_test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

import pytest

from multiversx_sdk_core.address import (Address, AddressComputer,
from multiversx_sdk.core.address import (Address, AddressComputer,
AddressFactory, is_valid_bech32)
from multiversx_sdk_core.errors import ErrBadAddress, ErrBadPubkeyLength
from multiversx_sdk.core.errors import ErrBadAddress, ErrBadPubkeyLength


def test_address():
Expand Down
2 changes: 1 addition & 1 deletion multiversx_sdk/core/code_metadata_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


from multiversx_sdk_core.code_metadata import CodeMetadata
from multiversx_sdk.core.code_metadata import CodeMetadata


def test_code_metadata_serialize():
Expand Down
2 changes: 1 addition & 1 deletion multiversx_sdk/core/codec.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from multiversx_sdk_core.constants import INTEGER_MAX_NUM_BYTES
from multiversx_sdk.core.constants import INTEGER_MAX_NUM_BYTES


def encode_unsigned_number(arg: int) -> bytes:
Expand Down
2 changes: 1 addition & 1 deletion multiversx_sdk/core/contract_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import List, Optional, Sequence

from multiversx_sdk_core.interfaces import IAddress
from multiversx_sdk.core.interfaces import IAddress


class ContractQuery:
Expand Down
6 changes: 3 additions & 3 deletions multiversx_sdk/core/contract_query_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

from typing import Any, Optional, Sequence

from multiversx_sdk_core.contract_query import ContractQuery
from multiversx_sdk_core.interfaces import IAddress
from multiversx_sdk_core.serializer import args_to_strings
from multiversx_sdk.core.contract_query import ContractQuery
from multiversx_sdk.core.interfaces import IAddress
from multiversx_sdk.core.serializer import args_to_strings


class ContractQueryBuilder():
Expand Down
4 changes: 2 additions & 2 deletions multiversx_sdk/core/contract_query_builder_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from multiversx_sdk_core.address import Address
from multiversx_sdk_core.contract_query_builder import ContractQueryBuilder
from multiversx_sdk.core.address import Address
from multiversx_sdk.core.contract_query_builder import ContractQueryBuilder


def test_contract_query_builder():
Expand Down
4 changes: 2 additions & 2 deletions multiversx_sdk/core/message.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from Cryptodome.Hash import keccak

from multiversx_sdk_core.interfaces import IMessage
from multiversx_sdk.core.interfaces import IMessage


class Message:
Expand All @@ -11,7 +11,7 @@ def __init__(self, data: bytes, signature: bytes = b"") -> None:

class MessageComputer:
"""
Also see:
Also see:
- https://github.com/multiversx/mx-sdk-js-core/blob/v11.2.0/src/signableMessage.ts
- https://eips.ethereum.org/EIPS/eip-712 (in the past, it served as a basis for the implementation)
"""
Expand Down
2 changes: 1 addition & 1 deletion multiversx_sdk/core/message_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from multiversx_sdk_core.message import Message, MessageComputer
from multiversx_sdk.core.message import Message, MessageComputer


def test_message_v1_serialize_for_signing():
Expand Down
6 changes: 3 additions & 3 deletions multiversx_sdk/core/proto/transaction_serializer.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Protocol

import multiversx_sdk_core.proto.transaction_pb2 as ProtoTransaction
from multiversx_sdk_core.address import Address
from multiversx_sdk_core.codec import encode_unsigned_number
import multiversx_sdk.core.proto.transaction_pb2 as ProtoTransaction
from multiversx_sdk.core.address import Address
from multiversx_sdk.core.codec import encode_unsigned_number


class ITransaction(Protocol):
Expand Down
6 changes: 3 additions & 3 deletions multiversx_sdk/core/proto/transaction_serializer_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from multiversx_sdk_core.proto.transaction_serializer import ProtoSerializer
from multiversx_sdk_core.testutils.wallets import load_wallets
from multiversx_sdk_core.transaction import Transaction, TransactionComputer
from multiversx_sdk.core.proto.transaction_serializer import ProtoSerializer
from multiversx_sdk.core.transaction import Transaction, TransactionComputer
from multiversx_sdk.testutils.wallets import load_wallets


class TestProtoSerializer:
Expand Down
7 changes: 4 additions & 3 deletions multiversx_sdk/core/serializer.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from typing import Any, List, Protocol, Sequence, runtime_checkable

from multiversx_sdk_core.codec import encode_unsigned_number, encode_signed_number
from multiversx_sdk_core.constants import ARGS_SEPARATOR
from multiversx_sdk_core.errors import ErrCannotSerializeArgument
from multiversx_sdk.core.codec import (encode_signed_number,
encode_unsigned_number)
from multiversx_sdk.core.constants import ARGS_SEPARATOR
from multiversx_sdk.core.errors import ErrCannotSerializeArgument


@runtime_checkable
Expand Down
6 changes: 3 additions & 3 deletions multiversx_sdk/core/token_payment.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from decimal import ROUND_DOWN, Context, Decimal, localcontext
from typing import Union

from multiversx_sdk_core import typecheck
from multiversx_sdk_core.constants import (EGLD_NUM_DECIMALS,
from multiversx_sdk.core import typecheck
from multiversx_sdk.core.constants import (EGLD_NUM_DECIMALS,
EGLD_TOKEN_IDENTIFIER)
from multiversx_sdk_core.interfaces import INonce, ITokenIdentifier
from multiversx_sdk.core.interfaces import INonce, ITokenIdentifier


class TokenPayment:
Expand Down
2 changes: 1 addition & 1 deletion multiversx_sdk/core/token_payment_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest

from multiversx_sdk_core.token_payment import TokenPayment
from multiversx_sdk.core.token_payment import TokenPayment


def test_with_egld():
Expand Down
8 changes: 4 additions & 4 deletions multiversx_sdk/core/tokens.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import List

from multiversx_sdk_core.codec import (decode_unsigned_number,
from multiversx_sdk.core.codec import (decode_unsigned_number,
encode_unsigned_number)
from multiversx_sdk_core.constants import TOKEN_RANDOM_SEQUENCE_LENGTH
from multiversx_sdk_core.errors import (BadUsageError,
from multiversx_sdk.core.constants import TOKEN_RANDOM_SEQUENCE_LENGTH
from multiversx_sdk.core.errors import (BadUsageError,
InvalidTokenIdentifierError)
from multiversx_sdk_core.interfaces import IToken, ITokenIdentifierParts
from multiversx_sdk.core.interfaces import IToken, ITokenIdentifierParts


class Token:
Expand Down
4 changes: 2 additions & 2 deletions multiversx_sdk/core/tokens_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from multiversx_sdk_core.errors import BadUsageError
from multiversx_sdk_core.tokens import (Token, TokenComputer,
from multiversx_sdk.core.errors import BadUsageError
from multiversx_sdk.core.tokens import (Token, TokenComputer,
TokenIdentifierParts)


Expand Down
8 changes: 4 additions & 4 deletions multiversx_sdk/core/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
from hashlib import blake2b
from typing import Any, Dict, Optional, Protocol

from multiversx_sdk_core.constants import (DEFAULT_HRP, DIGEST_SIZE,
from multiversx_sdk.core.constants import (DEFAULT_HRP, DIGEST_SIZE,
TRANSACTION_MIN_GAS_PRICE,
TRANSACTION_OPTIONS_DEFAULT,
TRANSACTION_VERSION_DEFAULT)
from multiversx_sdk_core.errors import NotEnoughGasError
from multiversx_sdk_core.interfaces import INetworkConfig, ITransaction
from multiversx_sdk_core.proto.transaction_serializer import ProtoSerializer
from multiversx_sdk.core.errors import NotEnoughGasError
from multiversx_sdk.core.interfaces import INetworkConfig, ITransaction
from multiversx_sdk.core.proto.transaction_serializer import ProtoSerializer


class IAddressConverter(Protocol):
Expand Down
14 changes: 7 additions & 7 deletions multiversx_sdk/core/transaction_builders/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

from multiversx_sdk_core.transaction_builders.contract_builders import (
from multiversx_sdk.core.transaction_builders.contract_builders import (
ContractCallBuilder, ContractDeploymentBuilder, ContractUpgradeBuilder)
from multiversx_sdk_core.transaction_builders.default_configuration import \
from multiversx_sdk.core.transaction_builders.default_configuration import \
DefaultTransactionBuildersConfiguration
from multiversx_sdk_core.transaction_builders.esdt_builders import \
from multiversx_sdk.core.transaction_builders.esdt_builders import \
ESDTIssueBuilder
from multiversx_sdk_core.transaction_builders.relayed_v1_builder import \
from multiversx_sdk.core.transaction_builders.relayed_v1_builder import \
RelayedTransactionV1Builder
from multiversx_sdk_core.transaction_builders.relayed_v2_builder import \
from multiversx_sdk.core.transaction_builders.relayed_v2_builder import \
RelayedTransactionV2Builder
from multiversx_sdk_core.transaction_builders.transaction_builder import \
from multiversx_sdk.core.transaction_builders.transaction_builder import \
TransactionBuilder
from multiversx_sdk_core.transaction_builders.transfers_builders import (
from multiversx_sdk.core.transaction_builders.transfers_builders import (
EGLDTransferBuilder, ESDTNFTTransferBuilder, ESDTTransferBuilder,
MultiESDTNFTTransferBuilder)

Expand Down
8 changes: 4 additions & 4 deletions multiversx_sdk/core/transaction_builders/contract_builders.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any, List, Optional, Protocol, Sequence

from multiversx_sdk_core.constants import VM_TYPE_WASM_VM
from multiversx_sdk_core.interfaces import (IAddress, ICodeMetadata, IGasLimit,
from multiversx_sdk.core.constants import VM_TYPE_WASM_VM
from multiversx_sdk.core.interfaces import (IAddress, ICodeMetadata, IGasLimit,
IGasPrice, INonce, ITokenPayment,
ITransactionValue)
from multiversx_sdk_core.serializer import arg_to_string, args_to_strings
from multiversx_sdk_core.transaction_builders.transaction_builder import (
from multiversx_sdk.core.serializer import arg_to_string, args_to_strings
from multiversx_sdk.core.transaction_builders.transaction_builder import (
ITransactionBuilderConfiguration, TransactionBuilder)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from typing import List

from multiversx_sdk_core.address import Address
from multiversx_sdk_core.code_metadata import CodeMetadata
from multiversx_sdk_core.interfaces import ITokenPayment
from multiversx_sdk_core.token_payment import TokenPayment
from multiversx_sdk_core.transaction_builders.contract_builders import (
from multiversx_sdk.core.address import Address
from multiversx_sdk.core.code_metadata import CodeMetadata
from multiversx_sdk.core.interfaces import ITokenPayment
from multiversx_sdk.core.token_payment import TokenPayment
from multiversx_sdk.core.transaction_builders.contract_builders import (
ContractCallBuilder, ContractDeploymentBuilder, ContractUpgradeBuilder)
from multiversx_sdk_core.transaction_builders.default_configuration import \
from multiversx_sdk.core.transaction_builders.default_configuration import \
DefaultTransactionBuildersConfiguration

dummyConfig = DefaultTransactionBuildersConfiguration(chain_id="D")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dataclasses import dataclass

from multiversx_sdk_core.address import Address
from multiversx_sdk_core.interfaces import (IAddress, IChainID, IGasPrice,
from multiversx_sdk.core.address import Address
from multiversx_sdk.core.interfaces import (IAddress, IChainID, IGasPrice,
ITransactionValue)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from multiversx_sdk_core.transaction_builders.default_configuration import \
from multiversx_sdk.core.transaction_builders.default_configuration import \
DefaultTransactionBuildersConfiguration


Expand Down
6 changes: 3 additions & 3 deletions multiversx_sdk/core/transaction_builders/esdt_builders.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import List, Optional, Protocol

from multiversx_sdk_core.interfaces import (IAddress, IGasLimit, IGasPrice,
from multiversx_sdk.core.interfaces import (IAddress, IGasLimit, IGasPrice,
INonce, ITransactionValue)
from multiversx_sdk_core.serializer import arg_to_string, args_to_strings
from multiversx_sdk_core.transaction_builders.transaction_builder import (
from multiversx_sdk.core.serializer import arg_to_string, args_to_strings
from multiversx_sdk.core.transaction_builders.transaction_builder import (
ITransactionBuilderConfiguration, TransactionBuilder)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

from multiversx_sdk_core.address import Address
from multiversx_sdk_core.transaction_builders.default_configuration import \
from multiversx_sdk.core.address import Address
from multiversx_sdk.core.transaction_builders.default_configuration import \
DefaultTransactionBuildersConfiguration
from multiversx_sdk_core.transaction_builders.esdt_builders import \
from multiversx_sdk.core.transaction_builders.esdt_builders import \
ESDTIssueBuilder

dummyConfig = DefaultTransactionBuildersConfiguration(chain_id="D")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import json
from typing import Any, Dict, Optional

from multiversx_sdk_core.address import Address
from multiversx_sdk_core.errors import ErrInvalidRelayerV1BuilderArguments
from multiversx_sdk_core.interfaces import (IAddress, INetworkConfig, INonce,
from multiversx_sdk.core.address import Address
from multiversx_sdk.core.errors import ErrInvalidRelayerV1BuilderArguments
from multiversx_sdk.core.interfaces import (IAddress, INetworkConfig, INonce,
ITransactionOptions,
ITransactionVersion)
from multiversx_sdk_core.transaction import Transaction
from multiversx_sdk.core.transaction import Transaction


class RelayedTransactionV1Builder:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import pytest

from multiversx_sdk_core import TokenPayment
from multiversx_sdk_core.address import Address
from multiversx_sdk_core.errors import ErrInvalidRelayerV1BuilderArguments
from multiversx_sdk_core.testutils.wallets import load_wallets
from multiversx_sdk_core.transaction import Transaction, TransactionComputer
from multiversx_sdk_core.transaction_builders.relayed_v1_builder import \
from multiversx_sdk.core.address import Address
from multiversx_sdk.core.errors import ErrInvalidRelayerV1BuilderArguments
from multiversx_sdk.core.token_payment import TokenPayment
from multiversx_sdk.core.transaction import Transaction, TransactionComputer
from multiversx_sdk.core.transaction_builders.relayed_v1_builder import \
RelayedTransactionV1Builder
from multiversx_sdk.testutils.wallets import load_wallets


class NetworkConfig:
Expand Down
12 changes: 6 additions & 6 deletions multiversx_sdk/core/transaction_builders/relayed_v2_builder.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from typing import Any, List, Optional

from multiversx_sdk_core.address import Address
from multiversx_sdk_core.errors import (ErrInvalidGasLimitForInnerTransaction,
from multiversx_sdk.core.address import Address
from multiversx_sdk.core.errors import (ErrInvalidGasLimitForInnerTransaction,
ErrInvalidRelayerV2BuilderArguments)
from multiversx_sdk_core.interfaces import (IAddress, IGasLimit,
from multiversx_sdk.core.interfaces import (IAddress, IGasLimit,
INetworkConfig, INonce)
from multiversx_sdk_core.serializer import args_to_string
from multiversx_sdk_core.transaction import Transaction
from multiversx_sdk_core.transaction_payload import TransactionPayload
from multiversx_sdk.core.serializer import args_to_string
from multiversx_sdk.core.transaction import Transaction
from multiversx_sdk.core.transaction_payload import TransactionPayload


class RelayedTransactionV2Builder:
Expand Down
Loading

0 comments on commit 92e675f

Please sign in to comment.