Skip to content

Commit

Permalink
Added tips about dynamic libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed Sep 30, 2024
1 parent a448be5 commit e97f8a3
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions contracts/ckb-std-tests/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,19 @@ pub fn main() -> Result<(), Error> {
test_query();
test_calc_data_hash();

// Context should not be dropped.
#[cfg(target_arch = "riscv64")]
#[allow(deprecated)]
let mut old_context = unsafe { ContextTypeOld::new() };
#[cfg(target_arch = "riscv64")]
test_dynamic_loading(&mut old_context);

// Context should not be dropped.
#[cfg(target_arch = "riscv64")]
let mut context = unsafe { ContextType::new() };
#[cfg(target_arch = "riscv64")]
test_dynamic_loading_c_impl(&mut context);

test_vm_version();
test_current_cycles();
test_since();
Expand All @@ -815,15 +828,5 @@ pub fn main() -> Result<(), Error> {
test_log();
}

#[cfg(target_arch = "riscv64")]
unsafe {
let mut context = ContextType::new();
#[allow(deprecated)]
let mut old_context = ContextTypeOld::new();

test_dynamic_loading(&mut old_context);
test_dynamic_loading_c_impl(&mut context);
}

Ok(())
}

0 comments on commit e97f8a3

Please sign in to comment.