Skip to content

Commit

Permalink
fix: rollback format
Browse files Browse the repository at this point in the history
  • Loading branch information
wei3erHase committed Sep 25, 2024
1 parent ecb70cc commit 028930d
Showing 1 changed file with 21 additions and 31 deletions.
52 changes: 21 additions & 31 deletions program/tests/functional.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ async fn test_token_vesting() {
seeds,
)
.unwrap()];
let mut init_transaction =
Transaction::new_with_payer(&init_instruction, Some(&payer.pubkey()));
let mut init_transaction = Transaction::new_with_payer(
&init_instruction,
Some(&payer.pubkey()),
);
init_transaction.partial_sign(&[&payer], recent_blockhash);
banks_client
.process_transaction(init_transaction)
.await
.unwrap();
banks_client.process_transaction(init_transaction).await.unwrap();

// Initialize the token accounts
banks_client.process_transaction(mint_init_transaction(
Expand All @@ -65,27 +64,22 @@ async fn test_token_vesting() {
recent_blockhash,
))
.await.unwrap();

banks_client
.process_transaction(create_token_account(

banks_client.process_transaction(create_token_account(
&payer,
&mint,
recent_blockhash,
&source_token_account,
&source_account.pubkey(),
))
.await
.unwrap();
banks_client
.process_transaction(create_token_account(
)).await.unwrap();
banks_client.process_transaction(
create_token_account(
&payer,
&mint,
recent_blockhash,
&vesting_token_account,
&vesting_account_key,
))
.await
.unwrap();
)).await.unwrap();

// Create and process the vesting transactions
let setup_instructions = [mint_to(
Expand Down Expand Up @@ -133,20 +127,14 @@ async fn test_token_vesting() {
Transaction::new_with_payer(&setup_instructions, Some(&payer.pubkey()));
setup_transaction.partial_sign(&[&payer, &mint_authority], recent_blockhash);

banks_client
.process_transaction(setup_transaction)
.await
.unwrap();
banks_client.process_transaction(setup_transaction).await.unwrap();

// Process transaction on test network
let mut test_transaction =
Transaction::new_with_payer(&test_instructions, Some(&payer.pubkey()));
test_transaction.partial_sign(&[&payer, &source_account], recent_blockhash);

banks_client
.process_transaction(test_transaction)
.await
.unwrap();
banks_client.process_transaction(test_transaction).await.unwrap();
}

#[tokio::test]
Expand Down Expand Up @@ -195,8 +183,10 @@ async fn test_token_unlocking() {
seeds,
)
.unwrap()];
let mut init_transaction =
Transaction::new_with_payer(&init_instruction, Some(&payer.pubkey()));
let mut init_transaction = Transaction::new_with_payer(
&init_instruction,
Some(&payer.pubkey()),
);
init_transaction.partial_sign(&[&payer], recent_blockhash);
banks_client
.process_transaction(init_transaction)
Expand All @@ -214,8 +204,8 @@ async fn test_token_unlocking() {
.await
.unwrap();

banks_client
.process_transaction(create_token_account(
banks_client.process_transaction(
create_token_account(
&payer,
&mint,
recent_blockhash,
Expand All @@ -224,8 +214,8 @@ async fn test_token_unlocking() {
))
.await
.unwrap();
banks_client
.process_transaction(create_token_account(
banks_client.process_transaction(
create_token_account(
&payer,
&mint,
recent_blockhash,
Expand Down

0 comments on commit 028930d

Please sign in to comment.