Skip to content
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

Fix conversion of Call struct names to UpperCamelCase #441

Merged
merged 2 commits into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async-trait = "0.1.49"
codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full", "bit-vec"] }
darling = "0.13.0"
frame-metadata = "14.0"
heck = "0.3.2"
heck = "0.4.0"
proc-macro2 = "1.0.24"
proc-macro-crate = "0.1.5"
proc-macro-error = "1.0.4"
Expand Down
6 changes: 3 additions & 3 deletions codegen/src/api/calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use frame_metadata::{
PalletMetadata,
};
use heck::{
CamelCase as _,
SnakeCase as _,
ToSnakeCase as _,
ToUpperCamelCase as _,
};
use proc_macro2::TokenStream as TokenStream2;
use proc_macro_error::abort_call_site;
Expand All @@ -43,7 +43,7 @@ pub fn generate_calls(
let struct_defs = super::generate_structs_from_variants(
type_gen,
call.ty.id(),
|name| name.to_camel_case().into(),
|name| name.to_upper_camel_case().into(),
"Call",
);
let (call_structs, call_fns): (Vec<_>, Vec<_>) = struct_defs
Expand Down
2 changes: 1 addition & 1 deletion codegen/src/api/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use crate::types::TypeGenerator;
use frame_metadata::PalletConstantMetadata;
use heck::SnakeCase as _;
use heck::ToSnakeCase as _;
use proc_macro2::TokenStream as TokenStream2;
use quote::{
format_ident,
Expand Down
4 changes: 2 additions & 2 deletions codegen/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use frame_metadata::{
RuntimeMetadataPrefixed,
StorageEntryType,
};
use heck::SnakeCase as _;
use heck::ToSnakeCase as _;
use proc_macro2::TokenStream as TokenStream2;
use proc_macro_error::abort_call_site;
use quote::{
Expand Down Expand Up @@ -462,7 +462,7 @@ where
type_gen,
);
CompositeDef::struct_def(
var.name(),
struct_name.as_ref(),
Default::default(),
fields,
Some(parse_quote!(pub)),
Expand Down
2 changes: 1 addition & 1 deletion codegen/src/api/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use frame_metadata::{
StorageEntryType,
StorageHasher,
};
use heck::SnakeCase as _;
use heck::ToSnakeCase as _;
use proc_macro2::TokenStream as TokenStream2;
use proc_macro_error::abort_call_site;
use quote::{
Expand Down
2 changes: 1 addition & 1 deletion macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async-trait = "0.1.49"
codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full"] }
darling = "0.13.0"
frame-metadata = "14.0"
heck = "0.3.2"
heck = "0.4.0"
proc-macro2 = "1.0.24"
proc-macro-crate = "0.1.5"
proc-macro-error = "1.0.4"
Expand Down