Skip to content

Commit

Permalink
feat: add min fee rate to tx pool info
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed Mar 23, 2020
1 parent 551e7af commit 7e19812
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/ckb/types/tx_pool_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class TxPoolInfo
attr_accessor :pending, :proposed, :orphan, :total_tx_cycles, :total_tx_size, :last_txs_updated_at
attr_accessor :pending, :proposed, :orphan, :total_tx_cycles, :total_tx_size, :last_txs_updated_at, :min_fee_rate

# @param pending [String | Integer] integer or hex number
# @param proposed [String | Integer] integer or hex number
Expand All @@ -16,6 +16,7 @@ def initialize(
proposed:,
orphan:,
last_txs_updated_at:,
min_fee_rate:,
total_tx_cycles:,
total_tx_size:
)
Expand All @@ -25,6 +26,7 @@ def initialize(
@total_tx_cycles = Utils.to_int(total_tx_cycles)
@total_tx_size = Utils.to_int(total_tx_size)
@last_txs_updated_at = Utils.to_int(last_txs_updated_at)
@min_fee_rate = Utils.to_int(min_fee_rate)
end

def to_h
Expand All @@ -34,7 +36,8 @@ def to_h
orphan: Utils.to_hex(@orphan),
total_tx_cycles: Utils.to_hex(@total_tx_cycles),
total_tx_size: Utils.to_hex(@total_tx_size),
last_txs_updated_at: Utils.to_hex(@last_txs_updated_at)
last_txs_updated_at: Utils.to_hex(@last_txs_updated_at),
min_fee_rate: Utils.to_hex(@min_fee_rate)
}
end

Expand All @@ -47,7 +50,8 @@ def self.from_h(hash)
orphan: hash[:orphan],
total_tx_cycles: hash[:total_tx_cycles],
total_tx_size: hash[:total_tx_size],
last_txs_updated_at: hash[:last_txs_updated_at]
last_txs_updated_at: hash[:last_txs_updated_at],
min_fee_rate: hash[:min_fee_rate]
)
end
end
Expand Down

0 comments on commit 7e19812

Please sign in to comment.