Skip to content

Commit

Permalink
Merge pull request #2383 from nervosnetwork/testnet
Browse files Browse the repository at this point in the history
Deploy to mainnet
  • Loading branch information
zmcNotafraid authored Jan 2, 2025
2 parents 0169d80 + cb3328c commit defa528
Show file tree
Hide file tree
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
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions test/workers/token_collection_tag_worker_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit defa528

Please sign in to comment.