-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest contract metadata #2118
Latest contract metadata #2118
Conversation
@jacogr you'll need to merge master into your branch to avoid the big diff. Let me know if you have any feedback on the new format, since I am working towards getting the upstream PRs merged. |
@ascjones Master merged in. Sorry, I completely forgot :( |
It looks fine to merge into mine. I would love a larger ABI test case though (only 7 types here, but can wait for that, should not stop this). Some additional type naming cleanups can be done (once again, not for here), e.g. removing the indexes, which are certainly not useful anymore. |
Have removed the indices. I'd like to test it with the UI if possible - can you point me to where it hooks in? |
For the UI test, there is the copy script does assume the api and apps are on the same level, i.e. That script gets used a lot... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, going to merge as-is, it is certainly 20x better than the WIP there is atm.
Thanks an absolute million.
* Updated ABI definitions & parsing * Run type generation * Definitions (should be ok-ish) * Cleanup names * Allow aliasses on structs (JSON parsing) * Cleanup json mapping passing * s/types/lookup/ * Parsing as per current output * InkSelector * MtRegistryIndex * String lookup tests * Remove serd ovverride comments (it works as-is) * inkRegistry tests * Extract primitive types * s/ty/id/ * Start of parsing into types (actually to be TypeDef) * Parsing * stringify struct fields * Small cleanups * Add type index to project lookup * Prefix with index * Fix interface generation * Latest contract metadata (#2118) * Add new (provisional) incrementer contract metadata * Update and regenerate type definitions * WIP: generate new format scale-info types * WIP: implementing variants * Implement variants * Fix up type resolution * Fix registry spec tests * Fix lints and some tests * Fix inkTypes tests * Fix some lints * Make imports same line like original * Comment out (temporarily) sanitize import to make CI pass * Sanitize * Remove indices * Remove index * api-contract rewrite * lint * cleanup * latest * latest * fix definition * fiz definitions * rv ink storage * Update packages/api-contract/src/base/Contract.ts Co-authored-by: Jaco Greeff <jacogr@gmail.com> * fixes * rv scripts * restore api-contract * reorder definitions, fix ink storage * fixes Co-authored-by: Jaco Greeff <jacogr@gmail.com> Co-authored-by: Andrew Jones <ascjones@gmail.com>
* Updated ABI definitions & parsing * Run type generation * Definitions (should be ok-ish) * Cleanup names * Allow aliasses on structs (JSON parsing) * Cleanup json mapping passing * s/types/lookup/ * Parsing as per current output * InkSelector * MtRegistryIndex * String lookup tests * Remove serd ovverride comments (it works as-is) * inkRegistry tests * Extract primitive types * s/ty/id/ * Start of parsing into types (actually to be TypeDef) * Parsing * stringify struct fields * Small cleanups * Add type index to project lookup * Prefix with index * Fix interface generation * Latest contract metadata (#2118) * Add new (provisional) incrementer contract metadata * Update and regenerate type definitions * WIP: generate new format scale-info types * WIP: implementing variants * Implement variants * Fix up type resolution * Fix registry spec tests * Fix lints and some tests * Fix inkTypes tests * Fix some lints * Make imports same line like original * Comment out (temporarily) sanitize import to make CI pass * Sanitize * Remove indices * Remove index * api-contract rewrite * lint * cleanup * latest * latest * fix definition * fiz definitions * rv ink storage * Update packages/api-contract/src/base/Contract.ts Co-authored-by: Jaco Greeff <jacogr@gmail.com> * fixes * rv scripts * restore api-contract * reorder definitions, fix ink storage * fixes * def order * fixes Co-authored-by: Jaco Greeff <jacogr@gmail.com> Co-authored-by: Andrew Jones <ascjones@gmail.com>
* Updated ABI definitions & parsing * Run type generation * Definitions (should be ok-ish) * Cleanup names * Allow aliasses on structs (JSON parsing) * Cleanup json mapping passing * s/types/lookup/ * Parsing as per current output * InkSelector * MtRegistryIndex * String lookup tests * Remove serd ovverride comments (it works as-is) * inkRegistry tests * Extract primitive types * s/ty/id/ * Start of parsing into types (actually to be TypeDef) * Parsing * stringify struct fields * Small cleanups * Add type index to project lookup * Prefix with index * Fix interface generation * Latest contract metadata (#2118) * Add new (provisional) incrementer contract metadata * Update and regenerate type definitions * WIP: generate new format scale-info types * WIP: implementing variants * Implement variants * Fix up type resolution * Fix registry spec tests * Fix lints and some tests * Fix inkTypes tests * Fix some lints * Make imports same line like original * Comment out (temporarily) sanitize import to make CI pass * Sanitize * Remove indices * Remove index * Adjust ContractAbi interface (empty rpc) * linting * Pull in Andrew's changes * Cleanups * Some more cleanups * Update with v3 contracts * Adjust with actual types * Regenerate * Update ABI parsing (#2695) * Adjust ABI code * Cleanup * Merge non-code * Type naming * Simplify Base * Rename 1 * rename 2 * Rename 3 * Simplify * Add index to AbiMessage * Pass actual message or index for call * Rename param * Simplify * Expose call & exec * s/call/read/ * Cleanup asserts * AccountId as per spec * displayName is path * Update definitions * Flatten ABIType into TypeDef * Rewrite * Fix tests * Updates Co-authored-by: Andrew Jones <ascjones@gmail.com>
* Updated ABI definitions & parsing * Run type generation * Definitions (should be ok-ish) * Cleanup names * Allow aliasses on structs (JSON parsing) * Cleanup json mapping passing * s/types/lookup/ * Parsing as per current output * InkSelector * MtRegistryIndex * String lookup tests * Remove serd ovverride comments (it works as-is) * inkRegistry tests * Extract primitive types * s/ty/id/ * Start of parsing into types (actually to be TypeDef) * Parsing * stringify struct fields * Small cleanups * Add type index to project lookup * Prefix with index * Fix interface generation * Latest contract metadata (#2118) * Add new (provisional) incrementer contract metadata * Update and regenerate type definitions * WIP: generate new format scale-info types * WIP: implementing variants * Implement variants * Fix up type resolution * Fix registry spec tests * Fix lints and some tests * Fix inkTypes tests * Fix some lints * Make imports same line like original * Comment out (temporarily) sanitize import to make CI pass * Sanitize * Remove indices * Remove index * api-contract rewrite * lint * cleanup * latest * latest * fix definition * fiz definitions * rv ink storage * Update packages/api-contract/src/base/Contract.ts Co-authored-by: Jaco Greeff <jacogr@gmail.com> * fixes * rv scripts * restore api-contract * reorder definitions, fix ink storage * fixes * def order * fixes * encodeTypeDef asRaw * update ink typ spec * latest built contracts * compare files * Apply suggestions from code review Co-authored-by: Jaco Greeff <jacogr@gmail.com> Co-authored-by: Andrew Jones <ascjones@gmail.com>
* Updated ABI definitions & parsing * Run type generation * Definitions (should be ok-ish) * Cleanup names * Allow aliasses on structs (JSON parsing) * Cleanup json mapping passing * s/types/lookup/ * Parsing as per current output * InkSelector * MtRegistryIndex * String lookup tests * Remove serd ovverride comments (it works as-is) * inkRegistry tests * Extract primitive types * s/ty/id/ * Start of parsing into types (actually to be TypeDef) * Parsing * stringify struct fields * Small cleanups * Add type index to project lookup * Prefix with index * Fix interface generation * Latest contract metadata (polkadot-js#2118) * Add new (provisional) incrementer contract metadata * Update and regenerate type definitions * WIP: generate new format scale-info types * WIP: implementing variants * Implement variants * Fix up type resolution * Fix registry spec tests * Fix lints and some tests * Fix inkTypes tests * Fix some lints * Make imports same line like original * Comment out (temporarily) sanitize import to make CI pass * Sanitize * Remove indices * Remove index * api-contract rewrite * lint * cleanup * latest * latest * fix definition * fiz definitions * rv ink storage * Update packages/api-contract/src/base/Contract.ts Co-authored-by: Jaco Greeff <jacogr@gmail.com> * fixes * rv scripts * restore api-contract * reorder definitions, fix ink storage * fixes Co-authored-by: Jaco Greeff <jacogr@gmail.com> Co-authored-by: Andrew Jones <ascjones@gmail.com>
* Updated ABI definitions & parsing * Run type generation * Definitions (should be ok-ish) * Cleanup names * Allow aliasses on structs (JSON parsing) * Cleanup json mapping passing * s/types/lookup/ * Parsing as per current output * InkSelector * MtRegistryIndex * String lookup tests * Remove serd ovverride comments (it works as-is) * inkRegistry tests * Extract primitive types * s/ty/id/ * Start of parsing into types (actually to be TypeDef) * Parsing * stringify struct fields * Small cleanups * Add type index to project lookup * Prefix with index * Fix interface generation * Latest contract metadata (polkadot-js#2118) * Add new (provisional) incrementer contract metadata * Update and regenerate type definitions * WIP: generate new format scale-info types * WIP: implementing variants * Implement variants * Fix up type resolution * Fix registry spec tests * Fix lints and some tests * Fix inkTypes tests * Fix some lints * Make imports same line like original * Comment out (temporarily) sanitize import to make CI pass * Sanitize * Remove indices * Remove index * api-contract rewrite * lint * cleanup * latest * latest * fix definition * fiz definitions * rv ink storage * Update packages/api-contract/src/base/Contract.ts Co-authored-by: Jaco Greeff <jacogr@gmail.com> * fixes * rv scripts * restore api-contract * reorder definitions, fix ink storage * fixes * def order * fixes Co-authored-by: Jaco Greeff <jacogr@gmail.com> Co-authored-by: Andrew Jones <ascjones@gmail.com>
* Updated ABI definitions & parsing * Run type generation * Definitions (should be ok-ish) * Cleanup names * Allow aliasses on structs (JSON parsing) * Cleanup json mapping passing * s/types/lookup/ * Parsing as per current output * InkSelector * MtRegistryIndex * String lookup tests * Remove serd ovverride comments (it works as-is) * inkRegistry tests * Extract primitive types * s/ty/id/ * Start of parsing into types (actually to be TypeDef) * Parsing * stringify struct fields * Small cleanups * Add type index to project lookup * Prefix with index * Fix interface generation * Latest contract metadata (polkadot-js#2118) * Add new (provisional) incrementer contract metadata * Update and regenerate type definitions * WIP: generate new format scale-info types * WIP: implementing variants * Implement variants * Fix up type resolution * Fix registry spec tests * Fix lints and some tests * Fix inkTypes tests * Fix some lints * Make imports same line like original * Comment out (temporarily) sanitize import to make CI pass * Sanitize * Remove indices * Remove index * Adjust ContractAbi interface (empty rpc) * linting * Pull in Andrew's changes * Cleanups * Some more cleanups * Update with v3 contracts * Adjust with actual types * Regenerate * Update ABI parsing (polkadot-js#2695) * Adjust ABI code * Cleanup * Merge non-code * Type naming * Simplify Base * Rename 1 * rename 2 * Rename 3 * Simplify * Add index to AbiMessage * Pass actual message or index for call * Rename param * Simplify * Expose call & exec * s/call/read/ * Cleanup asserts * AccountId as per spec * displayName is path * Update definitions * Flatten ABIType into TypeDef * Rewrite * Fix tests * Updates Co-authored-by: Andrew Jones <ascjones@gmail.com>
* Updated ABI definitions & parsing * Run type generation * Definitions (should be ok-ish) * Cleanup names * Allow aliasses on structs (JSON parsing) * Cleanup json mapping passing * s/types/lookup/ * Parsing as per current output * InkSelector * MtRegistryIndex * String lookup tests * Remove serd ovverride comments (it works as-is) * inkRegistry tests * Extract primitive types * s/ty/id/ * Start of parsing into types (actually to be TypeDef) * Parsing * stringify struct fields * Small cleanups * Add type index to project lookup * Prefix with index * Fix interface generation * Latest contract metadata (polkadot-js#2118) * Add new (provisional) incrementer contract metadata * Update and regenerate type definitions * WIP: generate new format scale-info types * WIP: implementing variants * Implement variants * Fix up type resolution * Fix registry spec tests * Fix lints and some tests * Fix inkTypes tests * Fix some lints * Make imports same line like original * Comment out (temporarily) sanitize import to make CI pass * Sanitize * Remove indices * Remove index * api-contract rewrite * lint * cleanup * latest * latest * fix definition * fiz definitions * rv ink storage * Update packages/api-contract/src/base/Contract.ts Co-authored-by: Jaco Greeff <jacogr@gmail.com> * fixes * rv scripts * restore api-contract * reorder definitions, fix ink storage * fixes * def order * fixes * encodeTypeDef asRaw * update ink typ spec * latest built contracts * compare files * Apply suggestions from code review Co-authored-by: Jaco Greeff <jacogr@gmail.com> Co-authored-by: Andrew Jones <ascjones@gmail.com>
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This PR is to demonstrate the new metadata format introduced via use-ink/ink#296 which incorporates paritytech/scale-info#3 (the parity fork of
type-metadata
). The main change is mergingtype id
andtype def
.This is a WIP and the main purpose is to test how easy it is to parse the updated format and gain some feedback before merging upstream, so any feedback appreciated.
Vec<u8>
->Bytes