Add Web Feature to Subxt Codegen (#1175)

* add web feature to subxt codegen

* add getrandom

* remove compile error

* metadata: Generate runtime outer enums if not present in V14 (#1174)

* metadata: Extend outer enum generation for V14

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

* metadata: Generate outer enums if not present

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

* metadata: Porpagate v14 error instead of panic

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

* metadata: Try to find `RuntimeCall` then `Call` enums

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

* metadata: Ensure the returned type is variant for outer enums

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

* metadata: Replace or with or_else

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

* metadata: Apply clippy

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

* metadata: Return error and generate only `RuntimeError`

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

* metadata: Remove modified path

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

* metadata/tests: Check missing runtime types

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

---------

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

* add empty use of getrandom

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
Co-authored-by: James Wilson <james@jsdw.me>
This commit is contained in:
Tadeo Hepperle
2023-09-26 20:02:45 +02:00
committed by GitHub
parent 0956b40412
commit cd5060a5a0
5 changed files with 11 additions and 3 deletions
+2 -2
View File
@@ -53,8 +53,8 @@ mod types;
#[cfg(feature = "fetch-metadata")]
pub mod utils;
#[cfg(all(feature = "web", feature = "fetch-metadata"))]
compile_error!("subxt-codegen: the features 'web' and 'fetch_metadata' cannot be used together.");
#[cfg(feature = "web")]
use getrandom as _;
pub use self::{
api::{GenerateRuntimeApi, RuntimeGenerator},