(self)
| 917 | self.vBits.append(vBytes[i//8] & (1 << (i % 8)) != 0) |
| 918 | |
| 919 | def serialize(self): |
| 920 | r = b"" |
| 921 | r += struct.pack("<i", self.nTransactions) |
| 922 | r += ser_uint256_vector(self.vHash) |
| 923 | vBytesArray = bytearray([0x00] * ((len(self.vBits) + 7)//8)) |
| 924 | for i in range(len(self.vBits)): |
| 925 | vBytesArray[i // 8] |= self.vBits[i] << (i % 8) |
| 926 | r += ser_string(bytes(vBytesArray)) |
| 927 | return r |
| 928 | |
| 929 | def __repr__(self): |
| 930 | return "CPartialMerkleTree(nTransactions=%d, vHash=%s, vBits=%s)" % (self.nTransactions, repr(self.vHash), repr(self.vBits)) |
nothing calls this directly
no test coverage detected