CosmWasm / serde-json-wasm

serde_json for Wasm programs (small, deterministic, no floats)
Apache License 2.0
30 stars 15 forks source link

Add support for `ser.str_collect` #51

Closed CyberHoward closed 1 year ago

CyberHoward commented 1 year ago

I am currently working on an on-chain version management issue and wanted to store semver version requirements in my contracts.

Semver uses ser.str_collect for some of its values which is currently not supported (unreachable!()).

ethanfrey commented 1 year ago

Maybe @hashedone can take a look.

Two comments:

  1. We often store semver as a String (eg in cw2) and parse it explicitly in the code, so that should be a decent work-around
  2. Can you link the implementation of str_collect in another library for comparison?
  3. Can you add a test case of your use case (adding semver ad dev-dependency is fine) so we see how this works in practice? Hard to add a feature unless the use-case is included.
ethanfrey commented 1 year ago

Very sorry for the logn delay, this repo was kind of ignored.

hashedone commented 1 year ago

Will take a look, but not today - weekend, or monday at latest.