Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy to mainnet #1730

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading