Esempio 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
     )
Esempio 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")
Esempio n. 3
0
File: client.py Progetto: 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")
Esempio 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)
Esempio 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)
Esempio n. 6
0
File: client.py Progetto: 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)
Esempio n. 7
0
File: client.py Progetto: 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)
Esempio n. 8
0
File: client.py Progetto: 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)
Esempio 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
     )
Esempio 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)