Skip to content

Commit

Permalink
fixed issue#305: Please add more field that returned from raw RPC for…
Browse files Browse the repository at this point in the history
… get_transaction
  • Loading branch information
Yates committed Oct 28, 2022
1 parent 69cecd0 commit d11e8dd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/ckb/types/tx_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ class TxStatus

# @param status [String] "proposed", "pending", "committed"
# @param block_hash [String | nil] "0x..."
def initialize(status:, block_hash:)
# @param reason [String | nil] '{"type":"Resolveg","description":"Resolve failed Dead(OutPoint(0x...))"}'
def initialize(status:, block_hash:, reason:)
@status = status
@block_hash = block_hash
@reason = reason
end

def to_h
{
status: @status,
block_hash: @block_hash
block_hash: @block_hash,
reason: @reason
}
end

Expand All @@ -24,7 +27,8 @@ def self.from_h(hash)

new(
status: hash[:status],
block_hash: hash[:block_hash]
block_hash: hash[:block_hash],
reason: hash[:reason]
)
end
end
Expand Down

0 comments on commit d11e8dd

Please sign in to comment.