Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proto files moved to a separate proto module. #42

Merged
merged 33 commits into from
Aug 17, 2021
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b34d393
Proto files moved to a separate proto module.
panasevychol Aug 12, 2021
2f7edce
Imports fixed.
panasevychol Aug 12, 2021
7d90930
Imports fixed with isort.
panasevychol Aug 12, 2021
14873f3
Manifest updated.
panasevychol Aug 12, 2021
5e510f9
Mypy ignored Proto module.
panasevychol Aug 12, 2021
c0925ed
Imports fixed.
panasevychol Aug 12, 2021
1795670
Proto imports fixed.
panasevychol Aug 12, 2021
124b483
Package docstring added.
panasevychol Aug 12, 2021
32de8dc
Makefile updated.
panasevychol Aug 12, 2021
0f91d72
chore: restructure and refactor
5A11 Aug 16, 2021
42565b9
fix: examples, manifest, setup.py
5A11 Aug 16, 2021
f040e98
fix: makefile
5A11 Aug 16, 2021
d919cc7
Makefile fi
MissingNO57 Aug 17, 2021
4a4d17e
tox.ini fix
MissingNO57 Aug 17, 2021
08c101d
fix
MissingNO57 Aug 17, 2021
515d8bd
import fixes
MissingNO57 Aug 17, 2021
348f53b
Import fixes
MissingNO57 Aug 17, 2021
5cac6b9
Fixes
MissingNO57 Aug 17, 2021
a66df5c
changes
MissingNO57 Aug 17, 2021
8a2384c
Copyright check
MissingNO57 Aug 17, 2021
52e49a5
copyright checks
MissingNO57 Aug 17, 2021
9d6682d
changes
MissingNO57 Aug 17, 2021
d35842c
Fixes
MissingNO57 Aug 17, 2021
5653d66
More fixes
MissingNO57 Aug 17, 2021
dd7e5ef
fix
MissingNO57 Aug 17, 2021
7878f3f
pylint fix
MissingNO57 Aug 17, 2021
45d0ab4
Copyright setup.py
MissingNO57 Aug 17, 2021
9af6624
comment
MissingNO57 Aug 17, 2021
fa3db0c
setup.py checks
MissingNO57 Aug 17, 2021
0405aee
setup.cfg
MissingNO57 Aug 17, 2021
9097585
module docstring
MissingNO57 Aug 17, 2021
48a57a9
pack fix
MissingNO57 Aug 17, 2021
c9f1237
Piplock update
MissingNO57 Aug 17, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ build/

# Tox files
.tox

.DS_Store
*/.DS_Store
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ recursive-include contracts *.wasm
recursive-include examples *.py
recursive-include scripts *.py
recursive-include scripts *.sh
recursive-include src *.py
recursive-include pycosm *.py
recursive-include tests *.py
recursive-include tests *.wasm
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ WASMD_VERSION := v0.16.0
COSMOS_PROTO_RELATIVE_DIRS := proto third_party/proto
WASMD_PROTO_RELATIVE_DIRS := proto
SOURCES_REGEX_TO_EXCLUDE := third_party/proto/google/.*
OUTPUT_FOLDER := src
PYCOSM_SRC_DIR := src/cosm
OUTPUT_FOLDER := pycosm/protos
PYCOSM_SRC_DIR := pycosm
PYCOSM_TESTS_DIR := tests
PYCOSM_EXAMPLES_DIR := examples

Expand Down
4 changes: 2 additions & 2 deletions examples/atomic_swap_contract_grpc_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

from grpc import insecure_channel

from cosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from cosm.crypto.keypairs import PrivateKey
from pycosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from pycosm.crypto.keypairs import PrivateKey

# ID and amount of tokens to be minted in contract
TOKEN_ID_1 = "1234"
Expand Down
6 changes: 3 additions & 3 deletions examples/atomic_swap_contract_rest_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import inspect
import os

from cosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from cosm.common.rest_client import RestClient
from cosm.crypto.keypairs import PrivateKey
from pycosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from pycosm.common.rest_client import RestClient
from pycosm.crypto.keypairs import PrivateKey

# ID and amount of tokens to be minted in contract
TOKEN_ID_1 = "1234"
Expand Down
4 changes: 2 additions & 2 deletions examples/contract_interaction_grpc_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

from grpc import insecure_channel

from cosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from cosm.crypto.keypairs import PrivateKey
from pycosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from pycosm.crypto.keypairs import PrivateKey

# ID and amount of tokens to be minted in contract
TOKEN_ID = "1234"
Expand Down
6 changes: 3 additions & 3 deletions examples/contract_interaction_rest_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import inspect
import os

from cosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from cosm.common.rest_client import RestClient
from cosm.crypto.keypairs import PrivateKey
from pycosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from pycosm.common.rest_client import RestClient
from pycosm.crypto.keypairs import PrivateKey

# ID and amount of tokens to be minted in contract
TOKEN_ID = "1234"
Expand Down
4 changes: 2 additions & 2 deletions examples/query_balance_rest_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

"""REST example of query balance."""

from cosm.bank.rest_client import BankRestClient, QueryBalanceRequest
from cosm.common.rest_client import RestClient
from pycosm.bank.rest_client import BankRestClient, QueryBalanceRequest
from pycosm.common.rest_client import RestClient

REST_URL = "http:https://127.0.0.1:1317"
ADDRESS = "fetch1mrf5yyjnnlpy0egvpk2pvjdk9667j2gtu8kpfy"
Expand Down
6 changes: 3 additions & 3 deletions examples/tx_native_tokens_atomic_swap_grpc_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

from grpc import insecure_channel

from cosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from cosm.crypto.keypairs import PrivateKey
from cosmos.base.v1beta1.coin_pb2 import Coin
from pycosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from pycosm.crypto.keypairs import PrivateKey
from pycosm.protos.cosmos.base.v1beta1.coin_pb2 import Coin

# Denomination and amount of transferred tokens
DENOM_1 = "stake"
Expand Down
8 changes: 4 additions & 4 deletions examples/tx_native_tokens_atomic_swap_rest_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

""" REST example of native tokens atomic swap """

from cosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from cosm.common.rest_client import RestClient
from cosm.crypto.keypairs import PrivateKey
from cosmos.base.v1beta1.coin_pb2 import Coin
from pycosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from pycosm.common.rest_client import RestClient
from pycosm.crypto.keypairs import PrivateKey
from pycosm.protos.cosmos.base.v1beta1.coin_pb2 import Coin

# Denomination and amount of transferred tokens
DENOM_1 = "stake"
Expand Down
6 changes: 3 additions & 3 deletions examples/tx_send_grpc_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

from grpc import insecure_channel

from cosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from cosm.crypto.keypairs import PrivateKey
from cosmos.base.v1beta1.coin_pb2 import Coin
from pycosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from pycosm.crypto.keypairs import PrivateKey
from pycosm.protos.cosmos.base.v1beta1.coin_pb2 import Coin

# Denomination and amount of transferred tokens
DENOM = "stake"
Expand Down
8 changes: 4 additions & 4 deletions examples/tx_send_rest_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

""" REST example of sending and querying funds """

from cosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from cosm.common.rest_client import RestClient
from cosm.crypto.keypairs import PrivateKey
from cosmos.base.v1beta1.coin_pb2 import Coin
from pycosm.clients.signing_cosmwasm_client import SigningCosmWasmClient
from pycosm.common.rest_client import RestClient
from pycosm.crypto.keypairs import PrivateKey
from pycosm.protos.cosmos.base.v1beta1.coin_pb2 import Coin

# Denomination and amount of transferred tokens
DENOM = "stake"
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/cosm/auth/interface.py → pycosm/auth/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from abc import ABC, abstractmethod

from cosmos.auth.v1beta1.query_pb2 import (
from protos.cosmos.auth.v1beta1.query_pb2 import (
QueryAccountRequest,
QueryAccountResponse,
QueryParamsRequest,
Expand Down
6 changes: 3 additions & 3 deletions src/cosm/auth/rest_client.py → pycosm/auth/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

from google.protobuf.json_format import Parse

from cosm.auth.interface import Auth
from cosm.common.rest_client import RestClient
from cosmos.auth.v1beta1.query_pb2 import (
from auth.interface import Auth
from common.rest_client import RestClient
from protos.cosmos.auth.v1beta1.query_pb2 import (
QueryAccountRequest,
QueryAccountResponse,
QueryParamsRequest,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/cosm/bank/interface.py → pycosm/bank/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from abc import ABC, abstractmethod

from cosmos.bank.v1beta1.query_pb2 import (
from protos import (
QueryAllBalancesRequest,
QueryAllBalancesResponse,
QueryBalanceRequest,
Expand Down
6 changes: 3 additions & 3 deletions src/cosm/bank/rest_client.py → pycosm/bank/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

from google.protobuf.json_format import Parse

from cosm.bank.interface import Bank
from cosm.common.rest_client import RestClient
from cosmos.bank.v1beta1.query_pb2 import (
from bank.interface import Bank
from common.rest_client import RestClient
from protos import (
QueryAllBalancesRequest,
QueryAllBalancesResponse,
QueryBalanceRequest,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,22 @@

from grpc._channel import Channel

from cosm.auth.rest_client import AuthRestClient
from cosm.bank.rest_client import BankRestClient
from cosm.common.rest_client import RestClient
from cosm.common.types import JSONLike
from cosm.crypto.address import Address
from cosm.wasm.rest_client import WasmRestClient
from cosmos.auth.v1beta1.auth_pb2 import BaseAccount
from cosmos.auth.v1beta1.query_pb2 import QueryAccountRequest
from cosmos.auth.v1beta1.query_pb2_grpc import QueryStub as AuthGrpcClient
from cosmos.bank.v1beta1.query_pb2 import QueryBalanceRequest, QueryBalanceResponse
from cosmos.bank.v1beta1.query_pb2_grpc import QueryStub as BankGrpcClient
from cosmwasm.wasm.v1beta1.query_pb2 import QuerySmartContractStateRequest
from cosmwasm.wasm.v1beta1.query_pb2_grpc import QueryStub as CosmWasmGrpcClient
from auth.rest_client import AuthRestClient
from bank.rest_client import BankRestClient
from common.rest_client import RestClient
from common.types import JSONLike
from crypto.address import Address
from wasm.rest_client import WasmRestClient
from protos.cosmos.auth.v1beta1.auth_pb2 import BaseAccount
from protos.cosmos.auth.v1beta1.query_pb2 import QueryAccountRequest
from protos.cosmos.auth.v1beta1.query_pb2_grpc import QueryStub as AuthGrpcClient
from protos import (
QueryBalanceRequest,
QueryBalanceResponse,
)
from protos import QueryStub as BankGrpcClient
from protos.cosmwasm.wasm.v1beta1.query_pb2 import QuerySmartContractStateRequest
from protos.cosmwasm.wasm.v1beta1.query_pb2_grpc import QueryStub as CosmWasmGrpcClient


class CosmWasmClient:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,34 @@
from google.protobuf.any_pb2 import Any
from grpc._channel import Channel

from cosm.clients.cosmwasm_client import CosmWasmClient
from cosm.common.rest_client import RestClient
from cosm.common.types import JSONLike
from cosm.crypto.address import Address
from cosm.crypto.keypairs import PrivateKey
from cosm.tx import sign_transaction
from cosm.tx.rest_client import TxRestClient
from cosmos.auth.v1beta1.auth_pb2 import BaseAccount
from cosmos.bank.v1beta1.tx_pb2 import MsgSend
from cosmos.base.v1beta1.coin_pb2 import Coin
from cosmos.crypto.secp256k1.keys_pb2 import PubKey as ProtoPubKey
from cosmos.tx.signing.v1beta1.signing_pb2 import SignMode
from cosmos.tx.v1beta1.service_pb2 import (
from clients.cosmwasm_client import CosmWasmClient
from common.rest_client import RestClient
from common.types import JSONLike
from crypto.address import Address
from crypto.keypairs import PrivateKey
from tx import sign_transaction
from tx.rest_client import TxRestClient
from protos.cosmos.auth.v1beta1.auth_pb2 import BaseAccount
from protos.cosmos.bank.v1beta1.tx_pb2 import MsgSend
from protos.cosmos.base.v1beta1.coin_pb2 import Coin
from protos import PubKey as ProtoPubKey
from protos import SignMode
from protos.cosmos.tx.v1beta1.service_pb2 import (
BroadcastMode,
BroadcastTxRequest,
GetTxRequest,
GetTxResponse,
)
from cosmos.tx.v1beta1.service_pb2_grpc import ServiceStub as TxGrpcClient
from cosmos.tx.v1beta1.tx_pb2 import AuthInfo, Fee, ModeInfo, SignerInfo, Tx, TxBody
from cosmwasm.wasm.v1beta1.tx_pb2 import (
from protos import ServiceStub as TxGrpcClient
from protos import (
AuthInfo,
Fee,
ModeInfo,
SignerInfo,
Tx,
TxBody,
)
from protos.cosmwasm.wasm.v1beta1.tx_pb2 import (
MsgExecuteContract,
MsgInstantiateContract,
MsgStoreCode,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/cosm/crypto/address.py → pycosm/crypto/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

import bech32

from cosm.crypto.hashfuncs import ripemd160, sha256
from cosm.crypto.keypairs import PublicKey
from crypto.hashfuncs import ripemd160, sha256
from crypto.keypairs import PublicKey

DEFAULT_PREFIX = "fetch"

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/cosm/crypto/keypairs.py → pycosm/crypto/keypairs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from ecdsa.curves import Curve
from ecdsa.util import sigencode_string, sigencode_string_canonize

from cosm.crypto.interface import Signer
from crypto.interface import Signer


class PublicKey:
Expand Down
2 changes: 2 additions & 0 deletions src/cosm/wasm/__init__.py → pycosm/protos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@
# limitations under the License.
#
# ------------------------------------------------------------------------------

"""This package includes autogenerated implementation of protocol buffer schema files."""
Empty file.
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
Empty file.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from cosmos.auth.v1beta1 import query_pb2 as cosmos_dot_auth_dot_v1beta1_dot_query__pb2
from protos.cosmos.auth.v1beta1 import query_pb2 as cosmos_dot_auth_dot_v1beta1_dot_query__pb2


class QueryStub(object):
Expand Down
Empty file.
Empty file.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from cosmos.bank.v1beta1 import query_pb2 as cosmos_dot_bank_dot_v1beta1_dot_query__pb2
from protos.cosmos.bank.v1beta1 import query_pb2 as cosmos_dot_bank_dot_v1beta1_dot_query__pb2


class QueryStub(object):
Expand Down
Loading