Skip to content

Commit

Permalink
Merge pull request #294 from nervosnetwork/rc/v0.41.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda authored May 6, 2021
2 parents d7d5c02 + 210550f commit 54a50d1
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 15 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# [v0.41.0](https://github.com/nervosnetwork/ckb-sdk-ruby/compare/v0.40.0...v0.41.0) (2021-05-06)


### Features

* add generate_block_with_template RPC ([311a8d1](https://github.com/nervosnetwork/ckb-sdk-ruby/commit/311a8d1))
* implement get_cells_capacity api ([a4ade40](https://github.com/nervosnetwork/ckb-sdk-ruby/commit/a4ade40))
* support search key filter ([50d7ebb](https://github.com/nervosnetwork/ckb-sdk-ruby/commit/50d7ebb))



# [v0.40.0](https://github.com/nervosnetwork/ckb-sdk-ruby/compare/v0.39.0...v0.40.0) (2021-03-10)


Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
ckb-sdk-ruby (0.40.0)
ckb-sdk-ruby (0.41.0)
bitcoin-secp256k1 (~> 0.5.2)
net-http-persistent (~> 4.0.1)
rbnacl (~> 7.1.1)
Expand All @@ -13,7 +13,7 @@ GEM
bitcoin-secp256k1 (0.5.2)
ffi (>= 1.9.25)
coderay (1.1.2)
connection_pool (2.2.3)
connection_pool (2.2.5)
diff-lcs (1.3)
ffi (1.15.0)
jaro_winkler (1.5.2)
Expand Down
14 changes: 4 additions & 10 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
# [v0.40.0](https://github.com/nervosnetwork/ckb-sdk-ruby/compare/v0.39.0...v0.40.0) (2021-03-10)
# [v0.41.0](https://github.com/nervosnetwork/ckb-sdk-ruby/compare/v0.40.0...v0.41.0) (2021-05-06)


### Features

* add serialized_size_without_uncle_proposals ([43f5077](https://github.com/nervosnetwork/ckb-sdk-ruby/commit/43f5077))
* deprecate get_cellbase_output_capacity_details and get_peers_state RPC ([2475550](https://github.com/nervosnetwork/ckb-sdk-ruby/commit/2475550))


### Performance Improvements

* byte32 serializer ([9574a5e](https://github.com/nervosnetwork/ckb-sdk-ruby/commit/9574a5e))
* bytes serializer ([9193fc9](https://github.com/nervosnetwork/ckb-sdk-ruby/commit/9193fc9))
* output data serializer ([5c8e82e](https://github.com/nervosnetwork/ckb-sdk-ruby/commit/5c8e82e))
* add generate_block_with_template RPC ([311a8d1](https://github.com/nervosnetwork/ckb-sdk-ruby/commit/311a8d1))
* implement get_cells_capacity api ([a4ade40](https://github.com/nervosnetwork/ckb-sdk-ruby/commit/a4ade40))
* support search key filter ([50d7ebb](https://github.com/nervosnetwork/ckb-sdk-ruby/commit/50d7ebb))
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
2 changes: 1 addition & 1 deletion lib/ckb/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module CKB
VERSION = "0.40.0"
VERSION = "0.41.0"
end
6 changes: 6 additions & 0 deletions spec/ckb/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,12 @@
result = api.submit_block(work_id: "test", raw_block_h: block.to_raw_block_h)
expect(result).to be_a(String)
end

it "generate_block_with_template should return block hash" do
block_template = api.get_block_template
result = api.generate_block_with_template(block_template)
expect(result).to be_a(String)
end
end

context "batch request" do
Expand Down
2 changes: 1 addition & 1 deletion spec/ckb/types/block_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
["0x1892ea40d82b53c678ff88312450bbb17e164d7a3e0a90941aa58839f56f8df201",
"0x3954acece65096bfa81258983ddb83915fc56bd8"]}]},
:hash=>"0x6d6e478ae632208f4cc4120078bba78852e88ef136e8c5cc8c102b1e21c62dad"},
:work_id=>4,
:work_id=>"0x4",
:dao=>"0xbcbcf54f7e4b090038b2d9a13464250018f37dd3985a000000f678cfa9890100"}
end

Expand Down

0 comments on commit 54a50d1

Please sign in to comment.