Skip to content

Commit

Permalink
chore: drop useless error and use into() for type convertion
Browse files Browse the repository at this point in the history
  • Loading branch information
n00m4d committed Sep 24, 2024
1 parent af14fcb commit 7fd4993
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
2 changes: 0 additions & 2 deletions programs/bubblegum/program/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ pub enum BubblegumError {
StakingVoterAuthorityMismatch,
#[msg("Invalid mining owner")]
MiningOwnerMismatch,
#[msg("Cannot create pubkey from string")]
PubkeyReconstruction,
}

// Converts certain Token Metadata errors into Bubblegum equivalents
Expand Down
24 changes: 12 additions & 12 deletions programs/bubblegum/program/tests/batch-mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ async fn initialize_staking_accounts(

let registrar = Registrar {
governance_program_id: governance_program_id.clone(),
realm: Pubkey::new_from_array(DAO_PUBKEY),
realm_governing_token_mint: Pubkey::new_from_array(DAO_GOVERNING_MINT),
realm: DAO_PUBKEY.into(),
realm_governing_token_mint: DAO_GOVERNING_MINT.into(),
realm_authority: realm_authority.clone(),
voting_mints: [voting_mint_config, voting_mint_config],
reward_pool: reward_pool_key,
Expand Down Expand Up @@ -301,7 +301,7 @@ async fn test_prepare_tree_without_canopy() {
let (registrar_key, voter_key, mining_key) =
initialize_staking_accounts(&mut program_context).await;

let fee_receiver = Pubkey::new_from_array(FEE_RECEIVER);
let fee_receiver = FEE_RECEIVER.into();

program_context
.fund_account(tree.creator_pubkey(), 10_000_000_000)
Expand Down Expand Up @@ -352,7 +352,7 @@ async fn test_prepare_tree_without_canopy() {

for proof in rightmost_proof {
tree_tx_builder.additional_accounts.push(AccountMeta {
pubkey: Pubkey::new_from_array(proof),
pubkey: proof.into(),
is_signer: false,
is_writable: false,
});
Expand Down Expand Up @@ -443,7 +443,7 @@ async fn test_prepare_tree_with_canopy() {
.unwrap();
}

let fee_receiver = Pubkey::new_from_array(FEE_RECEIVER);
let fee_receiver = FEE_RECEIVER.into();

let mut tree_tx_builder = tree.finalize_tree_with_root_tx(
&program_context.test_context().payer,
Expand Down Expand Up @@ -524,7 +524,7 @@ async fn test_put_wrong_canopy() {
.unwrap();
}

let fee_receiver = Pubkey::new_from_array(FEE_RECEIVER);
let fee_receiver = FEE_RECEIVER.into();

let mut tree_tx_builder = tree.finalize_tree_with_root_tx(
&program_context.test_context().payer,
Expand All @@ -542,7 +542,7 @@ async fn test_put_wrong_canopy() {

for proof in rightmost_proof {
tree_tx_builder.additional_accounts.push(AccountMeta {
pubkey: Pubkey::new_from_array(proof),
pubkey: proof.into(),
is_signer: false,
is_writable: false,
});
Expand Down Expand Up @@ -634,7 +634,7 @@ async fn test_put_wrong_fee_receiver() {
let (registrar_key, voter_key, mining_key) =
initialize_staking_accounts(&mut program_context).await;

let fee_receiver = Pubkey::new_from_array(FEE_RECEIVER);
let fee_receiver = FEE_RECEIVER.into();

program_context
.fund_account(tree.creator_pubkey(), 10_000_000_000)
Expand Down Expand Up @@ -672,7 +672,7 @@ async fn test_put_wrong_fee_receiver() {

for proof in rightmost_proof {
tree_tx_builder.additional_accounts.push(AccountMeta {
pubkey: Pubkey::new_from_array(proof),
pubkey: proof.into(),
is_signer: false,
is_writable: false,
});
Expand Down Expand Up @@ -715,7 +715,7 @@ async fn test_prepare_tree_with_collection() {
)
.await;

let fee_receiver = Pubkey::new_from_array(FEE_RECEIVER);
let fee_receiver = FEE_RECEIVER.into();

let rightmost_proof = tree.proof_of_leaf((num_of_assets_to_mint - 1) as u32);
let rightmost_leaf = tree.get_node(num_of_assets_to_mint - 1);
Expand Down Expand Up @@ -760,7 +760,7 @@ async fn test_prepare_tree_with_collection() {

for proof in rightmost_proof {
tree_tx_builder.additional_accounts.push(AccountMeta {
pubkey: Pubkey::new_from_array(proof),
pubkey: proof.into(),
is_signer: false,
is_writable: false,
});
Expand Down Expand Up @@ -788,7 +788,7 @@ async fn test_prepare_tree_with_collection_wrong_authority() {
)
.await;

let fee_receiver = Pubkey::new_from_array(FEE_RECEIVER);
let fee_receiver = FEE_RECEIVER.into();

let rightmost_leaf = tree.get_node(num_of_assets_to_mint - 1);

Expand Down

0 comments on commit 7fd4993

Please sign in to comment.