Skip to content

Commit cb3328c

Browse files
authored
Merge pull request #2382 from nervosnetwork/develop
Deploy to testnet
2 parents a96540f + a3caf63 commit cb3328c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

app/workers/token_collection_tag_worker.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def invalid_char?(name)
3535
end
3636

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

4141
def out_of_length?(name)

test/workers/token_collection_tag_worker_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ class TokenCollectionTagWorkerTest < ActiveJob::TestCase
1919
assert_equal ["suspicious"], TokenCollection.last.tags
2020
end
2121

22+
test "add suspicious tag to token_collection when blanks are not continuous" do
23+
create(:token_collection, name: "C K B B", cell_id: @cell.id, creator_id: @address.id)
24+
TokenCollectionTagWorker.new.perform
25+
assert_equal ["rgb++", "layer-1-asset"], TokenCollection.last.tags
26+
end
27+
2228
test "add out-of-length-range tag to token_collection" do
2329
create(:token_collection, name: "C" * 66, cell_id: @cell.id, creator_id: @address.id)
2430
TokenCollectionTagWorker.new.perform

0 commit comments

Comments
 (0)