-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Implement function json_metadata
in decl_module!
#654
Conversation
The new function `json_metadata` returns the module declaration as a json string. Progress on: #535
good stuff! |
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.
) => { | ||
impl<$trait_instance: $trait_name> $mod_type<$trait_instance> { | ||
pub fn json_metadata() -> &'static str { | ||
concat!(r#"{ "name": ""#, stringify!($mod_type), r#"", "calls": ["#, |
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.
spaces
$($rest:tt)* | ||
) => { | ||
concat!($prefix_str, " ", | ||
r#"{ "name": ""#, stringify!($call_type), |
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.
spaces
$($rest:tt)* | ||
) => { | ||
concat!($prefix_str, " ", | ||
r#"{ "name": ""#, stringify!($call_type), |
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.
spaces
/// Convert the list of calls into their JSON representation, joined by ",". | ||
#[macro_export] | ||
macro_rules! __calls_to_json { | ||
// WITHOUT AUX |
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.
spaces
impl<$trait_instance: $trait_name> $mod_type<$trait_instance> { | ||
pub fn json_metadata() -> &'static str { | ||
concat!(r#"{ "name": ""#, stringify!($mod_type), r#"", "calls": ["#, | ||
__calls_to_json!(""; $($rest)*), " ] }") |
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.
spaces
* master: (22 commits) Introduce treasury and document (#646) Off-the-table staking preference (#656) Implement function `json_metadata` in `decl_module!` (#654) Fix warnings in networking (#652) Add a reputation system (#645) Check for pruned block state (#648) Contract runtime polishing (#601) WIP on chain heap (#639) Events to track extrinsic success (#640) Install llvm-tools-preview component (#643) fix wasm executor compile error (#631) random fixes (#638) Empty becomes (), reflecting convention (#637) Allow to build_upon skipped entries, but don't walk back (#635) Separate out staking module into balances and payment (#629) Update .gitlab-ci.yml (#633) Do not attempt to rustup if in CI. This is taken care of by the base (#621) Avoid need for ident strings in storage (#624) rename to panic_handler as panic_implementation is deprecated in nightly (#626) 5 random fixes (#2) (#623) ...
…and-rlpcodec * master: Upgrade to libp2p master (#660) Include function comments into modules `json_metadata` (#657) Replace old headers with CHT in light clients (#512) Fix build Introduce treasury and document (#646) Off-the-table staking preference (#656) Implement function `json_metadata` in `decl_module!` (#654) Fix warnings in networking (#652) Add a reputation system (#645) Check for pruned block state (#648)
The new function
json_metadata
returns the module declarationas a json string.
Progress on: #535