Skip to content

Commit

Permalink
fix: remove check self in from_h
Browse files Browse the repository at this point in the history
  • Loading branch information
classicalliu committed May 10, 2019
1 parent 74d3f45 commit 8758713
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions lib/ckb/types/address_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ def to_h
def self.from_h(hash)
return if hash.nil?

return hash if hash.is_a?(self.class)

new(
address: hash[:address],
score: hash[:score]
Expand Down
2 changes: 0 additions & 2 deletions lib/ckb/types/peer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def to_h
def self.from_h(hash)
return if hash.nil?

return hash if hash.is_a?(self.class)

new(
addresses: hash[:addresses].map { |addr| AddressInfo.from_h(addr) },
is_outbound: hash[:is_outbound],
Expand Down
2 changes: 0 additions & 2 deletions lib/ckb/types/tx_pool_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def to_h
def self.from_h(hash)
return if hash.nil?

return hash if hash.is_a?(self.class)

new(
pending: hash[:pending],
staging: hash[:staging],
Expand Down

0 comments on commit 8758713

Please sign in to comment.