Skip to content

Commit

Permalink
Merge pull request #2382 from nervosnetwork/develop
Browse files Browse the repository at this point in the history
Deploy to testnet
zmcNotafraid authored Jan 2, 2025
2 parents a96540f + a3caf63 commit cb3328c
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/workers/token_collection_tag_worker.rb
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ def invalid_char?(name)
end

def invisible_char?(name)
(name =~ /^[\x21-\x7E\u4E00-\u9FFF]+(?:\s[\x21-\x7E\u4E00-\u9FFF]+)?$/).nil?
(name =~ /^[\x21-\x7E\u4E00-\u9FFF]+(?:\s[\x21-\x7E\u4E00-\u9FFF]+)*$/).nil?
end

def out_of_length?(name)
6 changes: 6 additions & 0 deletions test/workers/token_collection_tag_worker_test.rb
Original file line number Diff line number Diff line change
@@ -19,6 +19,12 @@ class TokenCollectionTagWorkerTest < ActiveJob::TestCase
assert_equal ["suspicious"], TokenCollection.last.tags
end

test "add suspicious tag to token_collection when blanks are not continuous" do
create(:token_collection, name: "C K B B", cell_id: @cell.id, creator_id: @address.id)
TokenCollectionTagWorker.new.perform
assert_equal ["rgb++", "layer-1-asset"], TokenCollection.last.tags
end

test "add out-of-length-range tag to token_collection" do
create(:token_collection, name: "C" * 66, cell_id: @cell.id, creator_id: @address.id)
TokenCollectionTagWorker.new.perform

0 comments on commit cb3328c

Please sign in to comment.