Skip to content

Commit

Permalink
Merge pull request #1729 from nervosnetwork/develop
Browse files Browse the repository at this point in the history
Deploy to testnet
  • Loading branch information
rabbitz authored Apr 2, 2024
2 parents a1a4e23 + af45b85 commit a7e6dcc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/controllers/concerns/cell_data_comparator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def diff_udt_cells(inputs, outputs)

amount = output&.dig(:amount).to_f - input&.dig(:amount).to_f
capacity = output&.dig(:capacity).to_f - input&.dig(:capacity).to_f
udt_info = udt_infos[k[1]].merge(amount:)
udt_info = udt_infos[k[1]].merge(amount: "%f" % amount)
transfers[k[0]] << CkbUtils.hash_value_to_s({ capacity:, cell_type: k[2], udt_info: })
end

Expand Down
12 changes: 6 additions & 6 deletions test/controllers/api/v2/ckb_transactions_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ class CkbTransactionsControllerTest < ActionDispatch::IntegrationTest
block: block2,
previous_output: {
tx_hash: tx1.tx_hash,
index: 0
index: 0,
})
create(:cell_input, ckb_transaction: tx2,
block: block2,
previous_output: {
tx_hash: tx1.tx_hash,
index: 1
index: 1,
})
# create outputs
create(:cell_output, ckb_transaction: tx2,
Expand Down Expand Up @@ -107,13 +107,13 @@ class CkbTransactionsControllerTest < ActionDispatch::IntegrationTest
block: block2,
previous_output: {
tx_hash: tx1.tx_hash,
index: 0
index: 0,
})
create(:cell_input, ckb_transaction: tx2,
block: block2,
previous_output: {
tx_hash: tx1.tx_hash,
index: 1
index: 1,
})
# create outputs
create(:cell_output, ckb_transaction: tx2,
Expand Down Expand Up @@ -141,8 +141,8 @@ class CkbTransactionsControllerTest < ActionDispatch::IntegrationTest
transfers2 = data2[0]["transfers"]

assert_equal 2, json["data"].size
assert_equal "-2000000000000.0", transfers1[0]["udt_info"]["amount"]
assert_equal "2000000000000.0", transfers2[0]["udt_info"]["amount"]
assert_equal "-2000000000000.000000", transfers1[0]["udt_info"]["amount"]
assert_equal "2000000000000.000000", transfers2[0]["udt_info"]["amount"]
end
end
end
Expand Down

0 comments on commit a7e6dcc

Please sign in to comment.