Skip to content

Commit

Permalink
feat: add new RPCs
Browse files Browse the repository at this point in the history
ping_peers, get_transaction_proof, verify_transaction_proof and clear_banned_addresses
  • Loading branch information
shaojunda committed Oct 26, 2020
1 parent bfd881c commit 48626ca
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/ckb/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,27 @@ def remove_node(peer_id)
rpc.remove_node(peer_id)
end

def ping_peers
rpc.ping_peers
end

# @param tx_hashes [string[]]
# @param block_hash [string]
def get_transaction_proof(tx_hashes:, block_hash: nil)
transaction_proof_h = rpc.get_transaction_proof(tx_hashes, block_hash)
CKB::Types::TransactionProof.from_h(transaction_proof_h)
end


# @param proof [CKB::Types::TransactionProof]
def verify_transaction_proof(proof)
rpc.verify_transaction_proof(proof)
end

def clear_banned_addresses
rpc.clear_banned_addresses
end

def inspect
"\#<API@#{rpc.uri}>"
end
Expand Down

0 comments on commit 48626ca

Please sign in to comment.