Skip to content

Commit

Permalink
feat: change witnesses to String[]
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed Sep 27, 2019
1 parent ff93149 commit f946c9d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/ckb/types/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Transaction
# @param inputs [CKB::Types::Input[]]
# @param outputs [CKB::Types::Output[]]
# @param outputs_data [String[]]
# @param witnesses [CKB::Types::Witness[]]
# @param witnesses [String[]]
def initialize(
hash: nil,
version: 0,
Expand Down Expand Up @@ -70,7 +70,7 @@ def to_h
inputs: @inputs.map(&:to_h),
outputs: @outputs.map(&:to_h),
outputs_data: @outputs_data,
witnesses: @witnesses.map(&:to_h)
witnesses: @witnesses
}
hash[:hash] = @hash if @hash
hash
Expand All @@ -84,7 +84,7 @@ def to_raw_transaction_h
inputs: @inputs.map(&:to_h),
outputs: @outputs.map(&:to_h),
outputs_data: @outputs_data,
witnesses: @witnesses.map(&:to_h)
witnesses: @witnesses
}
end

Expand All @@ -106,7 +106,7 @@ def self.from_h(hash)
inputs: hash[:inputs].map { |input| Input.from_h(input) },
outputs: hash[:outputs].map { |output| Output.from_h(output) },
outputs_data: hash[:outputs_data],
witnesses: hash[:witnesses].map { |witness| Witness.from_h(witness) }
witnesses: hash[:witnesses]
)
end
end
Expand Down

0 comments on commit f946c9d

Please sign in to comment.