Returns the byte serialization of the transaction input
(self)
| 434 | return cls(prev_tx, prev_index, script_sig, sequence) |
| 435 | |
| 436 | def serialize(self): |
| 437 | '''Returns the byte serialization of the transaction input''' |
| 438 | # serialize prev_tx, little endian |
| 439 | result = self.prev_tx[::-1] |
| 440 | # serialize prev_index, 4 bytes, little endian |
| 441 | result += int_to_little_endian(self.prev_index, 4) |
| 442 | # serialize the script_sig |
| 443 | result += self.script_sig.serialize() |
| 444 | # serialize sequence, 4 bytes, little endian |
| 445 | result += int_to_little_endian(self.sequence, 4) |
| 446 | return result |
| 447 | |
| 448 | def fetch_tx(self, testnet=False): |
| 449 | return TxFetcher.fetch(self.prev_tx.hex(), testnet=testnet) |
nothing calls this directly
no test coverage detected