示例#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
     )
示例#2
0
文件: client.py 项目: ABISprotocol/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")
示例#3
0
文件: client.py 项目: 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")
示例#4
0
文件: client.py 项目: ABISprotocol/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)
示例#5
0
文件: client.py 项目: ABISprotocol/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)
示例#6
0
文件: client.py 项目: 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)
示例#7
0
文件: client.py 项目: 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)
示例#8
0
文件: client.py 项目: 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)
示例#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
     )
示例#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)