Skip to content

Commit

Permalink
feat: add generate_block_with_template RPC
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed May 6, 2021
1 parent d1c0d90 commit 311a8d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/ckb/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,13 @@ def clear_banned_addresses
rpc.clear_banned_addresses
end


# @param block_template [CKB::Types::BlockTemplate]
# @return block_hash [string]
def generate_block_with_template(block_template)
rpc.generate_block_with_template(block_template.to_h)
end

def inspect
"\#<API@#{rpc.uri}>"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/block_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def to_h
transactions: transactions.map(&:to_h),
proposals: proposals,
cellbase: cellbase.to_h,
work_id: work_id,
work_id: Utils.to_hex(work_id),
dao: dao
}
end
Expand Down

0 comments on commit 311a8d1

Please sign in to comment.