[refactor] Move blockchain interaction methods out of rpc lib (#4)

pull/5/head
Janet Liang 5 years ago committed by GitHub
parent c137b125d9
commit b1118b7030
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      pyhmy/__init__.py
  2. 16
      pyhmy/account.py
  3. 6
      pyhmy/blockchain.py
  4. 3
      pyhmy/staking.py
  5. 2
      pyhmy/transaction.py
  6. 2
      pyhmy/util.py
  7. 0
      tests/sdk-pyhmy/conftest.py
  8. 0
      tests/sdk-pyhmy/test_account.py
  9. 0
      tests/sdk-pyhmy/test_blockchain.py
  10. 0
      tests/sdk-pyhmy/test_staking.py
  11. 0
      tests/sdk-pyhmy/test_transaction.py

@ -3,13 +3,6 @@ import warnings
from ._version import __version__
from .rpc import (
account,
blockchain,
staking,
transaction
)
from .util import (
Typgpy,
get_gopath,
@ -18,10 +11,6 @@ from .util import (
json_load
)
from .logging import (
ControlledLogger
)
if sys.version_info.major < 3:
warnings.simplefilter("always", DeprecationWarning)
warnings.warn(

@ -1,17 +1,17 @@
from .request import (
from .rpc.request import (
rpc_request
)
from .blockchain import (
get_sharding_structure
)
from .exceptions import (
from .rpc.exceptions import (
RPCError,
InvalidRPCReplyError,
JSONDecodeError,
RequestsError,
RequestsTimeoutError
RequestsTimeoutError,
JSONDecodeError
)
from .blockchain import (
get_sharding_structure
)
_default_endpoint = 'http://localhost:9500'

@ -1,9 +1,9 @@
from .request import (
from .rpc.request import (
rpc_request
)
from .exceptions import (
InvalidRPCReplyError
from .rpc.exceptions import (
InvalidRPCReplyError,
)
_default_endpoint = 'http://localhost:9500'

@ -1,8 +1,7 @@
from .request import (
from .rpc.request import (
rpc_request
)
_default_endpoint = 'http://localhost:9500'
_default_timeout = 30

@ -1,4 +1,4 @@
from .request import (
from .rpc.request import (
rpc_request
)

@ -6,7 +6,7 @@ import datetime
import requests
from .rpc.blockchain import (
from .blockchain import (
get_latest_header
)

Loading…
Cancel
Save