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

add globals to app_spec #796

Merged
merged 23 commits into from
Jan 23, 2019
Merged

add globals to app_spec #796

merged 23 commits into from
Jan 23, 2019

Conversation

zippy
Copy link
Member

@zippy zippy commented Dec 22, 2018

we have: We can access the app dna hash in the zome

and also

runtime globals are actually correct values (See invoke_init_globals) in the SoA.
as if they aren't implemented.

It actually looks to me like they are, at least partially, working. As these app_spec tests seem to show.

Feedback?

@zippy zippy added the review label Dec 22, 2018
@zippy
Copy link
Member Author

zippy commented Dec 22, 2018

well, something in the build on circle CI causes it to come out with a different dna hash, then on my machine...

@zippy
Copy link
Member Author

zippy commented Jan 8, 2019

hmmm dna address still coming back different that what happens when I run on my machine. I'm using the nix-shell command nix-shell --run hc-test-app-spec so I really don't know what's different from what's happening on circleci when the wasm gets compiled. @thedavidmeister @lucksus any ideas?

@lucksus
Copy link
Collaborator

lucksus commented Jan 15, 2019

@zippy, I'm not sure but I guess any discrepancy in the toolchain will result in a different binary output. Maybe the hash should not be hardcoded in the test but rather taken from the DNA file under test?

core_types/src/dna/dna.rs Outdated Show resolved Hide resolved
@@ -76,7 +74,8 @@ pub mod tests {

assert_eq!(globals.dna_name, "TestApp");
// TODO #233 - Implement agent address
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// TODO #233 - Implement agent address

};

let dna = maybe_dna.or_else(|e: String| {
let error_string = cx.string(format!("unable to call zome function: {:?}", &e));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unable to call zome function?

Copy link
Collaborator

@Connoropolous Connoropolous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just make sure that #233 ticket gets closed too. Awesome to have this in!

@lucksus lucksus merged commit d0cabe5 into develop Jan 23, 2019
@lucksus lucksus deleted the globals-in-appspec branch January 26, 2019 19:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants