Skip to content

Commit b974d69

Browse files
authored
Merge pull request #246 from blueshift-gg/fix-function-import-in-mollusk-course
fix:function import in Mollusk course
2 parents 878db06 + 12bbfdc commit b974d69

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

src/app/content/courses/testing-with-mollusk/advanced-functionalities/de.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Um ein `Associated Token`Konto zu erstellen, können wir die Funktion `create_ac
154154

155155
```rust
156156
use spl_token::state::{TokenAccount, AccountState};
157-
use mollusk_svm_programs_token::associated_token::pub fn create_account_for_associated_token_account;
157+
use mollusk_svm_programs_token::associated_token::create_account_for_associated_token_account;
158158

159159
let token_data = TokenAccount {
160160
mint: Pubkey::new_unique(),

src/app/content/courses/testing-with-mollusk/advanced-functionalities/en.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ To create an `Associated Token` account we can use the `create_account_for_assoc
154154

155155
```rust
156156
use spl_token::state::{TokenAccount, AccountState};
157-
use mollusk_svm_programs_token::associated_token::pub fn create_account_for_associated_token_account;
157+
use mollusk_svm_programs_token::associated_token::create_account_for_associated_token_account;
158158

159159
let token_data = TokenAccount {
160160
mint: Pubkey::new_unique(),

src/app/content/courses/testing-with-mollusk/advanced-functionalities/id.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Untuk membuat akun `Associated Token` kita dapat menggunakan fungsi `create_acco
154154

155155
```rust
156156
use spl_token::state::{TokenAccount, AccountState};
157-
use mollusk_svm_programs_token::associated_token::pub fn create_account_for_associated_token_account;
157+
use mollusk_svm_programs_token::associated_token::create_account_for_associated_token_account;
158158

159159
let token_data = TokenAccount {
160160
mint: Pubkey::new_unique(),

src/app/content/courses/testing-with-mollusk/advanced-functionalities/uk.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ let token_account = create_account_for_token_account(token_data)
154154

155155
```rust
156156
use spl_token::state::{TokenAccount, AccountState};
157-
use mollusk_svm_programs_token::associated_token::pub fn create_account_for_associated_token_account;
157+
use mollusk_svm_programs_token::associated_token::create_account_for_associated_token_account;
158158

159159
let token_data = TokenAccount {
160160
mint: Pubkey::new_unique(),

src/app/content/courses/testing-with-mollusk/advanced-functionalities/vi.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ let token_account = create_account_for_token_account(token_data)
154154

155155
```rust
156156
use spl_token::state::{TokenAccount, AccountState};
157-
use mollusk_svm_programs_token::associated_token::pub fn create_account_for_associated_token_account;
157+
use mollusk_svm_programs_token::associated_token::create_account_for_associated_token_account;
158158

159159
let token_data = TokenAccount {
160160
mint: Pubkey::new_unique(),

src/app/content/courses/testing-with-mollusk/advanced-functionalities/zh-CN.mdx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn test() {
5656

5757
// Load the program into your mollusk instance
5858
mollusk.add_program(
59-
&ID,
59+
&ID,
6060
"target/deploy/program",
6161
&mollusk_svm::program::loader_keys::LOADER_V3
6262
);
@@ -93,11 +93,11 @@ fn test() {
9393

9494
```rust
9595
// SPL Token Program
96-
let (token_program, token_program_account) =
96+
let (token_program, token_program_account) =
9797
mollusk_svm_programs_token::token::keyed_account();
9898

9999
// Token2022 Program
100-
let (token2022_program, token2022_program_account) =
100+
let (token2022_program, token2022_program_account) =
101101
mollusk_svm_programs_token::token2022::keyed_account();
102102

103103
// Associated Token Program
@@ -154,7 +154,7 @@ let token_account = create_account_for_token_account(token_data)
154154

155155
```rust
156156
use spl_token::state::{TokenAccount, AccountState};
157-
use mollusk_svm_programs_token::associated_token::pub fn create_account_for_associated_token_account;
157+
use mollusk_svm_programs_token::associated_token::create_account_for_associated_token_account;
158158

159159
let token_data = TokenAccount {
160160
mint: Pubkey::new_unique(),
@@ -301,24 +301,24 @@ declare_builtin_function!(
301301
fn test_custom_syscall() {
302302
std::env::set_var("SBF_OUT_DIR", "../target/deploy");
303303
let program_id = Pubkey::new_unique();
304-
304+
305305
let mollusk = {
306306
let mut mollusk = Mollusk::default();
307-
307+
308308
// Register the custom syscall with a specific name
309309
mollusk
310310
.program_cache
311311
.program_runtime_environment
312312
.register_function("sol_burn_cus", SyscallBurnCus::vm)
313313
.unwrap();
314-
314+
315315
// Add your program that uses the custom syscall
316316
mollusk.add_program(
317317
&program_id,
318318
"test_program_custom_syscall",
319319
&mollusk_svm::program::loader_keys::LOADER_V3,
320320
);
321-
321+
322322
mollusk
323323
};
324324
}
@@ -338,7 +338,7 @@ fn instruction_burn_cus(program_id: &Pubkey, to_burn: u64) -> Instruction {
338338
#[test]
339339
fn test_custom_syscall() {
340340
// ... mollusk setup ...
341-
341+
342342
// Establish baseline compute unit usage
343343
let base_cus = mollusk
344344
.process_and_validate_instruction(
@@ -347,7 +347,7 @@ fn test_custom_syscall() {
347347
&[Check::success()],
348348
)
349349
.compute_units_consumed;
350-
350+
351351
// Test different compute unit consumption levels
352352
for to_burn in [100, 1_000, 10_000] {
353353
mollusk.process_and_validate_instruction(
@@ -399,13 +399,13 @@ use solana_sdk::feature_set::FeatureSet;
399399
#[test]
400400
fn test() {
401401
let mut mollusk = Mollusk::new(&program_id, "path/to/program.so");
402-
402+
403403
// Configure compute budget for performance testing
404404
mollusk.set_compute_budget(200_000);
405-
405+
406406
// Configure feature set to enable/disable specific Solana features
407407
mollusk.set_feature_set(FeatureSet::all_enabled());
408-
408+
409409
// Sysvars are handled automatically but can be customized if needed
410410
}
411411
```
@@ -437,7 +437,7 @@ Mollusk 提供了对所有系统变量(sysvars)的访问权限,程序在
437437
/// Mollusk sysvars wrapper for easy manipulation
438438
pub struct Sysvars {
439439
pub clock: Clock, // Current slot, epoch, and timestamp
440-
pub epoch_rewards: EpochRewards, // Epoch reward distribution info
440+
pub epoch_rewards: EpochRewards, // Epoch reward distribution info
441441
pub epoch_schedule: EpochSchedule, // Epoch timing and slot configuration
442442
pub last_restart_slot: LastRestartSlot, // Last validator restart information
443443
pub rent: Rent, // Rent calculation parameters
@@ -452,7 +452,7 @@ pub struct Sysvars {
452452
#[test]
453453
fn test() {
454454
let mut mollusk = Mollusk::new(&program_id, "path/to/program.so");
455-
455+
456456
// Customize clock for time-based testing
457457
mollusk.sysvars.clock.epoch = 10;
458458
mollusk.sysvars.clock.unix_timestamp = 1234567890;

src/app/content/courses/testing-with-mollusk/advanced-functionalities/zh-HK.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ let token_account = create_account_for_token_account(token_data)
154154

155155
```rust
156156
use spl_token::state::{TokenAccount, AccountState};
157-
use mollusk_svm_programs_token::associated_token::pub fn create_account_for_associated_token_account;
157+
use mollusk_svm_programs_token::associated_token::create_account_for_associated_token_account;
158158

159159
let token_data = TokenAccount {
160160
mint: Pubkey::new_unique(),

0 commit comments

Comments
 (0)