Comments (7)
i found that chrono::prelude::Utc::now() also causes a runtime error. (hc 0.2.3-rc.1)
Yeah we can't get chrono timestamps in the wasm guest (need to ask the host for timestamp) -- that's also why Timestamp::now() panics (it's just calling Utc::now() under the hood). We have a function sys_time() for use within the wasm guest.
I think the only issue here is that Timestamp::now() either shouldn't be exposed via the hdk, or should have a feature flag to switch its implementation to use sys_time() when compiled for wasm targets
from holochain.
I see, then yeah it seems like there is just something funky with the feature flags being passed into kitsune_p2p_timestamp when running holochain feature test_utils (although that shouldn't affect the flags on the hdk used within the dna, right?)
Also the docs for Timestamp::now()
reference a different implementation in holochain_types
that doesn't actually exist.
from holochain.
It looks like the feature full
from kitsune_p2p_timestamp
needs to get bubbled up to the holochain crate and set as part of it's own test_utils
feature.
Edit: maybe not, I think I'm confused -- is there supposed to be a Timestamp::now()
implementation that works in wasm? Or are we supposed to use sys_time()
-- if thats the case maybe it just needs to be removed from hdk / hdi
from holochain.
Hi @mattyg, yeah, I've noticed this doesn't work too. Thanks for the reproduction, it's reproducible.
According to the Timestamp
docs it's not supposed to work in WASMs https://github.com/holochain/holochain/blob/develop/crates/kitsune_p2p/timestamp/src/lib.rs#L46-L47
The docs contradict the fact there is a Timestamp::now()
, so needs updating too.
I don't know what's the recommended way here, but you can use sys_time as well as chrono::prelude::Utc::now().timestamp()
.
from holochain.
i found that chrono::prelude::Utc::now() also causes a runtime error. (hc 0.2.3-rc.1)
from holochain.
I've got a fix for this. It is feature indeed an unhelpful combination of features through dependency crates. I found a reasonably nice solution in holochain_zome_types
that resolves the issue, with a few other tidy-ups.
I even managed to make a test which ensures this stays unavailable which I think is pretty cool, because I get excited by testing tools / libraries that do that kind of thing :D
from holochain.
Back-ported in #3121
from holochain.
Related Issues (20)
- The release automation produces TOML which is not correctly formatted
- A bad return value from a callback crashes the conductor HOT 2
- [Release automation] Fix toml formatting HOT 1
- Release automation dep `crate-util` requires newer Rust version 1.76
- Simplification of the release process HOT 1
- Review of Key Manager Browser Extension
- Review of Launcher with Key Management
- (Must have) Run the HoloFuel sweettest test
- Atomic Holonix updates HOT 1
- (Must have) Manual testing, using a happ that we know is reasonably reliable
- (Must have) Leave a conductor running for a longer period of time
- (Nice to have) Automated (or at least semi) testing, maybe with HoloFuel?
- (Medium) Wind Tunnel simple baseline
- [BUG] Unable to open Database file on Windows 10
- Holochain dependency, dependencies updates
- [Workflow] Remove integration workflow
- [Integrity] Write helper to collectively return missing dependencies from must_get calls
- [ENHANCEMENT] Move cached wasms to dedicated folder
- [BUG] when a node with "empty" gossip arc clamping creates a link and then tries to delete it, it gets a validation failure HOT 2
- Deferred memproof provisioning
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from holochain.