def check_tx(self, txBytes): if self.serial: txByteArray = bytearray(txBytes) if len(txBytes) >= 2 and txBytes[:2] == "0x": txByteArray = hex2bytes(txBytes[2:]) txValue = decode_big_endian(BytesBuffer(txByteArray), len(txBytes)) if txValue < self.txCount: return 6 return 0
def deliver_tx(self, txBytes): if self.serial: txByteArray = bytearray(txBytes) if len(txBytes) >= 2 and txBytes[:2] == "0x": txByteArray = hex2bytes(txBytes[2:]) txValue = decode_big_endian(BytesBuffer(txByteArray), len(txBytes)) if txValue != self.txCount: return None, 6 self.txCount += 1 return None, 0