paritytech / ink

Compare 802bb13 ... +2 ... a4594f0

Coverage Reach
ink/ir/src/ir/item_impl/mod.rs ink/ir/src/ir/item_impl/callable.rs ink/ir/src/ir/item_impl/message.rs ink/ir/src/ir/item_impl/constructor.rs ink/ir/src/ir/item_impl/impl_item.rs ink/ir/src/ir/item_impl/iter.rs ink/ir/src/ir/item_impl/tests.rs ink/ir/src/ir/attrs.rs ink/ir/src/ir/trait_def/item/mod.rs ink/ir/src/ir/trait_def/item/trait_item.rs ink/ir/src/ir/trait_def/item/iter.rs ink/ir/src/ir/trait_def/config.rs ink/ir/src/ir/trait_def/mod.rs ink/ir/src/ir/trait_def/tests.rs ink/ir/src/ir/item/mod.rs ink/ir/src/ir/item/event.rs ink/ir/src/ir/item/storage.rs ink/ir/src/ir/item_mod.rs ink/ir/src/ir/chain_extension.rs ink/ir/src/ir/storage_item/mod.rs ink/ir/src/ir/storage_item/config.rs ink/ir/src/ir/utils.rs ink/ir/src/ir/selector.rs ink/ir/src/ir/e2e_config.rs ink/ir/src/ir/config.rs ink/ir/src/ir/blake2.rs ink/ir/src/ir/idents_lint.rs ink/ir/src/ir/contract.rs ink/ir/src/ir/ink_e2e_test.rs ink/ir/src/ir/ink_test.rs ink/ir/src/ast/attr_args.rs ink/ir/src/literal.rs ink/ir/src/error.rs ink/codegen/src/generator/trait_def/trait_registry.rs ink/codegen/src/generator/trait_def/call_forwarder.rs ink/codegen/src/generator/trait_def/call_builder.rs ink/codegen/src/generator/trait_def/definition.rs ink/codegen/src/generator/trait_def/mod.rs ink/codegen/src/generator/dispatch.rs ink/codegen/src/generator/as_dependency/contract_ref.rs ink/codegen/src/generator/as_dependency/call_builder.rs ink/codegen/src/generator/as_dependency/mod.rs ink/codegen/src/generator/metadata.rs ink/codegen/src/generator/item_impls.rs ink/codegen/src/generator/storage_item.rs ink/codegen/src/generator/events.rs ink/codegen/src/generator/ink_e2e_test.rs ink/codegen/src/generator/chain_extension.rs ink/codegen/src/generator/arg_list.rs ink/codegen/src/generator/storage.rs ink/codegen/src/generator/ink_test.rs ink/codegen/src/generator/contract.rs ink/codegen/src/generator/selector.rs ink/codegen/src/generator/blake2b.rs ink/codegen/src/generator/env.rs ink/codegen/src/generator/mod.rs ink/codegen/src/enforced_error.rs ink/codegen/src/traits.rs ink/codegen/src/lib.rs ink/tests/ui/contract/pass/example-erc721-works.rs ink/tests/ui/contract/pass/example-erc20-works.rs ink/tests/ui/contract/pass/dispatch-decoder-works.rs ink/tests/ui/contract/pass/event-topics.rs ink/tests/ui/contract/pass/event-anonymous.rs ink/tests/ui/contract/pass/event-many-definitions.rs ink/tests/ui/contract/pass/example-trait-incrementer-works.rs ink/tests/ui/contract/pass/message-selector.rs ink/tests/ui/contract/pass/message-many-outputs.rs ink/tests/ui/contract/pass/message-many-inputs.rs ink/tests/ui/contract/pass/env-access.rs ink/tests/ui/contract/pass/example-trait-flipper-works.rs ink/tests/ui/contract/pass/event-config-more-topics.rs ink/tests/ui/contract/pass/example-incrementer-works.rs ink/tests/ui/contract/pass/storage-many-fields.rs ink/tests/ui/contract/pass/constructor-many-inputs.rs ink/tests/ui/contract/pass/example-flipper-works.rs ink/tests/ui/contract/pass/traits-messages-same-name.rs ink/tests/ui/contract/pass/constructor-selector.rs ink/tests/ui/contract/pass/impl-block-using-env.rs ink/tests/ui/contract/pass/module-non-ink-items.rs ink/tests/ui/contract/pass/module-env-types.rs ink/tests/ui/contract/pass/trait-message-selector-guard.rs ink/tests/ui/contract/pass/trait-message-payable-guard.rs ink/tests/ui/contract/pass/message-payable.rs ink/tests/ui/contract/pass/storage-packed-fields.rs ink/tests/ui/contract/pass/constructor-payable-multiple.rs ink/tests/ui/contract/pass/constructor-non-payable-multiple.rs ink/tests/ui/contract/pass/message-wildcard-selector.rs ink/tests/ui/contract/pass/storage-single-field.rs ink/tests/ui/contract/pass/constructor-payable.rs ink/tests/ui/contract/pass/config-keep-attr.rs ink/tests/ui/contract/pass/event-single-definition.rs ink/tests/ui/contract/pass/storage-with-derives.rs ink/tests/ui/contract/pass/constructor-non-payable.rs ink/tests/ui/contract/pass/constructor-wildcard-selector.rs ink/tests/ui/contract/pass/impl-with-property.rs ink/tests/ui/contract/pass/impl-block-namespace.rs ink/tests/ui/contract/pass/no-implicit-prelude.rs ink/tests/ui/contract/pass/impl-alias-storage.rs ink/tests/ui/contract/pass/minimal-contract.rs ink/tests/ui/contract/pass/config-custom-env.rs ink/tests/ui/storage_item/pass/complex_non_packed_enum.rs ink/tests/ui/storage_item/pass/complex_non_packed_struct.rs ink/tests/ui/storage_item/pass/non_packed_tuple_struct.rs ink/tests/ui/storage_item/pass/argument_derive_false.rs ink/tests/ui/storage_item/pass/packed_tuple_struct.rs ink/tests/ui/storage_item/pass/complex_packed_enum.rs ink/tests/ui/storage_item/pass/complex_packed_struct.rs ink/tests/ui/storage_item/pass/default_storage_key_1.rs ink/tests/ui/storage_item/pass/default_storage_key_3.rs ink/tests/ui/storage_item/pass/default_storage_key_4.rs ink/tests/ui/storage_item/pass/default_storage_key_2.rs ink/tests/ui/chain_extension/E-01-simple.rs ink/tests/ui/trait_def/pass/payable_message.rs ink/tests/ui/trait_def/pass/valid_selectors_namespace.rs ink/tests/ui/trait_def/pass/valid_selectors.rs ink/tests/ui/trait_def/pass/avoid_overlap_with_namespace.rs ink/tests/ui/trait_def/pass/with_keep_attr.rs ink/tests/ui/trait_def/pass/many_outputs.rs ink/tests/ui/trait_def/pass/using-env-types.rs ink/tests/ui/trait_def/pass/no-implicit-prelude.rs ink/tests/ui/trait_def/pass/simple_definition.rs ink/tests/ui/trait_def/pass/with_namespace.rs ink/tests/ui/trait_def/pass/many_inputs.rs ink/tests/ui/selector_id/pass/string_input.rs ink/tests/ui/selector_id/pass/bytestring_input.rs ink/tests/ui/selector_id/pass/no_implicit_prelude.rs ink/tests/ui/blake2b/pass/bytestring_input.rs ink/tests/ui/blake2b/pass/string_input.rs ink/tests/ui/blake2b/pass/no_implicit_prelude.rs ink/tests/ui/selector_bytes/pass/bytestring_input.rs ink/tests/ui/selector_bytes/pass/string_input.rs ink/tests/ui/selector_bytes/pass/no_implicit_prelude.rs ink/tests/ui/pay_with_call/pass/multiple_args.rs ink/tests/unique_topics.rs ink/macro/src/storage/storage_layout.rs ink/macro/src/storage/storable.rs ink/macro/src/storage/storable_hint.rs ink/macro/src/storage/storage_key.rs ink/macro/src/storage/tests/mod.rs ink/macro/src/lib.rs ink/macro/src/selector.rs ink/macro/src/blake2b.rs ink/macro/src/storage_item.rs ink/macro/src/contract.rs ink/macro/src/chain_extension.rs ink/macro/src/trait_def.rs ink/macro/src/ink_e2e_test.rs ink/macro/src/ink_test.rs ink/src/env_access.rs ink/src/codegen/dispatch/execution.rs ink/src/reflect/dispatch.rs ink/src/result_info.rs env/src/engine/off_chain/impls.rs env/src/engine/off_chain/test_api.rs env/src/engine/off_chain/types.rs env/src/engine/off_chain/call_data.rs env/src/engine/off_chain/mod.rs env/src/engine/e2e/mod.rs env/src/engine/e2e/xts.rs env/src/call/call_builder.rs env/src/call/execution_input.rs env/src/call/create_builder.rs env/src/call/common.rs env/src/call/selector.rs env/src/api.rs env/src/chain_extension.rs env/src/backend.rs env/src/topics.rs env/src/arithmetic.rs env/src/types.rs metadata/src/specs.rs metadata/src/layout/mod.rs metadata/src/layout/tests.rs metadata/src/layout/validate.rs metadata/src/lib.rs metadata/src/utils.rs engine/src/ext.rs engine/src/test_api.rs engine/src/database.rs engine/src/chain_extension.rs engine/src/exec_context.rs engine/src/hashing.rs engine/src/types.rs engine/src/tests.rs allocator/src/bump.rs storage/src/lazy/mod.rs storage/src/lazy/mapping.rs storage/traits/src/layout/impls.rs storage/traits/src/storage.rs storage/traits/src/impls/mod.rs primitives/src/types.rs primitives/src/key.rs

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 1 of 3 files from the diff.

@@ -25,6 +25,7 @@
Loading
25 25
};
26 26
use proc_macro2::TokenStream as TokenStream2;
27 27
use quote::{
28 +
    format_ident,
28 29
    quote,
29 30
    quote_spanned,
30 31
};
@@ -488,19 +489,25 @@
Loading
488 489
                #constructor_ident(#constructor_input)
489 490
            )
490 491
        });
491 -
        let constructor_match = (0..count_constructors).map(|index| {
492 -
            let constructor_span = constructor_spans[index];
493 -
            let constructor_ident = constructor_variant_ident(index);
494 -
            let constructor_selector = quote_spanned!(span=>
495 -
                <#storage_ident as ::ink::reflect::DispatchableConstructorInfo<{
492 +
493 +
        let constructor_selector = (0..count_constructors).map(|index| {
494 +
            let const_ident = format_ident!("CONSTRUCTOR_{}", index);
495 +
            quote_spanned!(span=>
496 +
                const #const_ident: [::core::primitive::u8; 4usize] = <#storage_ident as ::ink::reflect::DispatchableConstructorInfo<{
496 497
                    <#storage_ident as ::ink::reflect::ContractDispatchableConstructors<{
497 498
                        <#storage_ident as ::ink::reflect::ContractAmountDispatchables>::CONSTRUCTORS
498 499
                    }>>::IDS[#index]
499 -
                }>>::SELECTOR
500 -
            );
500 +
                }>>::SELECTOR;
501 +
            )
502 +
        });
503 +
504 +
        let constructor_match = (0..count_constructors).map(|index| {
505 +
            let constructor_span = constructor_spans[index];
506 +
            let constructor_ident = constructor_variant_ident(index);
507 +
            let const_ident = format_ident!("CONSTRUCTOR_{}", index);
501 508
            let constructor_input = expand_constructor_input(constructor_span, storage_ident, index);
502 509
            quote_spanned!(constructor_span=>
503 -
                #constructor_selector => {
510 +
                #const_ident => {
504 511
                    ::core::result::Result::Ok(Self::#constructor_ident(
505 512
                        <#constructor_input as ::scale::Decode>::decode(input)
506 513
                            .map_err(|_| ::ink::reflect::DispatchError::InvalidParameters)?
@@ -579,6 +586,9 @@
Loading
579 586
                    where
580 587
                        I: ::scale::Input,
581 588
                    {
589 +
                        #(
590 +
                            #constructor_selector
591 +
                        )*
582 592
                        match <[::core::primitive::u8; 4usize] as ::scale::Decode>::decode(input)
583 593
                            .map_err(|_| ::ink::reflect::DispatchError::InvalidSelector)?
584 594
                        {
@@ -656,19 +666,25 @@
Loading
656 666
                #message_ident(#message_input)
657 667
            )
658 668
        });
659 -
        let message_match = (0..count_messages).map(|index| {
660 -
            let message_span = message_spans[index];
661 -
            let message_ident = message_variant_ident(index);
662 -
            let message_selector = quote_spanned!(span=>
663 -
                <#storage_ident as ::ink::reflect::DispatchableMessageInfo<{
669 +
670 +
        let message_selector = (0..count_messages).map(|index| {
671 +
            let const_ident = format_ident!("MESSAGE_{}", index);
672 +
            quote_spanned!(span=>
673 +
                const #const_ident: [::core::primitive::u8; 4usize] = <#storage_ident as ::ink::reflect::DispatchableMessageInfo<{
664 674
                    <#storage_ident as ::ink::reflect::ContractDispatchableMessages<{
665 675
                        <#storage_ident as ::ink::reflect::ContractAmountDispatchables>::MESSAGES
666 676
                    }>>::IDS[#index]
667 -
                }>>::SELECTOR
668 -
            );
677 +
                }>>::SELECTOR;
678 +
            )
679 +
        });
680 +
681 +
        let message_match = (0..count_messages).map(|index| {
682 +
            let message_span = message_spans[index];
683 +
            let message_ident = message_variant_ident(index);
684 +
            let const_ident = format_ident!("MESSAGE_{}", index);
669 685
            let message_input = expand_message_input(message_span, storage_ident, index);
670 686
            quote_spanned!(message_span=>
671 -
                #message_selector => {
687 +
                #const_ident => {
672 688
                    ::core::result::Result::Ok(Self::#message_ident(
673 689
                        <#message_input as ::scale::Decode>::decode(input)
674 690
                            .map_err(|_| ::ink::reflect::DispatchError::InvalidParameters)?
@@ -777,6 +793,9 @@
Loading
777 793
                    where
778 794
                        I: ::scale::Input,
779 795
                    {
796 +
                        #(
797 +
                            #message_selector
798 +
                        )*
780 799
                        match <[::core::primitive::u8; 4usize] as ::scale::Decode>::decode(input)
781 800
                            .map_err(|_| ::ink::reflect::DispatchError::InvalidSelector)?
782 801
                        {

Learn more Showing 1 files with coverage changes found.

Changes in crates/metadata/src/layout/mod.rs
-2
+2
Loading file...
Files Coverage
crates 0.06% 70.84%
Project Totals (193 files) 70.84%
Loading