-
-
Save icostan/c7fd040710213423aa5f81bf330680a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Input = Struct.new :value, :tx_hash, :index, :unlock_script, :sequence do | |
def initialize(value, tx_hash, index, unlock_script: '', sequence: 0xfffffffff) | |
super value, tx_hash, index, unlock_script, sequence | |
end | |
def serialize | |
script_hex = script_to_hex(unlock_script) | |
hash_to_hex(tx_hash) + int_to_hex(index) + | |
byte_to_hex(hex_size(script_hex)) + script_hex + int_to_hex(sequence) | |
end | |
end | |
input = Input.new 23_990_000, 'ea8a64e122304637e8da016836e9afd59fc1179dfa15affc40d63b34e7db0cec', 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment