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

Add Support for Tuples (aka Structs) in the ABI Contract Schema #2064

Merged
merged 2 commits into from
May 30, 2019

Conversation

mikeseese
Copy link
Contributor

@mikeseese mikeseese commented May 30, 2019

This PR upgrades ajv to v6 which implements draft07 of the JSON Schema. It also adds support for tuples (which is how struct Solidity types are represented) as a parameter type.

You'll see https://github.com/trufflesuite/truffle/pull/2064/files#diff-da060bd5170ce9e90e14ece903806d3eR135 says that the components property has an array of object types. This is supposed to be "items": { "$ref": "#/definitions/Parameter" }, but the https://github.com/bcherny/json-schema-to-typescript dependency we use to generate typings fails due to the recursion (gets a Maximum call stack size exceeded error when building), despite the schema supports this recursion.

The dependency has known about this issue for 2 years now (bcherny/json-schema-to-typescript#76 which depends on another dependency issue APIDevTools/json-schema-ref-parser#37), but a fix has yet to come.

#2065 tracks this issue

@mikeseese mikeseese requested a review from gnidan May 30, 2019 21:06
@coveralls
Copy link

Coverage Status

Coverage remained the same at 69.79% when pulling c209b53 on bug/contract-schema-tuples into cadba21 on develop.

Copy link
Contributor

@gnidan gnidan left a comment

Choose a reason for hiding this comment

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

This is great! Thanks for reporting those findings 💯

@gnidan gnidan merged commit 155a076 into develop May 30, 2019
@gnidan gnidan deleted the bug/contract-schema-tuples branch May 30, 2019 22:19
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.

None yet

3 participants