Skip to content

Commit

Permalink
Merge pull request #2168 from nervosnetwork/develop
Browse files Browse the repository at this point in the history
Deploy to testnet
  • Loading branch information
zmcNotafraid committed Aug 30, 2024
2 parents 9e6e402 + d6780a9 commit 29c15a9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
6 changes: 0 additions & 6 deletions app/workers/xudt_tag_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ def mark_tags(udt)
["out-of-length-range"]
elsif utility_lp_token?(udt.args)
["utility"]
elsif !first_xudt?(udt.symbol, udt.block_timestamp)
["suspicious"]
elsif single_use_lock?(udt.issuer_address)
["supply-limited"]
elsif rgbpp_lock?(udt.issuer_address)
Expand All @@ -49,10 +47,6 @@ def out_of_length?(symbol)
symbol.length > 60
end

def first_xudt?(symbol, block_timestamp)
!Udt.published_xudt.where("LOWER(symbol) = ?", symbol.downcase).where("block_timestamp < ?", block_timestamp).exists?
end

def rgbpp_lock?(issuer_address)
address_code_hash = CkbUtils.parse_address(issuer_address).script.code_hash
issuer_address.present? && CkbSync::Api.instance.rgbpp_code_hash.include?(address_code_hash)
Expand Down
10 changes: 0 additions & 10 deletions test/workers/xudt_tag_worker_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,4 @@ class XudtTagWorkerTest < ActiveJob::TestCase
end
assert_equal ["utility", "rgb++"], XudtTag.last.tags
end

test "insert suspicious tag when not lp token but duplicate" do
udt = create(:udt, :xudt, symbol: "CKBBB", block_timestamp: 1.day.ago.to_i * 1000)
create(:xudt_tag, udt_id: udt.id, udt_type_hash: udt.type_hash, tags: ["rgb++", "layer-1-asset", "supply-limited"])
create(:udt, :xudt, symbol: "ckbbb", block_timestamp: Time.now.to_i * 1000, issuer_address: @address.address_hash)
assert_changes -> { XudtTag.count }, from: 1, to: 2 do
XudtTagWorker.new.perform
end
assert_equal ["suspicious", "rgb++"], XudtTag.last.tags
end
end

0 comments on commit 29c15a9

Please sign in to comment.