Skip to content

Commit

Permalink
BREAKING CHANGE: use new script which only has SIGHASH_ALL type
Browse files Browse the repository at this point in the history
  • Loading branch information
xxuejie committed Apr 8, 2019
1 parent 96ab6c7 commit 8eeea80
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/ckb/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ def self.json_script_to_type_hash(script)

def self.sign_sighash_all_inputs(inputs, outputs, privkey)
blake2b = CKB::Blake2b.new
sighash_type = 0x1.to_s
blake2b.update(sighash_type)
inputs.each do |input|
previous_output = input[:previous_output]
blake2b.update(hex_to_bin(previous_output[:hash]))
Expand All @@ -58,7 +56,7 @@ def self.sign_sighash_all_inputs(inputs, outputs, privkey)
signature_hex = bin_to_hex(signature_bin)

inputs.map do |input|
args = input[:args] + [signature_hex, sighash_type]
args = input[:args] + [signature_hex]
input.merge(args: args)
end
end
Expand Down

0 comments on commit 8eeea80

Please sign in to comment.