Skip to content

Commit

Permalink
fix storage_derive UI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbepop committed Sep 19, 2021
1 parent 6db13fd commit 2672dd2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 40 deletions.
56 changes: 28 additions & 28 deletions crates/storage/derive/src/tests/spread_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ fn unit_struct_works() {
const _: () = {
impl ::ink_storage::traits::SpreadLayout for UnitStruct {
#[allow(unused_comparisons)]
const FOOTPRINT: u64 = [0u64, 0u64][(0u64 < 0u64) as usize];
const FOOTPRINT: ::core::primitive::u64 = [0u64, 0u64][(0u64 < 0u64) as ::core::primitive::usize];

const REQUIRES_DEEP_CLEAN_UP : bool = (false || false );
const REQUIRES_DEEP_CLEAN_UP : ::core::primitive::bool = (false || false );

fn pull_spread(__key_ptr: &mut ::ink_storage::traits::KeyPtr) -> Self {
UnitStruct
Expand Down Expand Up @@ -71,7 +71,7 @@ fn struct_works() {
const _: () = {
impl ::ink_storage::traits::SpreadLayout for NamedFields {
#[allow(unused_comparisons)]
const FOOTPRINT: u64 = [
const FOOTPRINT: ::core::primitive::u64 = [
(((0u64 + <i32 as ::ink_storage::traits::SpreadLayout>::FOOTPRINT)
+ <[u8; 32] as ::ink_storage::traits::SpreadLayout>::FOOTPRINT)
+ <Box<i32> as ::ink_storage::traits::SpreadLayout>::FOOTPRINT),
Expand All @@ -80,10 +80,10 @@ fn struct_works() {
+ <i32 as ::ink_storage::traits::SpreadLayout>::FOOTPRINT)
+ <[u8; 32] as ::ink_storage::traits::SpreadLayout>::FOOTPRINT)
+ <Box<i32> as ::ink_storage::traits::SpreadLayout>::FOOTPRINT)
< 0u64) as usize
< 0u64) as ::core::primitive::usize
];

const REQUIRES_DEEP_CLEAN_UP : bool = (
const REQUIRES_DEEP_CLEAN_UP : ::core::primitive::bool = (
false || (
(
(
Expand Down Expand Up @@ -181,7 +181,7 @@ fn enum_works() {
const _: () = {
impl ::ink_storage::traits::SpreadLayout for MixedEnum {
#[allow(unused_comparisons)]
const FOOTPRINT : u64 = 1 + [
const FOOTPRINT : ::core::primitive::u64 = 1 + [
0u64 ,
[
(
Expand Down Expand Up @@ -211,7 +211,7 @@ fn enum_works() {
+ <(bool, i32) as ::ink_storage::traits::SpreadLayout>::FOOTPRINT
)
< 0u64
) as usize
) as ::core::primitive::usize
]
][
(
Expand Down Expand Up @@ -241,9 +241,9 @@ fn enum_works() {
+ <(bool, i32) as ::ink_storage::traits::SpreadLayout>::FOOTPRINT
)
< 0u64
) as usize
) as ::core::primitive::usize
]
) as usize
) as ::core::primitive::usize
]
][
(
Expand Down Expand Up @@ -274,7 +274,7 @@ fn enum_works() {
+ <(bool, i32) as ::ink_storage::traits::SpreadLayout>::FOOTPRINT
)
< 0u64
) as usize
) as ::core::primitive::usize
]
][
(
Expand Down Expand Up @@ -304,14 +304,14 @@ fn enum_works() {
+ <(bool, i32) as ::ink_storage::traits::SpreadLayout>::FOOTPRINT
)
< 0u64
) as usize
) as ::core::primitive::usize
]
) as usize
) as ::core::primitive::usize
]
) as usize
) as ::core::primitive::usize
];

const REQUIRES_DEEP_CLEAN_UP : bool = (
const REQUIRES_DEEP_CLEAN_UP : ::core::primitive::bool = (
(
(false || false)
|| (
Expand All @@ -332,7 +332,7 @@ fn enum_works() {
);

fn pull_spread(__key_ptr: &mut ::ink_storage::traits::KeyPtr) -> Self {
match <u8 as ::ink_storage::traits::SpreadLayout>::pull_spread(__key_ptr)
match <::core::primitive::u8 as ::ink_storage::traits::SpreadLayout>::pull_spread(__key_ptr)
{
0u8 => MixedEnum::A,
1u8 => MixedEnum::B(
Expand All @@ -350,15 +350,15 @@ fn enum_works() {
match self {
MixedEnum::A => {
{
<u8 as ::ink_storage::traits::SpreadLayout>::push_spread(
<::core::primitive::u8 as ::ink_storage::traits::SpreadLayout>::push_spread(
&0u8,
__key_ptr
);
}
}
MixedEnum::B(__binding_0, __binding_1,) => {
{
<u8 as ::ink_storage::traits::SpreadLayout>::push_spread(
<::core::primitive::u8 as ::ink_storage::traits::SpreadLayout>::push_spread(
&1u8,
__key_ptr
);
Expand All @@ -381,7 +381,7 @@ fn enum_works() {
b: __binding_1,
} => {
{
<u8 as ::ink_storage::traits::SpreadLayout>::push_spread(
<::core::primitive::u8 as ::ink_storage::traits::SpreadLayout>::push_spread(
&2u8, __key_ptr
);
}
Expand Down Expand Up @@ -459,16 +459,16 @@ fn generic_struct_works() {
T2: ::ink_storage::traits::SpreadLayout
{
#[allow(unused_comparisons)]
const FOOTPRINT: u64 = [
const FOOTPRINT: ::core::primitive::u64 = [
((0u64 + <T1 as ::ink_storage::traits::SpreadLayout>::FOOTPRINT)
+ <(T1, T2) as ::ink_storage::traits::SpreadLayout>::FOOTPRINT),
0u64
][(((0u64 + <T1 as ::ink_storage::traits::SpreadLayout>::FOOTPRINT)
+ <(T1, T2) as ::ink_storage::traits::SpreadLayout>::FOOTPRINT)
< 0u64) as usize
< 0u64) as ::core::primitive::usize
];

const REQUIRES_DEEP_CLEAN_UP : bool = (
const REQUIRES_DEEP_CLEAN_UP : ::core::primitive::bool = (
false || (
(
false
Expand Down Expand Up @@ -555,7 +555,7 @@ fn generic_enum_works() {
T2: ::ink_storage::traits::SpreadLayout
{
#[allow(unused_comparisons)]
const FOOTPRINT: u64 = 1 + [
const FOOTPRINT: ::core::primitive::u64 = 1 + [
((0u64 + <T1 as ::ink_storage::traits::SpreadLayout>::FOOTPRINT)
+ <T2 as ::ink_storage::traits::SpreadLayout>::FOOTPRINT),
[
Expand All @@ -565,7 +565,7 @@ fn generic_enum_works() {
][(((0u64
+ <T1 as ::ink_storage::traits::SpreadLayout>::FOOTPRINT)
+ <T2 as ::ink_storage::traits::SpreadLayout>::FOOTPRINT)
< 0u64) as usize]
< 0u64) as ::core::primitive::usize]
][(((0u64 + <T1 as ::ink_storage::traits::SpreadLayout>::FOOTPRINT)
+ <T2 as ::ink_storage::traits::SpreadLayout>::FOOTPRINT)
< [
Expand All @@ -575,10 +575,10 @@ fn generic_enum_works() {
][(((0u64
+ <T1 as ::ink_storage::traits::SpreadLayout>::FOOTPRINT)
+ <T2 as ::ink_storage::traits::SpreadLayout>::FOOTPRINT)
< 0u64) as usize]) as usize
< 0u64) as ::core::primitive::usize]) as ::core::primitive::usize
];

const REQUIRES_DEEP_CLEAN_UP : bool = (
const REQUIRES_DEEP_CLEAN_UP : ::core::primitive::bool = (
(
false || (
(
Expand All @@ -598,7 +598,7 @@ fn generic_enum_works() {
);

fn pull_spread(__key_ptr: &mut ::ink_storage::traits::KeyPtr) -> Self {
match <u8 as ::ink_storage::traits::SpreadLayout>::pull_spread(__key_ptr)
match <::core::primitive::u8 as ::ink_storage::traits::SpreadLayout>::pull_spread(__key_ptr)
{
0u8 => GenericEnum::Tuple(
<T1 as ::ink_storage::traits::SpreadLayout>::pull_spread(__key_ptr),
Expand All @@ -616,7 +616,7 @@ fn generic_enum_works() {
match self {
GenericEnum::Tuple(__binding_0, __binding_1,) => {
{
<u8 as ::ink_storage::traits::SpreadLayout>::push_spread(&0u8, __key_ptr);
<::core::primitive::u8 as ::ink_storage::traits::SpreadLayout>::push_spread(&0u8, __key_ptr);
}
{
::ink_storage::traits::SpreadLayout::push_spread(
Expand All @@ -636,7 +636,7 @@ fn generic_enum_works() {
b: __binding_1,
} => {
{
<u8 as ::ink_storage::traits::SpreadLayout>::push_spread(&1u8, __key_ptr);
<::core::primitive::u8 as ::ink_storage::traits::SpreadLayout>::push_spread(&1u8, __key_ptr);
}
{
::ink_storage::traits::SpreadLayout::push_spread(
Expand Down
24 changes: 12 additions & 12 deletions crates/storage/derive/src/tests/storage_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ fn tuple_struct_works() {
::ink_metadata::layout::Layout::Struct(
::ink_metadata::layout::StructLayout::new(vec![
::ink_metadata::layout::FieldLayout::new(
None,
::core::option::Option::None,
<bool as ::ink_storage::traits::StorageLayout>::layout(__key_ptr),
),
::ink_metadata::layout::FieldLayout::new(
None,
::core::option::Option::None,
<u32 as ::ink_storage::traits::StorageLayout>::layout(__key_ptr),
),
::ink_metadata::layout::FieldLayout::new(
None,
::core::option::Option::None,
<i64 as ::ink_storage::traits::StorageLayout>::layout(__key_ptr),
),
])
Expand Down Expand Up @@ -84,15 +84,15 @@ fn named_fields_struct_works() {
::ink_metadata::layout::Layout::Struct(
::ink_metadata::layout::StructLayout::new(vec![
::ink_metadata::layout::FieldLayout::new(
Some("a"),
::core::option::Option::Some("a"),
<bool as ::ink_storage::traits::StorageLayout>::layout(__key_ptr),
),
::ink_metadata::layout::FieldLayout::new(
Some("b"),
::core::option::Option::Some("b"),
<u32 as ::ink_storage::traits::StorageLayout>::layout(__key_ptr),
),
::ink_metadata::layout::FieldLayout::new(
Some("c"),
::core::option::Option::Some("c"),
<i64 as ::ink_storage::traits::StorageLayout>::layout(__key_ptr),
),
])
Expand Down Expand Up @@ -191,15 +191,15 @@ fn mixed_enum_works() {
::ink_metadata::layout::Discriminant::from(1usize),
::ink_metadata::layout::StructLayout::new(vec![
::ink_metadata::layout::FieldLayout::new(
None,
::core::option::Option::None,
<bool as ::ink_storage::traits::StorageLayout>::layout(__key_ptr),
),
::ink_metadata::layout::FieldLayout::new(
None,
::core::option::Option::None,
<u32 as ::ink_storage::traits::StorageLayout>::layout(__key_ptr),
),
::ink_metadata::layout::FieldLayout::new(
None,
::core::option::Option::None,
<i64 as ::ink_storage::traits::StorageLayout>::layout(__key_ptr),
),
]),
Expand All @@ -212,15 +212,15 @@ fn mixed_enum_works() {
::ink_metadata::layout::Discriminant::from(2usize),
::ink_metadata::layout::StructLayout::new(vec![
::ink_metadata::layout::FieldLayout::new(
Some("a"),
::core::option::Option::Some("a"),
<bool as ::ink_storage::traits::StorageLayout>::layout(__key_ptr),
),
::ink_metadata::layout::FieldLayout::new(
Some("b"),
::core::option::Option::Some("b"),
<u32 as ::ink_storage::traits::StorageLayout>::layout(__key_ptr),
),
::ink_metadata::layout::FieldLayout::new(
Some("c"),
::core::option::Option::Some("c"),
<i64 as ::ink_storage::traits::StorageLayout>::layout(__key_ptr),
),
]),
Expand Down

0 comments on commit 2672dd2

Please sign in to comment.