Skip to content

Commit

Permalink
explanations
Browse files Browse the repository at this point in the history
  • Loading branch information
pmikolajczyk41 committed Nov 22, 2023
1 parent 38f962e commit e5a2467
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/runtime-interaction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ You can always switch from `Session` to `Sandbox` with:
...
let sandbox = session.sandbox(); // `sandbox` has type `&mut Sandbox<Runtime>`
```

A rule of thumb is: if you are working with contracts, use `Session`, otherwise use `Sandbox`.
3 changes: 3 additions & 0 deletions examples/runtime-interaction/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ mod tests {
.expect("Failed to remove a contract");
}

/// This is just a dummy contract code, that does nothing. It is written in WAT, a text format
/// for WebAssembly. We need to have some valid contract bytes in order for `upload_contract`
/// to succeed.
const CONTRACT: &str = r#"
(module
(import "seal0" "seal_deposit_event" (func $seal_deposit_event (param i32 i32 i32 i32)))
Expand Down

0 comments on commit e5a2467

Please sign in to comment.