def toString(self): """Human readable print.""" print "@@@@@@@@@@@@@@@@@@@@@@@ INPUT @@@@@@@@@@@@@@@@@@@@@@@@@@@" print "Transaction Hash: " + binaryRead.strToHex(self.transactionHash) print "Transaction Index: " + binaryRead.uIntToStr(self.transactionIndex) print "Varint: " + ''.join(str(self.varInt).encode('hex')) print "Script Length: " + str(self.scriptLength) print "Script Data Encoded: " + binaryRead.strToHex(self.scriptData) print "Script Data Decoded: " + self.scriptData print "Coinbase: " + str(self.isCoinbase) print "Sequence Number: " + binaryRead.uIntToStr(self.sequenceNumber) print "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
def toString(self): """Human readable print.""" print "###################BLOCK HEADER ###################" print "Magic ID: " + binaryRead.strToHex(self.magicID) print "Bloc Length: " + binaryRead.uIntToStr(self.length) + " bytes" print "Version: " + binaryRead.uIntToStr(self.version) print "Previous Block Hash: " + binaryRead.strToHex(self.previousBlockHash) print "Merkle Root: " + binaryRead.strToHex(self.merkleRoot) print "Time Stamp: " + binaryRead.binaryToTime(self.timestamp) print "Target Difficulty: " + binaryRead.strToHex(self.targetDifficulty) print "Nonce: " + binaryRead.uIntToStr(self.nonce) print "Block Hash: " + self.blockHash print "###################################################"
def toString(self): """Human readable print.""" print "@@@@@@@@@@@@@@@@@@@@@@@ INPUT @@@@@@@@@@@@@@@@@@@@@@@@@@@" print "Transaction Hash: " + binaryRead.strToHex(self.transactionHash) print "Transaction Index: " + binaryRead.uIntToStr( self.transactionIndex) print "Varint: " + ''.join(str(self.varInt).encode('hex')) print "Script Length: " + str(self.scriptLength) print "Script Data Encoded: " + binaryRead.strToHex(self.scriptData) print "Script Data Decoded: " + self.scriptData print "Coinbase: " + str(self.isCoinbase) print "Sequence Number: " + binaryRead.uIntToStr(self.sequenceNumber) print "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
def setOutputScriptDecoded(self): """Decodes binary script to hexadecimal value.""" self.outputScriptDecoded = binaryRead.strToHex(self.outputScript)