forked from hyperledger-iroha/iroha
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…oming `IntoSchema`. Signed-off-by: Aleksandr Petrosyan <[email protected]>
- Loading branch information
1 parent
eec49e0
commit ef0c4bf
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use impls::impls; | ||
use iroha_schema::IntoSchema; | ||
use parity_scale_codec::{Decode, Encode}; | ||
|
||
#[test] | ||
fn usize_isize_not_into_schema() { | ||
// The architecture-dependent | ||
assert!(!impls!(usize: IntoSchema)); | ||
assert!(!impls!(isize: IntoSchema)); | ||
|
||
// use serde::Serialize; | ||
// | ||
// assert!(!impls!(usize: Serialize)); | ||
// `usize` should be `Serialize`. | ||
|
||
// But not `Encode`/`Decode`. | ||
assert!(!impls!(usize: Encode | Decode)); | ||
assert!(!impls!(isize: Encode | Decode)); | ||
|
||
// There are no other primitive architecture-dependent types, so | ||
// as long as `IntoSchema` requires all variants and all fields to | ||
// also be `IntoSchema`, we are guaranteed that all schema types | ||
// are safe to exchange. | ||
} |