Concordium / concordium-rosetta

A server implementing the Rosetta API for the Concordium blockchain.
Mozilla Public License 2.0
5 stars 1 forks source link

Generate Allow type with correct field types #9

Closed bisgardo closed 2 years ago

bisgardo commented 2 years ago

Purpose

Make fields of generated struct use the correct types.

Changes

Picked changes to generated Allow type from version generated by a more recent version of the rosetta spec.

It seems like there's some bug in the generator that makes it generate fields of type plain serde_json::Value instead of the proper types in the Allow struct. Picking the changes to Allow's model from commit https://github.com/coinbase/rosetta-specifications/commit/ce6898659de0f79c350034db6ac938e12805302f#diff-80521b2ac2125e10a84393ae746d6f0d993979c8a974dc320b913f8bb2fd32b5 makes it generate it correctly. Before the model change, all non-builtin types were used as a parameter to Vec, so that could be what's triggering the bug.

This also means that this change won't be reverted by a future upgrade of the Rosetta spec.