From 0c36d71ab15cef4cc500a2c41aafe3ab6b854f4e Mon Sep 17 00:00:00 2001 From: Miles Zhang Date: Fri, 20 Dec 2024 19:56:19 +0900 Subject: [PATCH 1/3] chore: add new xudt compatible code hash (#2358) Signed-off-by: Miles Zhang --- app/models/ckb_sync/api.rb | 2 +- config/settings.mainnet.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/ckb_sync/api.rb b/app/models/ckb_sync/api.rb index 578879118..e55d90986 100644 --- a/app/models/ckb_sync/api.rb +++ b/app/models/ckb_sync/api.rb @@ -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_compatible3_code_hash] + [Settings.xudt_compatible_code_hash, Settings.xudt_compatible2_code_hash, Settings.xudt_compatible3_code_hash, Settings.xudt_compatible4_code_hash] end def unique_cell_code_hash diff --git a/config/settings.mainnet.yml b/config/settings.mainnet.yml index bbc2f5c80..b68e08602 100644 --- a/config/settings.mainnet.yml +++ b/config/settings.mainnet.yml @@ -39,6 +39,7 @@ unique_cell_code_hash: "0x2c8c11c985da60b0a330c61a85507416d6382c130ba67f0c47ab07 xudt_compatible_code_hash: "0x092c2c4a26ea475a8e860c29cf00502103add677705e2ccd8d6fe5af3caa5ae3" xudt_compatible2_code_hash: "0x26a33e0815888a4a0614a0b7d09fa951e0993ff21e55905510104a0b1312032b" xudt_compatible3_code_hash: "0x42a0b2aacc836c0fc2bbd421a9020de42b8411584190f30be547fdf54214acc3" +xudt_compatible4_code_hash: "0xbfa35a9c38a676682b65ade8f02be164d48632281477e36f8dc2f41f79e56bfc" # stablepp_pool stablepp_pool_code_hash: "0x26622198b66240e437e323e0fecf1c26ba3c8c28a45f03ed3ebb9f7f2bdc0055" From c4a86f1c64b50f0761c39f72a073bb9caffac014 Mon Sep 17 00:00:00 2001 From: Miles Zhang Date: Sat, 21 Dec 2024 15:41:14 +0900 Subject: [PATCH 2/3] hotfix address validate Signed-off-by: Miles Zhang --- app/models/address.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/address.rb b/app/models/address.rb index 4381be719..0f734c8d2 100644 --- a/app/models/address.rb +++ b/app/models/address.rb @@ -17,8 +17,8 @@ class Address < ApplicationRecord has_one :bitcoin_address_mapping, foreign_key: "ckb_address_id" has_one :bitcoin_address, through: :bitcoin_address_mapping - validates :balance, :cell_consumed, :ckb_transactions_count, :interest, :dao_deposit, - numericality: { greater_than_or_equal_to: 0 }, allow_nil: true + # validates :balance, :cell_consumed, :ckb_transactions_count, :interest, :dao_deposit, + # numericality: { greater_than_or_equal_to: 0 }, allow_nil: true validates :lock_hash, presence: true, uniqueness: true scope :visible, -> { where(visible: true) } From 2f55b981da422ed89c4052d6477136b67dfd09ec Mon Sep 17 00:00:00 2001 From: Miles Zhang Date: Sat, 21 Dec 2024 16:36:14 +0900 Subject: [PATCH 3/3] Revert "hotfix address validate" --- app/models/address.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/address.rb b/app/models/address.rb index 0f734c8d2..4381be719 100644 --- a/app/models/address.rb +++ b/app/models/address.rb @@ -17,8 +17,8 @@ class Address < ApplicationRecord has_one :bitcoin_address_mapping, foreign_key: "ckb_address_id" has_one :bitcoin_address, through: :bitcoin_address_mapping - # validates :balance, :cell_consumed, :ckb_transactions_count, :interest, :dao_deposit, - # numericality: { greater_than_or_equal_to: 0 }, allow_nil: true + validates :balance, :cell_consumed, :ckb_transactions_count, :interest, :dao_deposit, + numericality: { greater_than_or_equal_to: 0 }, allow_nil: true validates :lock_hash, presence: true, uniqueness: true scope :visible, -> { where(visible: true) }