Skip to content

Instantly share code, notes, and snippets.

@dunkelhaus
Created November 7, 2018 01:05
Show Gist options
  • Save dunkelhaus/d0bb8fd1dfc248effaa47be0ef4cf08f to your computer and use it in GitHub Desktop.
Save dunkelhaus/d0bb8fd1dfc248effaa47be0ef4cf08f to your computer and use it in GitHub Desktop.
The output when running app-spec-rust with the existing Cargo.toml's [error is 'hdk' is not found]
mkdir: dist: File exists
====================================================================================
BUILDING genome with 'hc package --output dist/app-spec-rust.hcpkg --strip-meta':
------------------------------------------------------------------------------------
> cargo build --target wasm32-unknown-unknown --release
Compiling code v0.0.1 (/Volumes/TeraDrive/Code/app-spec-rust/zomes/blog/code)
error[E0432]: unresolved import `hdk::holochain_wasm_utils::api_serialization::get_entry::GetResultStatus`
--> src/blog.rs:5:26
|
5 | GetEntryOptions, GetResultStatus,
| ^^^^^^^^^^^^^^^ no `GetResultStatus` in `holochain_wasm_utils::api_serialization::get_entry`
error[E0308]: mismatched types
--> src/blog.rs:23:59
|
23 | let maybe_result = hdk::call("summer", "main", "sum", serde_json::to_value(call_input).unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `hdk::holochain_core_types::json::JsonString`, found enum `serde_json::Value`
|
= note: expected type `hdk::holochain_core_types::json::JsonString`
found type `serde_json::Value`
error[E0308]: mismatched types
--> src/blog.rs:25:44
|
25 | Ok(result) => serde_json::from_str(&result).unwrap(),
| ^^^^^^^ expected str, found struct `hdk::holochain_core_types::json::JsonString`
|
= note: expected type `&str`
found type `&hdk::holochain_core_types::json::JsonString`
error[E0599]: no method named `to_json` found for type `hdk::error::ZomeApiError` in the current scope
--> src/blog.rs:26:37
|
26 | Err(hdk_error) => hdk_error.to_json(),
| ^^^^^^^
error[E0061]: this function takes 1 parameter but 2 parameters were supplied
--> src/blog.rs:31:25
|
31 | let maybe_address = hdk::hash_entry("post",json!({"content": content,"date_created": "now"}));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 1 parameter
error[E0599]: no method named `to_json` found for type `hdk::error::ZomeApiError` in the current scope
--> src/blog.rs:36:37
|
36 | Err(hdk_error) => hdk_error.to_json(),
| ^^^^^^^
error[E0599]: no method named `to_json` found for type `hdk::error::ZomeApiError` in the current scope
--> src/blog.rs:42:37
|
42 | Err(hdk_error) => hdk_error.to_json(),
| ^^^^^^^
error[E0609]: no field `status` on type `std::option::Option<hdk::holochain_core_types::entry::SerializedEntry>`
--> src/blog.rs:43:36
|
43 | Ok(result) => match result.status {
| ^^^^^^
error[E0609]: no field `entry` on type `std::option::Option<hdk::holochain_core_types::entry::SerializedEntry>`
--> src/blog.rs:45:74
|
45 | GetResultStatus::Found => match serde_json::from_str(&result.entry) {
| ^^^^^
error[E0061]: this function takes 1 parameter but 2 parameters were supplied
--> src/blog.rs:49:41
|
49 | let maybe_address = hdk::hash_entry("post",post);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 1 parameter
error[E0599]: no method named `to_json` found for type `hdk::error::ZomeApiError` in the current scope
--> src/blog.rs:54:53
|
54 | Err(hdk_error) => hdk_error.to_json(),
| ^^^^^^^
error[E0061]: this function takes 1 parameter but 2 parameters were supplied
--> src/blog.rs:63:11
|
63 | match hdk::commit_entry("post", json!(
| ___________^
64 | | {
65 | | "content": content,
66 | | "date_created": "now"//SystemTime::now()
67 | | //SystemTime::now() panics when executed in wasmi
68 | | }
69 | | )) {
| |______^ expected 1 parameter
error[E0599]: no method named `to_json` found for type `hdk::error::ZomeApiError` in the current scope
--> src/blog.rs:89:37
|
89 | Err(hdk_error) => hdk_error.to_json(),
| ^^^^^^^
error[E0609]: no field `links` on type `std::vec::Vec<hdk::holochain_core_types::hash::HashString>`
--> src/blog.rs:95:52
|
95 | Ok(result) => json!({"post_hashes": result.links}),
| ^^^^^ unknown field
error[E0599]: no method named `to_json` found for type `hdk::error::ZomeApiError` in the current scope
--> src/blog.rs:96:37
|
96 | Err(hdk_error) => hdk_error.to_json(),
| ^^^^^^^
error[E0609]: no field `links` on type `std::vec::Vec<hdk::holochain_core_types::hash::HashString>`
--> src/blog.rs:102:52
|
102 | Ok(result) => json!({"post_hashes": result.links}),
| ^^^^^ unknown field
error[E0599]: no method named `to_json` found for type `hdk::error::ZomeApiError` in the current scope
--> src/blog.rs:103:37
|
103 | Err(hdk_error) => hdk_error.to_json(),
| ^^^^^^^
error[E0599]: no method named `to_json` found for type `hdk::error::ZomeApiError` in the current scope
--> src/blog.rs:115:37
|
115 | Err(hdk_error) => hdk_error.to_json(),
| ^^^^^^^
error[E0308]: mismatched types
--> src/blog.rs:123:54
|
123 | let result : Result<Option<Post>,ZomeApiError> = hdk::get_entry(post_hash);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `post::Post`, found struct `hdk::holochain_core_types::entry::Entry`
|
= note: expected type `std::result::Result<std::option::Option<post::Post>, _>`
found type `std::result::Result<std::option::Option<hdk::holochain_core_types::entry::Entry>, _>`
error[E0308]: mismatched types
--> src/lib.rs:15:1
|
15 | define_zome! {
| _^
| |_|
| ||
16 | || entries: [
17 | || post::definition()
18 | || ]
... ||
74 | || }
75 | || }
| || ^
| ||_|
| |__expected struct `hdk::holochain_core_types::json::JsonString`, found enum `serde_json::Value`
| expected `hdk::holochain_core_types::json::JsonString` because of return type
|
= note: expected type `hdk::holochain_core_types::json::JsonString`
found type `serde_json::Value`
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: aborting due to 20 previous errors
Some errors occurred: E0061, E0308, E0432, E0599, E0609.
For more information about an error, try `rustc --explain E0061`.
error: Could not compile `code`.
To learn more, run the command again with --verbose.
Error: command cargo build --target wasm32-unknown-unknown --release was not successful
DONE.
====================================================================================
BUILDING JS test file with webpack:
------------------------------------------------------------------------------------
npm WARN test No description
npm WARN test No repository field.
npm WARN test No license field.
audited 5720 packages in 7.088s
found 0 vulnerabilities
> @ build /Volumes/TeraDrive/Code/app-spec-rust/test
> webpack
Hash: 6a2dc63e8b4400359f3c
Version: webpack 4.20.2
Time: 1683ms
Built at: 11/06/2018 5:54:06 PM
Asset Size Chunks  Chunk Names
bundle.js 98.2 KiB 0 [emitted] main
Entrypoint main = bundle.js
[7] (webpack)/buildin/global.js 509 bytes {0} [built]
[25] ./test.js 5.02 KiB {0} [built]
[31] util (ignored) 15 bytes {0} [built]
[33] util (ignored) 15 bytes {0} [built]
[63] ./util.inspect (ignored) 15 bytes {0} [built]
+ 59 hidden modules
WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/
DONE.
RUNNING tests with hcshell...
------------------------------------------------------------------------------------
./build_and_test.sh: line 18: hcshell: command not found
not ok 1 no plan found
not ok 2 no assertions found
⨯ fail 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment