Skip to content

Commit

Permalink
feat: deprecate get_cellbase_output_capacity_details and get_peers_st…
Browse files Browse the repository at this point in the history
…ate RPC
  • Loading branch information
shaojunda committed Mar 10, 2021
1 parent 43f5077 commit 2475550
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/ckb/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ def send_transaction(transaction, outputs_validator = nil)
end

def _compute_transaction_hash(transaction)
warn "[DEPRECATION] `_compute_transaction_hash` will be removed in a later version."
warn "[DEPRECATION] `_compute_transaction_hash` will be disabled by default from v0.40.0 and will be removed from v0.41.0."
rpc._compute_transaction_hash(transaction.to_raw_transaction_h)
end

def _compute_script_hash(script)
warn "[DEPRECATION] `_compute_script_hash` will be removed in a later version."
warn "[DEPRECATION] `_compute_script_hash` will be disabled by default from v0.40.0 and will be removed from v0.41.0."
rpc._compute_script_hash(script.to_h)
end

Expand Down Expand Up @@ -203,6 +203,7 @@ def get_blockchain_info

# @return [CKB::Types::PeerState[]]
def get_peers_state
warn "[DEPRECATION] `get_peers_state` will be disabled by default from v0.40.0 and will be removed from v0.41.0."
rpc.get_peers_state.map { |peer| Types::PeerState.from_h(peer) }
end

Expand Down Expand Up @@ -242,6 +243,7 @@ def get_header_by_number(block_number)
#
# @return [CKB::Types::BlockReward]
def get_cellbase_output_capacity_details(block_hash)
warn "[DEPRECATION] `get_cellbase_output_capacity_details` will be disabled by default from v0.40.0 and will be removed from v0.41.0."
block_reward_h = rpc.get_cellbase_output_capacity_details(block_hash)
Types::BlockReward.from_h(block_reward_h)
end
Expand Down

0 comments on commit 2475550

Please sign in to comment.