File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ def capacity=(value)
3434 end
3535
3636 def calculate_bytesize
37- bytesize = 8 + Utils . hex_to_bin ( @data_hash ) . bytesize + @lock . calculate_bytesize
37+ raise "Don't know data" if @data . nil?
38+ bytesize = 8 + Utils . hex_to_bin ( @data ) . bytesize + @lock . calculate_bytesize
3839 bytesize += @type . calculate_bytesize if @type
3940 bytesize
4041 end
Original file line number Diff line number Diff line change 1313 it "default" do
1414 expect (
1515 output . calculate_bytesize
16- ) . to eq 93
16+ ) . to eq 61
1717 end
1818
1919 it "with data" do
2020 output . instance_variable_set ( :@data , "0x1234" )
2121 expect (
2222 output . calculate_bytesize
23- ) . to eq 93
23+ ) . to eq 63
2424 end
2525
2626 it "with type script" do
3232
3333 expect (
3434 output . calculate_bytesize
35- ) . to eq ( 93 + 33 )
35+ ) . to eq ( 61 + 33 )
3636 end
3737 end
3838
3939 it "calculate min capacity" do
4040 expect (
4141 output . calculate_min_capacity
42- ) . to eq CKB ::Utils . byte_to_shannon ( 93 )
42+ ) . to eq CKB ::Utils . byte_to_shannon ( 61 )
4343 end
4444end
You can’t perform that action at this time.
0 commit comments