Commit Graph

53 Commits

Author SHA1 Message Date
Alexandru Vasile 62eb3fa2dd Stabilize V15 metadata (#66)
* Stabilize V15

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Remove re-exports for latest metadata

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-06-29 17:26:13 +03:00
Alexandru Vasile 0254624b4e Release v15.2.0 (#65)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-06-27 18:00:54 +03:00
Alexandru Vasile fc36bec2cb Simplify feature-flag and use common types (#62)
* Add common types between v14 and v15

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Use common types

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Guard common types by feature flags

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Use feature flags on the imports

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Revert "Use feature flags on the imports"

This reverts commit 5988d8a221c4f8bb8b9dd095fc703d1e5e99d7ef.

Revert "Guard common types by feature flags"

This reverts commit f12cdc650765da455bf29f1eca0205662a039267.

Revert "Use common types"

This reverts commit a012d1ce2b0ff83039a8ecd7097d66fa96d62b1a.

Revert "Add common types between v14 and v15"

This reverts commit 718c9d39e9c53c5ba51ed249595f8263b8604605.

* Adjust feature flags

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Use v14 types for v15

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Rename `module_error_ty` to be consisten with `event`/`call`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Mark V15 as unstable

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Adjust feature flags

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-06-27 16:11:07 +03:00
dependabot[bot] d6d22767e3 Bump Swatinem/rust-cache from 2.4.0 to 2.5.0 (#64)
Bumps [Swatinem/rust-cache](https://github.com/Swatinem/rust-cache) from 2.4.0 to 2.5.0.
- [Release notes](https://github.com/Swatinem/rust-cache/releases)
- [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Swatinem/rust-cache/compare/988c164c3d0e93c4dbab36aaf5bbeb77425b2894...2656b87321093db1cb55fbd73183d195214fdfd1)

---
updated-dependencies:
- dependency-name: Swatinem/rust-cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-20 14:20:38 +03:00
Alexandru Vasile d6e6c2bf82 Metadata V15: Enrich extrinsic type info for decoding (#56)
* v15/extrinsic: Add extrinsic type info to decode address, call, sig

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15/extrinsic: Add extra ty

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15/extrinsic: Remove extrinsic ty and add prefix length ty

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15/extrinsic: Remove extrinsic len type

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-06-14 14:06:45 +03:00
Alexandru Vasile 4912047c47 V15: Add custom values to the metadata (#61)
* V15: Add custom values to the metadata

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update frame-metadata/src/v15.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
2023-06-14 14:05:17 +03:00
Alexandru Vasile 426ba93c56 v15: Rename error_enum_ty to module_error_enum_ty (#60)
* v15: Rename `error_enum_ty` to `module_error_enum_ty`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15: Rename RuntimeMetadataV15 params

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update frame-metadata/src/v15.rs

Co-authored-by: James Wilson <james@jsdw.me>

* Update frame-metadata/src/v15.rs

Co-authored-by: James Wilson <james@jsdw.me>

* Apply fmt

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: James Wilson <james@jsdw.me>
2023-06-13 14:05:27 +03:00
Alexandru Vasile 0c6400964f v15/metadata: Add outer enum types for calls, events, errors (#57)
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-05-23 13:35:55 +01:00
dependabot[bot] 6fa8de96a1 Bump Swatinem/rust-cache from 2.2.1 to 2.4.0 (#59)
Bumps [Swatinem/rust-cache](https://github.com/Swatinem/rust-cache) from 2.2.1 to 2.4.0.
- [Release notes](https://github.com/Swatinem/rust-cache/releases)
- [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Swatinem/rust-cache/compare/6fd3edff6979b79f87531400ad694fb7f2c84b1f...988c164c3d0e93c4dbab36aaf5bbeb77425b2894)

---
updated-dependencies:
- dependency-name: Swatinem/rust-cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:04:23 +01:00
Alexandru Vasile 438a5b098b Release 15.1.0 (#54)
* Bump version to v15.1.0

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update changelog

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-03-30 16:49:57 +03:00
Alexandru Vasile a09bd49175 Add metadata V15 with Runtime API support (#48)
* v15: Add everything from v14

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15: Add feature to make the V15 the default version

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15: Add trait metadata

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15: Add method metadata

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15: Add param metadata

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15: Constructor for the metadata

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v14: Keep backwards compatibility with v14 re-exports

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15: Add trait and method documentation

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15: Make trait version optional

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15: Do not reexport v14 types

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15: Expose metadata as unstable

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15: Exclude trait versioning from metadata

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15: Add pallet documentation

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15: Rename runtime API structs

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* v15: Rename `ParamMetadata` to RuntimeApiMethodParamMetadata

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update frame-metadata/src/v15.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* v15: Reanme `runtime` -> `apis` and use global META_RESERVED

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* lib: Force CI by better docs

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Copyright: Align copyright with substrate

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
2023-03-30 15:32:53 +03:00
dependabot[bot] 040a53c63a Bump baptiste0928/cargo-install from 1 to 2 (#53)
Bumps [baptiste0928/cargo-install](https://github.com/baptiste0928/cargo-install) from 1 to 2.
- [Release notes](https://github.com/baptiste0928/cargo-install/releases)
- [Changelog](https://github.com/baptiste0928/cargo-install/blob/main/CHANGELOG.md)
- [Commits](https://github.com/baptiste0928/cargo-install/compare/v1...v2)

---
updated-dependencies:
- dependency-name: baptiste0928/cargo-install
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-24 12:35:55 +02:00
dependabot[bot] 02a063bc5e Bump Swatinem/rust-cache from 2.2.0 to 2.2.1 (#51)
Bumps [Swatinem/rust-cache](https://github.com/Swatinem/rust-cache) from 2.2.0 to 2.2.1.
- [Release notes](https://github.com/Swatinem/rust-cache/releases)
- [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Swatinem/rust-cache/compare/359a70e43a0bb8a13953b04a90f76428b4959bb6...6fd3edff6979b79f87531400ad694fb7f2c84b1f)

---
updated-dependencies:
- dependency-name: Swatinem/rust-cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-27 15:52:16 +02:00
Alexandru Vasile f84ba3ff49 chore: Enable rust tests in CI (#50)
* git: Run job from the `main` branch instead of `master`

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* git: Expose terminal colors for CI

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* git: Fix CI and add extra checks

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Fix clippy

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* git: Add missing `cargo hack` command

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* git: Use actions-rs/target for wasm

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
2023-02-21 14:01:46 +02:00
Squirrel 1ea3299208 add no_std support (#42)
* Metadata supporting scale-info can be decoded and serialized in no_std (#2)

* Metadata supporting scale-info can be decoded and serialized in no_std (feature flag scale_info)

* Changes from review: rename feature flag into full_derive

* Changes from review: std implies full-derive

* Changes from review: optimization

Co-authored-by: echevrier <edith.chevrier@scs.ch>

* split full_derive into decode and sered_codec features.

(drop new Debug impls)

* cargo fmt

* rename serde_codec to serde_full

* Prior to v14 everything was Debug.

Are there any downsides? Unused debug impls will just get optimised away won't they?

* rust fmt

* Debug for the masses. Make it work for no_std

* check all combos of features

(if this plays well with ci then we should double up,
doing the same again but target wasm32)

* all wasm feature combos

Co-authored-by: echevrier <84318241+echevrier@users.noreply.github.com>
Co-authored-by: echevrier <edith.chevrier@scs.ch>
2022-11-09 14:32:34 +00:00
dependabot[bot] d41046b12c Bump styfle/cancel-workflow-action from 0.10.0 to 0.11.0 (#45)
* Bump styfle/cancel-workflow-action from 0.10.0 to 0.11.0

Bumps [styfle/cancel-workflow-action](https://github.com/styfle/cancel-workflow-action) from 0.10.0 to 0.11.0.
- [Release notes](https://github.com/styfle/cancel-workflow-action/releases)
- [Commits](https://github.com/styfle/cancel-workflow-action/compare/bb6001c4ea612bf59c3abfc4756fbceee4f870c7...b173b6ec0100793626c2d9e6b90435061f4fc3e5)

---
updated-dependencies:
- dependency-name: styfle/cancel-workflow-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* match hash with version

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sergejs Kostjucenko <sergejs@parity.io>
2022-10-24 22:41:17 +02:00
Sergejs Kostjucenko b6683742f0 pin gha versions and add dependabot (#41) 2022-08-26 10:01:55 +03:00
David d241ab9c1b Release v15.0.0 (#36)
* Release v14.3.0

* Add a release checklist

* Edition 2021

* Update CHANGELOG

* Update CHANGELOG.md

Co-authored-by: Andronik <write@reusable.software>

* It's a breaking change: 15.0.0

Co-authored-by: Andronik <write@reusable.software>
2022-02-08 18:21:15 +00:00
David cdb863d11b Update scale-info –> v2 and parity-scale-codec -> v3 (#35)
* Update `scale-info` –> v2 and `parity-scale-codec` -> v3

* Update frame-metadata/Cargo.toml

Co-authored-by: Andronik <write@reusable.software>

Co-authored-by: Andronik <write@reusable.software>
2022-02-08 16:57:59 +00:00
David f0c7151a95 Document all v14, v13 and most of v8 items (#33)
* Document all v14, v13 and most of v8 items

* Clarify what a `StorageEntryModifier` is.
2021-12-13 09:00:21 +00:00
James Wilson 03b8afacfb V14.2 (#31) 2021-11-04 16:25:55 +00:00
James Wilson f814ecb66a Function to return version from metadata (#30) 2021-11-04 15:46:57 +00:00
Andrew Plaza 5a822bb459 V14.1 (#29)
* v14.1

* changelog
2021-11-04 09:34:19 -04:00
Andrew Plaza b5aceed422 Add metadata versions v8-v11 (#28)
* add v11 metadata

* add v10 metadata

* add v8/v9 metadata

* add version and legacy features

* add debug impl for legacy metadata

* any for features in RuntimeMetadata enum

* revert codec version change

* spaces

* add v8-v13 test metadata

* remove runtime version from meta bin name

* move test_data outside of src/

* add tests for v9-v14 metadata

* remove println

* Update frame-metadata/src/lib.rs

Co-authored-by: David <dvdplm@gmail.com>

* add docs per meta version upto 13

* cargo fmt

Co-authored-by: David <dvdplm@gmail.com>
2021-10-21 15:41:43 +02:00
Andrew Jones 39fe3d8f27 Update to scale-info 1.0, release 14.0.0 2021-09-01 17:00:18 +01:00
Andrew Jones d2cdeaeef5 Update to scale-info 1.0, release 14.0.0 2021-09-01 16:53:18 +01:00
Andrew Jones 717f6341c1 Add Runtime type to metadata 2021-08-31 16:55:11 +01:00
Andrew Jones 732682ed46 scale-info v0.12.0 2021-08-25 11:47:39 +01:00
Andrew Jones 12123891f2 scale-info v0.11.0 2021-08-25 10:58:15 +01:00
Andrew Jones 2c6499d975 Combine Map/NMap/DoubleMap StorageEntryTypes (#23)
* Combine Map and NMap StorageEntryTypes

* Fmt

* Remove DoubleMap

* Add comments to StorageEntryType::Map

* Release 14.0.0-rc.2
2021-08-04 11:01:02 +01:00
Andrew Jones 77e45e399d Release v14.0.0-rc.1 (#22)
* Add CHANGELOG.

* Update README.

* Make it a pre-release rc

* Update Cargo.toml
2021-07-30 16:10:44 +01:00
Andrew Jones e5c1540cf1 Update to scale-info 0.10.0 2021-07-29 10:57:42 +01:00
Andrew Jones 7bb2935f9c Remove Call metadata redundancy (#20)
* Remove Call metadata redundancy

* Add convenient From impls for Call, Event and Error types

* Add convenient From impls for Call, Event and Error types
2021-07-14 17:13:21 +01:00
Andrew Jones 9cfeeeeab8 Abbreviate field names (docs, args) for consistency 2021-07-13 11:22:36 +01:00
Andrew Jones aa74d7a644 Add additional_signed field for SignedExtension payload data (#19)
* Add `SignedExtensionMetadata::additional_signed` field for signed payload data

* Fmt
2021-07-13 11:18:00 +01:00
Andrew Jones 8c37923bdf Remove unused StorageEntryType::Map flag 2021-07-12 09:53:59 +01:00
Andrew Jones 7bd13ff505 Remove ByteGetter and add Clone impl (#17) 2021-07-07 13:24:09 +01:00
Andrew Jones abb215da01 Remove unused TypeSpec (#16) 2021-07-07 13:05:59 +01:00
Andrew Jones 32584873b4 Update scale-info to 0.9.0 2021-06-30 11:35:12 +01:00
Andrew Jones e817237893 Update scale-info to 0.7.0 2021-06-29 17:36:02 +01:00
Andrew Jones 78d3456e4f Reexport all the types from the latest version (#13)
* Reexport all the types from the latest version

* Update comment
2021-06-08 17:42:27 +01:00
Andrew Jones 385bbbd82a Copy v13 metadata from substrate, move new scale-info version to v14 (#12)
* Copy v13 metadata from substrate, move new scale-info version to v14

* Fmt

* Remove common lib types

* Extract decode different types

* Update CI to check v14

* Add Storage NMap to v14

* Bump version

* NMap keys is a Type

* Fix NMap IntoPortable

* Update frame-metadata/src/v13.rs

Co-authored-by: David <dvdplm@gmail.com>

* Remove All the metadata comments

* More clean up of v12 and v13

* review: fix comment

* Fix v13 Debug derives

Co-authored-by: David <dvdplm@gmail.com>
2021-05-18 10:33:59 +01:00
Andrew Jones f4b1727ec9 Refactor v13 metadata types (#11)
* Encapsulate call and event metadata types, remove OuterEventMetadata

* Rename some types, use pallet instead of module

* Remove some serde bounds

* Fmt

* Rename ErrorMetadata to PalletErrorMetadata

* Rename errors field to error and make optional

* Fix error

* Rename StorageMetadata with Pallet prefix for consistency, fix comment.
2021-05-10 12:00:19 +01:00
Andrew Jones a404c8f405 Remove FunctionArgumentMetadata::is_compact flag (#10) 2021-04-28 09:52:59 +01:00
Andrew Jones 7922e2351d Change v13 constants from an Option a plain Vec (#9)
It was a mistakenly translated from v12 as an Option
2021-04-28 09:52:07 +01:00
Andrew Jones 86bf2b374c Change StorageEntryType keys/values to types instead of strings (#8)
* Change StorageEntryType keys/values to types instead of strings

* Change storage to a single object not a Vec

* Fix IntoPortable impl
2021-04-13 09:56:34 +01:00
Andrew Jones be8092d7bf Update to latest scale-info & codec, remove string parameterization (#7)
* Update to latest scale-info & codec, remove string parameterization

* Remove redundant bound

* Remove more redundant S bounds

* Use substrate branch

* Use latest scale-info release
2021-02-11 09:38:06 +00:00
Andrew Jones 1aaf5ba7fa Extract duplicated RuntimeMetadataPrefixed struct to crate level (#5) 2021-01-18 11:09:58 +00:00
Andrew Jones aa716b2bd6 Complete v13 type definitions, support metadata decoding and serde (#4)
* Add String type param for Decode impl, fix serde serialization

* Remove Deserialize derives and fix FormString impl for no_std

* Add SignedExtensionMetadata type, name is possibly be different than type name

* Add Extrinsic type

* Fix SignedExtenstionMetadata compilation issues

* Fmt

* Use PhantomData for V0 to fix no features check

* Restore ModuleMetadata index field

* Add module constants metadata

* Fmt
2021-01-15 09:26:17 +00:00
Andrew Jones 1ac42f8153 Integrate scale-info for type generation (#2)
* scale-info infused metadata

* Include type registry in metadata

* Fix errors and fmt

* Fix errors

* Add scale-info std

* Use FormString trait

* Make TypeSpec fields public

* WIP v13

* Split v12 and v13 features

* Fmt

* Add v13 CI check

* Fix v12 errors

* Define RuntimeMetadata only once

* Add Extrinsic metadata

* Add errors to module metadata

* Add StorageMetadata to v13

* Allow both v12 and v13, add check
2021-01-06 14:06:14 +01:00