Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
sr-support: fix the unit test
  • Loading branch information
Guanqun Lu committed Sep 16, 2018
commit 32dd71e50dab38d14d019a363f07850a0bdcb5ae
20 changes: 15 additions & 5 deletions srml/support/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ macro_rules! __functions_to_json {
concat!($prefix_str, " ",
__function_to_json!(
fn $fn_name(
$who: $origin_type // TODO: fix this.
$who: T::AccountId // TODO: fix this.
$( , $param_name : $param )*
) -> $result;
$fn_doc;
Expand Down Expand Up @@ -760,7 +760,17 @@ mod tests {

r#""0 + 1 + 1 + 1 + 1": { "name": "aux_4", "params": [ "#,
r#"{ "name": "data", "type": "i32" }"#,
r#" ], "description": [ ] }, "#,

r#""0 + 1 + 1 + 1 + 1 + 1": { "name": "aux_5", "params": [ "#,
r#"{ "name": "who", "type": "T::AccountId" }"#,
r#" ], "description": [ ] }, "#,

r#""0 + 1 + 1 + 1 + 1 + 1 + 1": { "name": "aux_6", "params": [ "#,
r#"{ "name": "who", "type": "T::AccountId" }, "#,
r#"{ "name": "data", "type": "i32" }"#,
r#" ], "description": [ ] }"#,

r#" } }"#,
r#" }"#,
);
Expand Down Expand Up @@ -804,9 +814,9 @@ mod tests {

#[test]
fn module_json_metadata() {
// let metadata = Module::<TraitImpl>::json_metadata();
// assert_eq!(EXPECTED_METADATA, metadata);
// let _: serde::de::IgnoredAny =
// serde_json::from_str(metadata).expect("Is valid json syntax");
let metadata = Module::<TraitImpl>::json_metadata();
assert_eq!(EXPECTED_METADATA, metadata);
let _: serde::de::IgnoredAny =
serde_json::from_str(metadata).expect("Is valid json syntax");
}
}