Example #1
0
 def getTransactionCount(self, account, block_identifier=None):
     if block_identifier is None:
         block_identifier = self.defaultBlock
     return self.web3._requestManager.request_blocking(
         "eth_getTransactionCount",
         [
             account,
             formatters.input_block_identifier_formatter(block_identifier),
         ],
     )
Example #2
0
 def getStorageAt(self, account, position, block_identifier=None):
     if block_identifier is None:
         block_identifier = self.defaultBlock
     return self.web3._requestManager.request_blocking(
         "eth_getStorageAt",
         [
             account,
             self.web3.toHex(position),
             formatters.input_block_identifier_formatter(block_identifier),
         ],
     )
Example #3
0
 def call(self, transaction, block_identifier=None):
     formatted_transaction = formatters.input_transaction_formatter(
         self, transaction)
     if block_identifier is None:
         block_identifier = self.defaultBlock
     return self.web3._requestManager.request_blocking(
         "eth_call",
         [
             formatted_transaction,
             formatters.input_block_identifier_formatter(block_identifier),
         ],
     )
Example #4
0
 def getBlockTransactionCount(self, block_identifier):
     """
     `eth_getBlockTransactionCountByHash`
     `eth_getBlockTransactionCountByNumber`
     """
     if is_predefined_block_number(block_identifier) or is_integer(
             block_identifier):
         method = 'eth_getBlockTransactionCountByNumber'
     else:
         method = 'eth_getBlockTransactionCountByHash'
     return self.web3._requestManager.request_blocking(
         method,
         [formatters.input_block_identifier_formatter(block_identifier)],
     )
Example #5
0
 def getTransactionFromBlock(self, block_identifier, transaction_index):
     """
     `eth_getTransactionByBlockHashAndIndex`
     `eth_getTransactionByBlockNumberAndIndex`
     """
     if is_predefined_block_number(block_identifier) or is_integer(
             block_identifier):
         method = 'eth_getTransactionByBlockNumberAndIndex'
     else:
         method = 'eth_getTransactionByBlockHashAndIndex'
     return self.web3._requestManager.request_blocking(
         method,
         [
             formatters.input_block_identifier_formatter(block_identifier),
             transaction_index,
         ],
     )