From d11e8dd4a86fd036704697dad75ff6c4fabaa173 Mon Sep 17 00:00:00 2001 From: Yates Date: Thu, 27 Oct 2022 10:22:19 +0800 Subject: [PATCH] fixed issue#305: Please add more field that returned from raw RPC for get_transaction --- lib/ckb/types/tx_status.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/ckb/types/tx_status.rb b/lib/ckb/types/tx_status.rb index 888716db..64233f6a 100644 --- a/lib/ckb/types/tx_status.rb +++ b/lib/ckb/types/tx_status.rb @@ -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 @@ -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