File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
pallets/subtensor/src/utils Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,15 @@ impl<T: Config> Pallet<T> {
167
167
. saturating_add ( identity. description . len ( ) )
168
168
. saturating_add ( identity. additional . len ( ) ) ;
169
169
170
- total_length <= 256 + 256 + 256 + 1024 + 256 + 1024 + 1024
170
+ let max_length: usize = 256_usize
171
+ . saturating_add ( 256 )
172
+ . saturating_add ( 256 )
173
+ . saturating_add ( 1024 )
174
+ . saturating_add ( 256 )
175
+ . saturating_add ( 1024 )
176
+ . saturating_add ( 1024 ) ;
177
+
178
+ total_length <= max_length
171
179
&& identity. name . len ( ) <= 256
172
180
&& identity. url . len ( ) <= 256
173
181
&& identity. github_repo . len ( ) <= 256
@@ -197,7 +205,15 @@ impl<T: Config> Pallet<T> {
197
205
. saturating_add ( identity. github_repo . len ( ) )
198
206
. saturating_add ( identity. subnet_contact . len ( ) ) ;
199
207
200
- total_length <= 256 + 1024 + 1024 + 1024 + 256 + 1024 + 1024
208
+ let max_length: usize = 256_usize
209
+ . saturating_add ( 1024 )
210
+ . saturating_add ( 1024 )
211
+ . saturating_add ( 1024 )
212
+ . saturating_add ( 256 )
213
+ . saturating_add ( 1024 )
214
+ . saturating_add ( 1024 ) ;
215
+
216
+ total_length <= max_length
201
217
&& identity. subnet_name . len ( ) <= 256
202
218
&& identity. github_repo . len ( ) <= 1024
203
219
&& identity. subnet_contact . len ( ) <= 1024
You can’t perform that action at this time.
0 commit comments