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

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

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

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

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

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

Loading…
Cancel
Save