Exemplo n.º 1
0
 def fetch_transaction_index(self, tx_hash, cb):
     """Fetch the block height that contains a transaction and its index
     within a block."""
     data = serialize.ser_hash(tx_hash)
     self.send_command(
         'blockchain.fetch_transaction_index', data, cb
     )
Exemplo n.º 2
0
def pack_block_index(index):
    if type(index) == str:
        assert len(index) == 32
        return serialize.ser_hash(index)
    elif type(index) == int:
        return struct.pack('<I', index)
    else:
        raise ValueError("Unknown index type")
Exemplo n.º 3
0
Arquivo: client.py Projeto: imak81/sx
def pack_block_index(index):
    if type(index) == str:
        assert len(index) == 32
        return serialize.ser_hash(index)
    elif type(index) == int:
        return struct.pack('<I', index)
    else:
        raise ValueError("Unknown index type")
Exemplo n.º 4
0
 def fetch_transaction(self, tx_hash, cb):
     """Fetches a transaction by hash."""
     data = serialize.ser_hash(tx_hash)
     self.send_command('blockchain.fetch_transaction', data, cb)
Exemplo n.º 5
0
 def fetch_block_height(self, blk_hash, cb):
     """Fetches the height of a block given its hash."""
     data = serialize.ser_hash(blk_hash)
     self.send_command('blockchain.fetch_block_height', data, cb)
Exemplo n.º 6
0
Arquivo: client.py Projeto: imak81/sx
 def fetch_block_height(self, blk_hash, cb):
     """Fetches the height of a block given its hash."""
     data = serialize.ser_hash(blk_hash)
     self.send_command('blockchain.fetch_block_height', data, cb)
Exemplo n.º 7
0
Arquivo: client.py Projeto: imak81/sx
 def fetch_transaction_index(self, tx_hash, cb):
     """Fetch the block height that contains a transaction and its index
     within a block."""
     data = serialize.ser_hash(tx_hash)
     self.send_command('blockchain.fetch_transaction_index', data, cb)
Exemplo n.º 8
0
Arquivo: client.py Projeto: imak81/sx
 def fetch_transaction(self, tx_hash, cb):
     """Fetches a transaction by hash."""
     data = serialize.ser_hash(tx_hash)
     self.send_command('blockchain.fetch_transaction', data, cb)
 def fetch_block_transaction_hashes(self, tx_hash, cb):
     """Fetches list of transaction hashes in a block by block hash."""
     data = serialize.ser_hash(tx_hash)
     self.send_command('blockchain.fetch_block_transaction_hashes', data,
                       cb)
 def fetch_txpool_transaction(self, tx_hash, cb):
     """Fetches a transaction by hash from the txpool."""
     data = serialize.ser_hash(tx_hash)
     self.send_command('transaction_pool.fetch_transaction', data, cb)
Exemplo n.º 11
0
 def fetch_block_transaction_hashes(self, tx_hash, cb):
     """Fetches list of transaction hashes in a block by block hash."""
     data = serialize.ser_hash(tx_hash)
     self.send_command(
         'blockchain.fetch_block_transaction_hashes', data, cb
     )
Exemplo n.º 12
0
 def fetch_txpool_transaction(self, tx_hash, cb):
     """Fetches a transaction by hash from the txpool."""
     data = serialize.ser_hash(tx_hash)
     self.send_command('transaction_pool.fetch_transaction', data, cb)