Skip to content

Commit 5ed342d

Browse files
authored
Merge pull request #2566 from nervosnetwork/testnet
Deploy to mainnet
2 parents 8c8b0fc + b1d0679 commit 5ed342d

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

app/models/concerns/cell_outputs/extra_info.rb

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,28 @@ def m_nft_info
5757
def dob_info
5858
return unless cell_type.in?(%w(spore_cluster spore_cell did_cell))
5959

60-
case cell_type
61-
when "spore_cluster"
62-
tc = TokenCollection.find_by(sn: type_hash)
63-
value = { cluster_name: tc&.name, published: !tc.nil?, type_hash: }
64-
else
65-
ti = TokenItem.find_by(type_script_id:)
66-
coll = ti.collection
67-
68-
value = {
69-
cluster_name: coll&.name,
70-
token_id: ti.token_id,
71-
collection: {
72-
type_hash: coll&.sn,
73-
},
74-
published: true,
75-
}
76-
end
60+
value =
61+
case cell_type
62+
when "spore_cluster"
63+
tc = TokenCollection.find_by(sn: type_hash)
64+
{ cluster_name: tc&.name, published: !tc.nil?, type_hash: }
65+
else
66+
ti = TokenItem.find_by(type_script_id:)
67+
if ti
68+
coll = ti.collection
69+
70+
{
71+
cluster_name: coll&.name,
72+
token_id: ti.token_id,
73+
collection: {
74+
type_hash: coll&.sn,
75+
},
76+
published: true,
77+
}
78+
else
79+
{}
80+
end
81+
end
7782

7883
CkbUtils.hash_value_to_s(value)
7984
end

0 commit comments

Comments
 (0)