Skip to content

Commit 874a7c3

Browse files
authored
Update linting + bad comment (#170)
* npm audit fix * Bad code comment * Update linting * Update npm
1 parent eae0263 commit 874a7c3

File tree

8 files changed

+335
-374
lines changed

8 files changed

+335
-374
lines changed

client-js/package-lock.json

Lines changed: 317 additions & 338 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/contract/src/entry_points.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,7 @@ pub fn change_security() -> EntryPoint {
227227
// Optional Arguments (can be added or omitted when calling):
228228
/*
229229
- "admin_list" : Vec<Key>
230-
- "mint_and_burn_list" : Vec<Key>
231230
- "minter_list" : Vec<Key>
232-
- "burner_list" : Vec<Key>
233231
- "none_list" : Vec<Key>
234232
*/
235233
],

tests/src/allowance.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ fn should_not_transfer_from_without_enough_allowance() {
143143
let error = builder.get_error().expect("should have error");
144144
assert!(
145145
matches!(error, CoreError::Exec(ExecError::Revert(ApiError::User(user_error))) if user_error == Cep18Error::InsufficientAllowance as u16),
146-
"{:?}",
147-
error
146+
"{error:?}"
148147
);
149148
}
150149

tests/src/install.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ fn should_not_store_balances_or_allowances_under_account_after_install() {
7171

7272
let named_keys = builder.get_named_keys_by_account_hash(*DEFAULT_ACCOUNT_ADDR);
7373

74-
assert!(!named_keys.contains(DICT_BALANCES), "{:?}", named_keys);
75-
assert!(!named_keys.contains(DICT_ALLOWANCES), "{:?}", named_keys);
74+
assert!(!named_keys.contains(DICT_BALANCES), "{named_keys:?}",);
75+
assert!(!named_keys.contains(DICT_ALLOWANCES), "{named_keys:?}");
7676
}
7777

7878
#[test]
@@ -104,7 +104,6 @@ fn should_fail_with_left_over_bytes_converted_into_60006() {
104104
error,
105105
CoreError::Exec(ExecError::Revert(ApiError::User(60006)))
106106
),
107-
"{:?}",
108-
error
107+
"{error:?}",
109108
);
110109
}

tests/src/mint_and_burn.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ fn test_should_not_mint_above_limits() {
195195
let error = builder.get_error().expect("should have error");
196196
assert!(
197197
matches!(error, CoreError::Exec(ExecError::Revert(ApiError::User(user_error))) if user_error == Cep18Error::Overflow as u16),
198-
"Should not mint above limits, but instead: {:?}",
199-
error
198+
"Should not mint above limits, but instead: {error:?}",
200199
);
201200
}
202201

@@ -233,8 +232,7 @@ fn test_should_not_burn_above_balance() {
233232
let error = builder.get_error().expect("should have error");
234233
assert!(
235234
matches!(error, CoreError::Exec(ExecError::Revert(ApiError::User(user_error))) if user_error == Cep18Error::InsufficientBalance as u16),
236-
"{:?}",
237-
error
235+
"{error:?}",
238236
);
239237
}
240238

@@ -274,8 +272,7 @@ fn test_should_not_mint_or_burn_with_entrypoint_disabled() {
274272
let error = builder.get_error().expect("should have error");
275273
assert!(
276274
matches!(error, CoreError::Exec(ExecError::Revert(ApiError::User(user_error))) if user_error == 60016),
277-
"{:?}",
278-
error
275+
"{error:?}",
279276
);
280277

281278
let burn_request = ExecuteRequestBuilder::contract_call_by_hash(
@@ -294,8 +291,7 @@ fn test_should_not_mint_or_burn_with_entrypoint_disabled() {
294291
let error = builder.get_error().expect("should have error");
295292
assert!(
296293
matches!(error, CoreError::Exec(ExecError::Revert(ApiError::User(user_error))) if user_error == 60016),
297-
"{:?}",
298-
error
294+
"{error:?}",
299295
);
300296
}
301297

@@ -336,8 +332,7 @@ fn test_security_no_rights() {
336332
let error = builder.get_error().expect("should have error");
337333
assert!(
338334
matches!(error, CoreError::Exec(ExecError::Revert(ApiError::User(user_error))) if user_error == 60010),
339-
"{:?}",
340-
error
335+
"{error:?}",
341336
);
342337

343338
let passing_admin_mint_request = ExecuteRequestBuilder::contract_call_by_hash(
@@ -442,8 +437,7 @@ fn test_security_burner_rights() {
442437
let error = builder.get_error().expect("should have error");
443438
assert!(
444439
matches!(error, CoreError::Exec(ExecError::Revert(ApiError::User(user_error))) if user_error == 60010),
445-
"{:?}",
446-
error
440+
"{error:?}",
447441
);
448442

449443
// mint by admin
@@ -532,7 +526,6 @@ fn test_change_security() {
532526
let error = builder.get_error().expect("should have error");
533527
assert!(
534528
matches!(error, CoreError::Exec(ExecError::Revert(ApiError::User(user_error))) if user_error == 60010),
535-
"{:?}",
536-
error
529+
"{error:?}",
537530
);
538531
}

tests/src/transfer.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ fn should_not_transfer_more_than_owned_balance() {
128128
let error = builder.get_error().expect("should have error");
129129
assert!(
130130
matches!(error, CoreError::Exec(ExecError::Revert(ApiError::User(user_error))) if user_error == Cep18Error::InsufficientBalance as u16),
131-
"{:?}",
132-
error
131+
"{error:?}",
133132
);
134133

135134
let account_1_balance_after =
@@ -348,8 +347,7 @@ fn should_not_be_able_to_own_transfer() {
348347
let error = builder.get_error().expect("should have error");
349348
assert!(
350349
matches!(error, CoreError::Exec(ExecError::Revert(ApiError::User(user_error))) if user_error == 60017),
351-
"{:?}",
352-
error
350+
"{error:?}",
353351
);
354352
}
355353

@@ -383,8 +381,7 @@ fn should_not_be_able_to_own_transfer_from() {
383381
let error = builder.get_error().expect("should have error");
384382
assert!(
385383
matches!(error, CoreError::Exec(ExecError::Revert(ApiError::User(user_error))) if user_error == 60017),
386-
"{:?}",
387-
error
384+
"{error:?}"
388385
);
389386

390387
let sender_balance_before =
@@ -414,8 +411,7 @@ fn should_not_be_able_to_own_transfer_from() {
414411
let error = builder.get_error().expect("should have error");
415412
assert!(
416413
matches!(error, CoreError::Exec(ExecError::Revert(ApiError::User(user_error))) if user_error == 60017),
417-
"{:?}",
418-
error
414+
"{error:?}"
419415
);
420416
}
421417

tests/src/utility/installer_request_builders.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub(crate) fn get_test_account(ending_string_index: &str) -> (Key, AccountHash,
125125
match accounts {
126126
Some(account) => account,
127127
None => {
128-
panic!("No account found for index {}", index);
128+
panic!("No account found for index {index}");
129129
}
130130
}
131131
}

tests/src/utility/message_handlers.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ pub fn message_topic(
1717
match query_result {
1818
StoredValue::MessageTopic(summary) => summary,
1919
_ => {
20-
panic!(
21-
"Stored value is not a message topic summary: {:?}",
22-
query_result
23-
);
20+
panic!("Stored value is not a message topic summary: {query_result:?}",);
2421
}
2522
}
2623
}
@@ -41,6 +38,6 @@ pub fn message_summary(
4138

4239
match query_result {
4340
StoredValue::Message(summary) => Ok(summary),
44-
_ => panic!("Stored value is not a message summary: {:?}", query_result),
41+
_ => panic!("Stored value is not a message summary: {query_result:?}"),
4542
}
4643
}

0 commit comments

Comments
 (0)