Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
DougAnderson444 committed Jan 17, 2024
1 parent 22991f5 commit 692ef31
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 26 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions examples/crates/aggregate-wit-ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ minijinja = { version = "1.0.10" }
wasmtime = { version = "16", features = ['component-model'] }
wasmtime-wasi = "16.0"
thiserror = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

[lib]
crate-type = ["cdylib"]
Expand All @@ -26,8 +24,7 @@ package = "wallet:aggregate-wit-ui"
[package.metadata.component.dependencies]

[package.metadata.component.target.dependencies]
"seed-keeper:wit-ui" = { path = "../../../crates/seed-keeper-wit-ui/wit" }
"example:edwards-ui" = { path = "../edwards-ui/wit" }

"seed-keeper:wit-ui" = { path = "wit/deps/seed-keeper-ui" }
"example:edwards-ui" = { path = "wit/deps/edwards-ui" }
"seed-keeper:edwards-wit" = { path = "wit/deps/edwards" }
"seed-keeper:wallet" = { path = "../../../crates/seed-keeper-wallet/wit" }
"seed-keeper:wallet" = { path = "wit/deps/wallet" }
20 changes: 3 additions & 17 deletions examples/crates/aggregate-wit-ui/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
//! Note: In order for this to run, we need to include the WIT dependencies in ./wit/deps/*,
//! which is copy and paste from the source directory.
mod bindgen {
// name of the world in the .wit file
wasmtime::component::bindgen!("example");
wasmtime::component::bindgen!("agg");
}

use serde::{Deserialize, Serialize};
use std::{
env,
path::{Path, PathBuf},
Expand Down Expand Up @@ -109,10 +107,6 @@ pub enum TestError {
/// From io
#[error("IO: {0}")]
Io(#[from] std::io::Error),

/// From serde_json
#[error("Serde JSON: {0}")]
SerdeJson(#[from] serde_json::Error),
}

impl From<String> for TestError {
Expand All @@ -121,14 +115,6 @@ impl From<String> for TestError {
}
}

#[derive(Debug, Serialize, Deserialize)]
struct TestFixtures {
seed: Vec<u8>,
encrypted: Vec<u8>,
username: Vec<u8>,
password: Vec<u8>,
}

/// Utility function to get the workspace dir
pub fn workspace_dir() -> PathBuf {
let output = std::process::Command::new(env!("CARGO"))
Expand Down Expand Up @@ -170,7 +156,7 @@ mod aggregate_example_tests {

let mut linker = Linker::new(&engine);
// link imports like get_seed to our instantiation
bindgen::Example::add_to_linker(&mut linker, |state: &mut MyCtx| state)?;
bindgen::Agg::add_to_linker(&mut linker, |state: &mut MyCtx| state)?;
// link the WASI imports to our instantiation
wasmtime_wasi::preview2::command::sync::add_to_linker(&mut linker)?;

Expand All @@ -181,7 +167,7 @@ mod aggregate_example_tests {
};
let mut store = Store::new(&engine, state);

let (bindings, _) = bindgen::Example::instantiate(&mut store, &component, &linker)?;
let (bindings, _) = bindgen::Agg::instantiate(&mut store, &component, &linker)?;

// Use bindings
// Call render with initial data, should return all HTML
Expand Down
2 changes: 1 addition & 1 deletion examples/crates/aggregate-wit-ui/wit/world.wit
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ interface wurbo-out {
}

/// An example world for the component to target.
world example {
world agg {
// requests to the DOM via jco
import wurbo-in;

Expand Down

0 comments on commit 692ef31

Please sign in to comment.