Skip to content
This repository has been archived by the owner on Feb 11, 2025. It is now read-only.

Commit

Permalink
Quick-start: update snippet (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmikolajczyk41 authored Jan 30, 2024
1 parent a89802f commit c215044
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions examples/quick-start-with-drink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,19 @@ Your typical test module will look like:
```rust
#[cfg(test)]
mod tests {
use drink::session::{Session, NO_ARGS, NO_ENDOWMENT, NO_SALT};

#[drink::contract_bundle_provider]
enum BundleProvider {}

#[drink::test]
fn deploy_and_call_a_contract() -> Result<(), Box<dyn Error>> {
let result: bool = Session::<MinimalRuntime>::new()?
.deploy_bundle_and(BundleProvider::local(), "new", &["true"], vec![], None)?
.call_and("flip", NO_ARGS, None)?
.call_and("flip", NO_ARGS, None)?
.call_and("flip", NO_ARGS, None)?
.call("get", NO_ARGS, None)??;
fn deploy_and_call_a_contract(mut session: Session) -> Result<(), Box<dyn Error>> {
let result: bool = session
.deploy_bundle_and(BundleProvider::local(), "new", &["true"], NO_SALT, NO_ENDOWMENT)?
.call_and("flip", NO_ARGS, NO_ENDOWMENT)?
.call_and("flip", NO_ARGS, NO_ENDOWMENT)?
.call_and("flip", NO_ARGS, NO_ENDOWMENT)?
.call("get", NO_ARGS, NO_ENDOWMENT)??;
assert_eq!(result, false);
}
}
Expand Down

0 comments on commit c215044

Please sign in to comment.