Skip to content

Commit

Permalink
Merge pull request #2271 from nervosnetwork/testnet
Browse files Browse the repository at this point in the history
Deploy to mainnet
  • Loading branch information
zmcNotafraid authored Nov 10, 2024
2 parents c63698c + e930952 commit 82659bd
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 141 deletions.
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/nervosnetwork/ckb-sdk-ruby.git
revision: 1790c72fb886bda3e30936a73bc3d1cbcee6c91f
revision: 4b43de58fb69cc046b3cef234d70fd9657711ff6
specs:
ckb-sdk-ruby (0.103.0)
net-http-persistent (~> 4.0.1)
Expand Down Expand Up @@ -295,7 +295,7 @@ GEM
ruby2_keywords (>= 0.0.5)
msgpack (1.6.0)
murmurhash3 (0.1.7)
net-http-persistent (4.0.2)
net-http-persistent (4.0.4)
connection_pool (~> 2.2)
net-imap (0.4.10)
date
Expand All @@ -321,7 +321,7 @@ GEM
parser (3.2.2.0)
ast (~> 2.4.1)
pg (1.4.5)
pkg-config (1.5.2)
pkg-config (1.5.7)
protocol-hpack (1.4.2)
protocol-http (0.24.7)
protocol-http1 (0.15.1)
Expand Down Expand Up @@ -390,8 +390,8 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rbnacl (7.1.1)
ffi
rbnacl (7.1.2)
ffi (~> 1)
rbsecp256k1 (5.1.1)
mini_portile2 (~> 2.8)
pkg-config (~> 1.5)
Expand Down
2 changes: 1 addition & 1 deletion app/models/ckb_sync/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def xudt_data_hash
end

def xudt_compatible_code_hashes
[Settings.xudt_compatible_code_hash, Settings.xudt_compatible2_code_hash]
[Settings.xudt_compatible_code_hash, Settings.xudt_compatible2_code_hash, Settings.xudt_compatible3_code_hash]
end

def unique_cell_code_hash
Expand Down
2 changes: 1 addition & 1 deletion app/models/ckb_sync/new_node_data_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ def build_udts!(local_block, outputs, outputs_data)
binary_hashes = CkbUtils.hexes_to_bins_sql(CkbSync::Api.instance.spore_cluster_code_hashes)
spore_cluster_type_ids = TypeScript.where("code_hash IN (#{binary_hashes})").where(hash_type: "data1", args: parsed_spore_cell[:cluster_id]).pluck(:id)
if spore_cluster_type_ids.present?
spore_cluster_cell = CellOutput.live.where(type_script_id: spore_cluster_type_ids).last
spore_cluster_cell = CellOutput.where(type_script_id: spore_cluster_type_ids, status: %i[pending live]).last
parsed_cluster_data = CkbUtils.parse_spore_cluster_data(spore_cluster_cell.data)
nft_token_attr[:full_name] = parsed_cluster_data[:name]
end
Expand Down
132 changes: 0 additions & 132 deletions app/utils/ckb_address_parser.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/utils/ckb_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def self.generate_address(lock_script, version = CKB::Address::Version::CKB2021)
end

def self.parse_address(address_hash)
CkbAddressParser.new(address_hash).parse
CKB::AddressParser.new(address_hash).parse
end

def self.block_reward(block_number, block_economic_state)
Expand Down
1 change: 1 addition & 0 deletions config/settings.testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ unique_cell_code_hash: "0x8e341bcfec6393dcd41e635733ff2dca00a6af546949f70c57a706
# xudt compatible
xudt_compatible_code_hash: "0x98701eaf939113606a8a70013fd2e8f27b8f1e234acdc329f3d71f9e9d3d3233"
xudt_compatible2_code_hash: "0x1142755a044bf2ee358cba9f2da187ce928c91cd4dc8692ded0337efa677d21a"
xudt_compatible3_code_hash: "0xcc9dc33ef234e14bc788c43a4848556a5fb16401a04662fc55db9bb201987037" # stable coin

# hash length of an attribute(especially which comes from bytea column),
# e.g. Block.uncle_block_hashes: "0x587f354162afd133b4a4f7a4b621d11e043c3c08b0af2801f1686b5403b14953", which has a length of 66 ( 2 + 64)
Expand Down
2 changes: 1 addition & 1 deletion test/utils/ckb_utils_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CkbUtilsTest < ActiveSupport::TestCase
end

test ".parse_address raise error when address is mainnet address and mode is testnet" do
assert_raises CkbAddressParser::InvalidPrefixError do
assert_raises CKB::AddressParser::InvalidPrefixError do
CkbUtils.parse_address("haha1qygndsefa43s6m882pcj53m4gdnj4k440axqsm2hnz")
end
end
Expand Down

0 comments on commit 82659bd

Please sign in to comment.