# Path: python3-src/piston/block.py
# class Block(dict):
#     """ Read a single block from the chain
# 
#         :param int block: block number
#         :param Steem steem_instance: Steem() instance to use when accesing a RPC
#         :param bool lazy: Use lazy loading
# 
#     """
#     def __init__(
#         self,
#         block,
#         steem_instance=None,
#         lazy=False
#     ):
#         self.steem = steem_instance or shared_steem_instance()
#         self.cached = False
#         self.block = block
# 
#         if isinstance(block, Block):
#             super(Block, self).__init__(block)
#             self.cached = True
#         elif not lazy:
#             self.refresh()
# 
#     def refresh(self):
#         block = self.steem.rpc.get_block(self.block)
#         if not block:
#             raise BlockDoesNotExistsException
#         super(Block, self).__init__(block)
#         self.cached = True
# 
#     def __getitem__(self, key):
#         if not self.cached:
#             self.refresh()
#         return super(Block, self).__getitem__(key)
# 
#     def items(self):
#         if not self.cached:
#             self.refresh()
#         return super(Block, self).items()
# 
#     def time(self):
#         return parse_time(self['timestamp'])


import time
from piston.instance import shared_steem_instance
from .block import Block
from .utils import parse_time
        elif mode == "head":
            self.mode = "head_block_number"
        else:
            raise ValueError("invalid value for 'mode'!")

    def info(self):
        """ This call returns the *dynamic global properties*
        """
        return self.steem.rpc.get_dynamic_global_properties()

    def chainParameters(self):
        return self.config()["parameters"]

    def get_network(self):
        return self.steem.rpc.get_network()

    def get_chain_properties(self):
        return self.steem.rpc.get_chain_properties()

    def config(self):
        return self.steem.rpc.get_config()

    def get_current_block_num(self):
        """ This call returns the current block
        """
        return self.info().get(self.mode)

    def get_current_block(self):
        """ This call returns the current block
        """

# Path: python3-src/piston/block.py
# class Block(dict):
#     """ Read a single block from the chain
# 
#         :param int block: block number
#         :param Steem steem_instance: Steem() instance to use when accesing a RPC
#         :param bool lazy: Use lazy loading
# 
#     """
#     def __init__(
#         self,
#         block,
#         steem_instance=None,
#         lazy=False
#     ):
#         self.steem = steem_instance or shared_steem_instance()
#         self.cached = False
#         self.block = block
# 
#         if isinstance(block, Block):
#             super(Block, self).__init__(block)
#             self.cached = True
#         elif not lazy:
#             self.refresh()
# 
#     def refresh(self):
#         block = self.steem.rpc.get_block(self.block)
#         if not block:
#             raise BlockDoesNotExistsException
#         super(Block, self).__init__(block)
#         self.cached = True
# 
#     def __getitem__(self, key):
#         if not self.cached:
#             self.refresh()
#         return super(Block, self).__getitem__(key)
# 
#     def items(self):
#         if not self.cached:
#             self.refresh()
#         return super(Block, self).items()
# 
#     def time(self):
#         return parse_time(self['timestamp'])


# Path: python3-src/piston/blockchain.py
import time
from piston.instance import shared_steem_instance
from .block import Block
from .utils import parse_time

        elif mode == "head":
            self.mode = "head_block_number"
        else:
            raise ValueError("invalid value for 'mode'!")

    def info(self):
        """ This call returns the *dynamic global properties*
        """
        return self.steem.rpc.get_dynamic_global_properties()

    def chainParameters(self):
        return self.config()["parameters"]

    def get_network(self):
        return self.steem.rpc.get_network()

    def get_chain_properties(self):
        return self.steem.rpc.get_chain_properties()

    def config(self):
        return self.steem.rpc.get_config()

    def get_current_block_num(self):
        """ This call returns the current block
        """
        return self.info().get(self.mode)

    def get_current_block(self):
        """ This call returns the current block
        """

        return Block(self.get_current_block_num(), steem_instance=self.steem)