Skip to content

Commit

Permalink
[feature] hyperledger-iroha#3533: Rename Bool to bool in schema
Browse files Browse the repository at this point in the history
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
  • Loading branch information
mversic committed May 26, 2023
1 parent 7865b25 commit 1de25f3
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
36 changes: 18 additions & 18 deletions docs/source/references/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@
"Struct": [
{
"name": "left",
"type": "EvaluatesTo<Bool>"
"type": "EvaluatesTo<bool>"
},
{
"name": "right",
"type": "EvaluatesTo<Bool>"
"type": "EvaluatesTo<bool>"
}
]
},
Expand Down Expand Up @@ -664,7 +664,6 @@
]
},
"BlockSubscriptionRequest": "u64",
"Bool": "Bool",
"BurnBox": {
"Struct": [
{
Expand Down Expand Up @@ -708,7 +707,7 @@
"Struct": [
{
"name": "condition",
"type": "EvaluatesTo<Bool>"
"type": "EvaluatesTo<bool>"
},
{
"name": "then",
Expand Down Expand Up @@ -1083,14 +1082,6 @@
}
]
},
"EvaluatesTo<Bool>": {
"Struct": [
{
"name": "expression",
"type": "Expression"
}
]
},
"EvaluatesTo<DomainId>": {
"Struct": [
{
Expand Down Expand Up @@ -1187,6 +1178,14 @@
}
]
},
"EvaluatesTo<bool>": {
"Struct": [
{
"name": "expression",
"type": "Expression"
}
]
},
"Event": {
"Enum": [
{
Expand Down Expand Up @@ -2200,7 +2199,7 @@
"Struct": [
{
"name": "condition",
"type": "EvaluatesTo<Bool>"
"type": "EvaluatesTo<bool>"
},
{
"name": "then",
Expand Down Expand Up @@ -2595,7 +2594,7 @@
"Struct": [
{
"name": "expression",
"type": "EvaluatesTo<Bool>"
"type": "EvaluatesTo<bool>"
}
]
},
Expand Down Expand Up @@ -2685,11 +2684,11 @@
"Struct": [
{
"name": "left",
"type": "EvaluatesTo<Bool>"
"type": "EvaluatesTo<bool>"
},
{
"name": "right",
"type": "EvaluatesTo<Bool>"
"type": "EvaluatesTo<bool>"
}
]
},
Expand Down Expand Up @@ -3563,7 +3562,7 @@
}
]
},
"SignatureCheckCondition": "EvaluatesTo<Bool>",
"SignatureCheckCondition": "EvaluatesTo<bool>",
"SignatureOf<CommittedBlock>": "Signature",
"SignatureOf<QueryPayload>": "Signature",
"SignatureOf<TransactionPayload>": "Signature",
Expand Down Expand Up @@ -4131,7 +4130,7 @@
{
"tag": "Bool",
"discriminant": 0,
"type": "Bool"
"type": "bool"
},
{
"tag": "String",
Expand Down Expand Up @@ -4537,6 +4536,7 @@
}
]
},
"bool": "bool",
"i64": {
"Int": "FixedWidth"
},
Expand Down
4 changes: 2 additions & 2 deletions schema/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,12 @@ impl IntoSchema for String {

impl TypeId for bool {
fn id() -> String {
"Bool".to_owned()
"bool".to_owned()
}
}
impl IntoSchema for bool {
fn type_name() -> String {
"Bool".to_owned()
"bool".to_owned()
}
fn update_schema_map(map: &mut MetaMap) {
if !map.contains_key::<Self>() {
Expand Down
4 changes: 2 additions & 2 deletions schema/tests/enum_with_default_discriminants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn default_discriminants() {
(
TypeId::of::<core::result::Result<bool, alloc::string::String>>(),
(
"Result<Bool, String>".to_owned(),
"Result<bool, String>".to_owned(),
Result(ResultMeta {
ok: TypeId::of::<bool>(),
err: TypeId::of::<alloc::string::String>(),
Expand All @@ -37,7 +37,7 @@ fn default_discriminants() {
TypeId::of::<alloc::string::String>(),
("String".to_owned(), String),
),
(TypeId::of::<bool>(), ("Bool".to_owned(), Bool)),
(TypeId::of::<bool>(), ("bool".to_owned(), Bool)),
(
TypeId::of::<Foo>(),
(
Expand Down
6 changes: 3 additions & 3 deletions schema/tests/struct_with_generic_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ fn check_generic() {
}],
});
let expected = vec![
(TypeId::of::<bool>(), ("Bool".to_owned(), Bool)),
(TypeId::of::<bool>(), ("bool".to_owned(), Bool)),
(
TypeId::of::<core::option::Option<bool>>(),
("Option<Bool>".to_owned(), Option(TypeId::of::<bool>())),
("Option<bool>".to_owned(), Option(TypeId::of::<bool>())),
),
(
TypeId::of::<Foo<bool>>(),
("Foo<Bool>".to_owned(), expected_struct),
("Foo<bool>".to_owned(), expected_struct),
),
]
.into_iter()
Expand Down

0 comments on commit 1de25f3

Please sign in to comment.