def serialize(self):
    r = b''
    r += struct.pack('<i', self.nTransactions)
    r += ser_uint256_vector(self.vHash)
    vBytesArray = bytearray(([0] * ((len(self.vufos) + 7) // 8)))
    for i in range(len(self.vufos)):
        vBytesArray[(i // 8)] |= (self.vufos[i] << (i % 8))
    r += ser_string(bytes(vBytesArray))
    return r
def serialize(self):
    r = b
    r += struct.pack('<i', self.nTransactions)
    r += ser_uint256_vector(self.vHash)
    vBytesArray = bytearray(([0] * ((len(self.vufos) + 7) // 8)))
    for i in range(len(self.vufos)):
        vBytesArray[(i // 8)] |= (self.vufos[i] << (i % 8))
    r += ser_string(bytes(vBytesArray))
    return r