Skip to content

Commit

Permalink
feat: update system script cell index to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
classicalliu committed May 14, 2019
1 parent 79ffc2b commit 6c0759f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/ckb/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def initialize(host: CKB::RPC::DEFAULT_URL, mode: MODE::TESTNET)
system_cell_transaction = genesis_block.transactions.first
out_point_cell = Types::CellOutPoint.new(
tx_hash: system_cell_transaction.hash,
index: 0
index: "1"
)
out_point = Types::OutPoint.new(
cell: out_point_cell
)
cell_data = CKB::Utils.hex_to_bin(system_cell_transaction.outputs[0].data)
cell_data = CKB::Utils.hex_to_bin(system_cell_transaction.outputs[1].data)
cell_hash = CKB::Utils.bin_to_hex(CKB::Blake2b.digest(cell_data))
set_system_script_cell(out_point, cell_hash)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/ckb/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
end

let(:api) { CKB::API.new }
let(:lock_hash) { "0x266cec97cbede2cfbce73666f08deed9560bdf7841a7a5a51b3a3f09da249e21" }
let(:lock_hash) { "0x3dbdeb3538b7abe1b1f85a86b150805728c29b26faceb5051fb6c7f92c346ed8" }

it "genesis block" do
expect(api.genesis_block).to be_a(Types::Block)
Expand Down
2 changes: 1 addition & 1 deletion spec/ckb/rpc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
end

let(:rpc) { CKB::RPC.new }
let(:lock_hash) { "0x266cec97cbede2cfbce73666f08deed9560bdf7841a7a5a51b3a3f09da249e21" }
let(:lock_hash) { "0x3dbdeb3538b7abe1b1f85a86b150805728c29b26faceb5051fb6c7f92c346ed8" }

it "genesis block" do
result = rpc.genesis_block
Expand Down

0 comments on commit 6c0759f

Please sign in to comment.