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 #2251

Merged
merged 7 commits into from
Oct 18, 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
124 changes: 62 additions & 62 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,72 +10,72 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.8.4)
actionpack (= 7.0.8.4)
activesupport (= 7.0.8.4)
actioncable (7.0.8.5)
actionpack (= 7.0.8.5)
activesupport (= 7.0.8.5)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.8.4)
actionpack (= 7.0.8.4)
activejob (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
actionmailbox (7.0.8.5)
actionpack (= 7.0.8.5)
activejob (= 7.0.8.5)
activerecord (= 7.0.8.5)
activestorage (= 7.0.8.5)
activesupport (= 7.0.8.5)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.8.4)
actionpack (= 7.0.8.4)
actionview (= 7.0.8.4)
activejob (= 7.0.8.4)
activesupport (= 7.0.8.4)
actionmailer (7.0.8.5)
actionpack (= 7.0.8.5)
actionview (= 7.0.8.5)
activejob (= 7.0.8.5)
activesupport (= 7.0.8.5)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.8.4)
actionview (= 7.0.8.4)
activesupport (= 7.0.8.4)
actionpack (7.0.8.5)
actionview (= 7.0.8.5)
activesupport (= 7.0.8.5)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.8.4)
actionpack (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
actiontext (7.0.8.5)
actionpack (= 7.0.8.5)
activerecord (= 7.0.8.5)
activestorage (= 7.0.8.5)
activesupport (= 7.0.8.5)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.8.4)
activesupport (= 7.0.8.4)
actionview (7.0.8.5)
activesupport (= 7.0.8.5)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_interaction (5.3.0)
activemodel (>= 5.2, < 8)
activesupport (>= 5.2, < 8)
activejob (7.0.8.4)
activesupport (= 7.0.8.4)
activejob (7.0.8.5)
activesupport (= 7.0.8.5)
globalid (>= 0.3.6)
activemodel (7.0.8.4)
activesupport (= 7.0.8.4)
activerecord (7.0.8.4)
activemodel (= 7.0.8.4)
activesupport (= 7.0.8.4)
activemodel (7.0.8.5)
activesupport (= 7.0.8.5)
activerecord (7.0.8.5)
activemodel (= 7.0.8.5)
activesupport (= 7.0.8.5)
activerecord-import (1.4.1)
activerecord (>= 4.2)
activestorage (7.0.8.4)
actionpack (= 7.0.8.4)
activejob (= 7.0.8.4)
activerecord (= 7.0.8.4)
activesupport (= 7.0.8.4)
activestorage (7.0.8.5)
actionpack (= 7.0.8.5)
activejob (= 7.0.8.5)
activerecord (= 7.0.8.5)
activesupport (= 7.0.8.5)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.8.4)
activesupport (7.0.8.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -135,7 +135,7 @@ GEM
thor
bootsnap (1.13.0)
msgpack (~> 1.2)
builder (3.2.4)
builder (3.3.0)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.3.4)
Expand Down Expand Up @@ -202,7 +202,7 @@ GEM
ecdsa (1.2.0)
ecdsa_ext (0.5.1)
ecdsa (~> 1.2.0)
erubi (1.12.0)
erubi (1.13.0)
et-orbi (1.2.11)
tzinfo
eventmachine (1.2.7)
Expand Down Expand Up @@ -241,7 +241,7 @@ GEM
http-cookie (1.0.5)
domain_name (~> 0.5)
http-form_data (2.3.0)
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
iniparse (1.5.0)
io-event (1.1.6)
Expand Down Expand Up @@ -285,7 +285,7 @@ GEM
method_source (1.1.0)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.23.1)
minitest (5.25.1)
minitest-reporters (1.6.1)
ansi
builder
Expand All @@ -308,12 +308,12 @@ GEM
net-protocol
newrelic_rpm (8.12.0)
nio4r (2.7.3)
nokogiri (1.16.5)
nokogiri (1.16.7)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.5-arm64-darwin)
nokogiri (1.16.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.5-x86_64-linux)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
pagy (5.10.1)
activesupport
Expand Down Expand Up @@ -347,8 +347,8 @@ GEM
puma (6.4.3)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.8.0)
rack (2.2.9)
racc (1.8.1)
rack (2.2.10)
rack-attack (6.6.1)
rack (>= 1.0, < 3)
rack-cache (1.13.0)
Expand All @@ -357,30 +357,30 @@ GEM
rack (>= 2.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8.4)
actioncable (= 7.0.8.4)
actionmailbox (= 7.0.8.4)
actionmailer (= 7.0.8.4)
actionpack (= 7.0.8.4)
actiontext (= 7.0.8.4)
actionview (= 7.0.8.4)
activejob (= 7.0.8.4)
activemodel (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
rails (7.0.8.5)
actioncable (= 7.0.8.5)
actionmailbox (= 7.0.8.5)
actionmailer (= 7.0.8.5)
actionpack (= 7.0.8.5)
actiontext (= 7.0.8.5)
actionview (= 7.0.8.5)
activejob (= 7.0.8.5)
activemodel (= 7.0.8.5)
activerecord (= 7.0.8.5)
activestorage (= 7.0.8.5)
activesupport (= 7.0.8.5)
bundler (>= 1.15.0)
railties (= 7.0.8.4)
railties (= 7.0.8.5)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.8.4)
actionpack (= 7.0.8.4)
activesupport (= 7.0.8.4)
railties (7.0.8.5)
actionpack (= 7.0.8.5)
activesupport (= 7.0.8.5)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand Down
6 changes: 5 additions & 1 deletion app/models/ckb_sync/transactions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@
tx_mappings = tx_returnings.rows.to_h { |id, tx_hash| [tx_hash.sub(/^\\x/, "0x"), id] }
lock_script_returnings = LockScript.upsert_all(lock_script_attrs.to_a, unique_by: :script_hash, returning: %i[id script_hash])
lock_script_mappings = lock_script_returnings.rows.to_h { |id, script_hash| [script_hash, id] }
address_returnings = Address.upsert_all(addresses_attrs.to_a, unique_by: :lock_hash, returning: %i[id lock_hash])
new_addresses_attrs =
addresses_attrs.to_a.map do |attr|
attr.merge({ lock_script_id: lock_script_mappings[attr[:lock_hash]] })
end
address_returnings = Address.upsert_all(new_addresses_attrs, unique_by: :lock_hash, returning: %i[id lock_hash])

Check warning on line 57 in app/models/ckb_sync/transactions.rb

View check run for this annotation

Codecov / codecov/patch

app/models/ckb_sync/transactions.rb#L53-L57

Added lines #L53 - L57 were not covered by tests
address_mappings = address_returnings.rows.to_h { |id, lock_hash| [[lock_hash.sub(/^\\x/, "")].pack("H*"), id] }
type_script_mappings = {}
if type_script_attrs.present?
Expand Down
9 changes: 2 additions & 7 deletions app/workers/update_udt_info_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@ def perform(block_number)
return if local_block.blank?

type_hashes = []
local_block.cell_outputs.udt.select(:id, :type_hash).each do |udt_output|
type_hashes << udt_output.type_hash
end
local_block.cell_outputs.omiga_inscription.select(:id, :type_hash).each do |udt_output|
type_hashes << udt_output.type_hash
end
local_block.cell_outputs.xudt.select(:id, :type_hash).each do |udt_output|
local_block.cell_outputs.where(cell_type: ["udt", "omiga_inscription", "xudt", "xudt_compatible"]).
select(:id, :type_hash).each do |udt_output|
type_hashes << udt_output.type_hash
end
local_block.ckb_transactions.pluck(:id).each do |tx_id|
Expand Down
2 changes: 1 addition & 1 deletion lib/scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
clz = clz.constantize if clz.is_a?(String)

puts "invoking #{clz.name}"
clz.new.perform
clz.new.perform_async

Check warning on line 29 in lib/scheduler.rb

View check run for this annotation

Codecov / codecov/patch

lib/scheduler.rb#L29

Added line #L29 was not covered by tests
puts "fininsh #{clz.name}"
end

Expand Down
Loading