style: fix rustfmt trailing newline and replace unwrap with expect for clippy

This commit is contained in:
bristinWild 2026-06-02 02:36:51 +05:30
parent 16738c7def
commit 029f617737
2 changed files with 39 additions and 8 deletions

View File

@ -61,7 +61,12 @@ impl Accounts {
name: String::from("Gold"),
total_supply: 1_000_000_u128,
metadata_id: None,
mint_authority: Some(Ids::token_definition().as_ref().try_into().unwrap()),
mint_authority: Some(
Ids::token_definition()
.as_ref()
.try_into()
.expect("AccountId is always 32 bytes"),
),
}),
nonce: Nonce(0),
}
@ -75,7 +80,12 @@ impl Accounts {
name: String::from("Gold"),
total_supply: 1_000_000_u128,
metadata_id: None,
mint_authority: Some(Ids::token_definition().as_ref().try_into().unwrap()),
mint_authority: Some(
Ids::token_definition()
.as_ref()
.try_into()
.expect("AccountId is always 32 bytes"),
),
}),
nonce: Nonce(0),
}
@ -418,7 +428,12 @@ fn token_burn() {
name: String::from("Gold"),
total_supply: 800_000_u128,
metadata_id: None,
mint_authority: Some(Ids::token_definition().as_ref().try_into().unwrap()),
mint_authority: Some(
Ids::token_definition()
.as_ref()
.try_into()
.expect("AccountId is always 32 bytes")
),
}),
nonce: Nonce(0),
}
@ -468,7 +483,12 @@ fn token_mint() {
name: String::from("Gold"),
total_supply: 1_500_000_u128,
metadata_id: None,
mint_authority: Some(Ids::token_definition().as_ref().try_into().unwrap()),
mint_authority: Some(
Ids::token_definition()
.as_ref()
.try_into()
.expect("AccountId is always 32 bytes")
),
}),
nonce: Nonce(1),
}
@ -590,7 +610,12 @@ fn token_mint_fresh_authorized_public_recipient() {
name: String::from("Gold"),
total_supply: 1_500_000_u128,
metadata_id: None,
mint_authority: Some(Ids::token_definition().as_ref().try_into().unwrap()),
mint_authority: Some(
Ids::token_definition()
.as_ref()
.try_into()
.expect("AccountId is always 32 bytes")
),
}),
nonce: Nonce(1),
}
@ -926,7 +951,10 @@ fn token_deshielded_transfer() {
fn token_new_fungible_definition_with_authority() {
let mut state = V03State::new_with_genesis_accounts(&[], vec![], 0);
deploy_token(&mut state);
let authority_key: [u8; 32] = Ids::token_definition().as_ref().try_into().unwrap();
let authority_key: [u8; 32] = Ids::token_definition()
.as_ref()
.try_into()
.expect("AccountId is always 32 bytes");
let instruction = token_core::Instruction::NewFungibleDefinitionWithAuthority {
name: String::from("AuthCoin"),
initial_supply: 1_000_000_u128,
@ -965,7 +993,10 @@ fn token_new_fungible_definition_with_authority() {
fn token_set_authority_revoke() {
let mut state = V03State::new_with_genesis_accounts(&[], vec![], 0);
deploy_token(&mut state);
let authority_key: [u8; 32] = Ids::token_definition().as_ref().try_into().unwrap();
let authority_key: [u8; 32] = Ids::token_definition()
.as_ref()
.try_into()
.expect("AccountId is always 32 bytes");
// Create token with authority
let instruction = token_core::Instruction::NewFungibleDefinitionWithAuthority {

View File

@ -43,4 +43,4 @@ pub fn set_authority(
definition_post.data = Data::from(&definition);
vec![AccountPostState::new(definition_post)]
}
}