Ejemplo n.º 1
0
 def getTransactionByBlock(self, block_identifier, transaction_index):
     """
     `eth_getTransactionByBlockHashAndIndex`
     `eth_getTransactionByBlockNumberAndIndex`
     """
     method = select_method_for_block_identifier(
         block_identifier,
         if_predefined='eth_getTransactionByBlockNumberAndIndex',
         if_hash='eth_getTransactionByBlockHashAndIndex',
         if_number='eth_getTransactionByBlockNumberAndIndex',
     )
     return self.web3.manager.request_blocking(
         method,
         [block_identifier, transaction_index],
     )
Ejemplo n.º 2
0
 def getUncleCount(self, block_identifier):
     """
     `eth_getUncleCountByBlockHash`
     `eth_getUncleCountByBlockNumber`
     """
     method = select_method_for_block_identifier(
         block_identifier,
         if_predefined='eth_getUncleCountByBlockNumber',
         if_hash='eth_getUncleCountByBlockHash',
         if_number='eth_getUncleCountByBlockNumber',
     )
     return self.web3.manager.request_blocking(
         method,
         [block_identifier],
     )
Ejemplo n.º 3
0
 def getTransactionFromBlock(self, block_identifier, transaction_index):
     """
     `eth_getTransactionByBlockHashAndIndex`
     `eth_getTransactionByBlockNumberAndIndex`
     """
     method = select_method_for_block_identifier(
         block_identifier,
         if_predefined='eth_getTransactionByBlockNumberAndIndex',
         if_hash='eth_getTransactionByBlockHashAndIndex',
         if_number='eth_getTransactionByBlockNumberAndIndex',
     )
     return self.web3.manager.request_blocking(
         method,
         [block_identifier, transaction_index],
     )
Ejemplo n.º 4
0
 def getUncleCount(self, block_identifier):
     """
     `eth_getUncleCountByBlockHash`
     `eth_getUncleCountByBlockNumber`
     """
     method = select_method_for_block_identifier(
         block_identifier,
         if_predefined='eth_getUncleCountByBlockNumber',
         if_hash='eth_getUncleCountByBlockHash',
         if_number='eth_getUncleCountByBlockNumber',
     )
     return self.web3.manager.request_blocking(
         method,
         [block_identifier],
     )
Ejemplo n.º 5
0
    def getBlock(self, block_identifier, full_transactions=False):
        """
        `eth_getBlockByHash`
        `eth_getBlockByNumber`
        """
        method = select_method_for_block_identifier(
            block_identifier,
            if_predefined='eth_getBlockByNumber',
            if_hash='eth_getBlockByHash',
            if_number='eth_getBlockByNumber',
        )

        return self.web3.manager.request_blocking(
            method,
            [block_identifier, full_transactions],
        )
Ejemplo n.º 6
0
    def getBlock(self, block_identifier, full_transactions=False):
        """
        `eth_getBlockByHash`
        `eth_getBlockByNumber`
        """
        method = select_method_for_block_identifier(
            block_identifier,
            if_predefined='eth_getBlockByNumber',
            if_hash='eth_getBlockByHash',
            if_number='eth_getBlockByNumber',
        )

        return self.web3.manager.request_blocking(
            method,
            [block_identifier, full_transactions],
        )