-
Notifications
You must be signed in to change notification settings - Fork 17
WIP: move from serde_json to serde_json_core #59
base: master
Are you sure you want to change the base?
Conversation
Looks like serde bug: serde-rs/serde#1339 |
There is no need to support json in no-std, because json is generated on compile time only and json serialization/deserialization never makes it to the wasm binary |
@NikVolf having dependency on In my case I want to |
I have reread the |
The argument behind it is following: ".json ABI is an artefact of compilation". That means we should maintain the following requirement: in case of compilation failure neither .json ABI nor Wasm binary should change. |
But it currently makes Just try to create a contract, that serialize the tuple of U256 into byte array and save it to bc. You will face the error. |
I think the ideal solution would be to make a generic build tool, as an extension of cargo tool (will take the same arguments as cargo and some additional), which will yield the .json ABI as well. We could call it |
Sounds promising |
@fckt Is this idea still a thing? If so where should we collect information about it? Maybe a new issue? Could a cargo plugin be helpful here? |
@Robbepop yeah, still actual. I'm thinking to make it as a subcommand like |
efb0994
to
4d47596
Compare
I have created an issue that serde_json clashes in no_std scenarios, but library authors said that they don't support no_std.
See more details here serde-rs/json#463
So I tried to add required functionallity into the package that should be a no_std replacement for serde_json - serde_json_core.
It doesn't work yet (so I added WIP) but it probably would be helpful to have this PR here. I appreciate any help because now I don't quite understand what's wrong with code. All tests passed for
alloc
types, but when you actually use them you encounter several errors in macro invocations.