Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: report schema type id in no_extra_or_missing_schemas test #5054

Merged

Conversation

DCNick3
Copy link
Contributor

@DCNick3 DCNick3 commented Sep 10, 2024

Context

Fixes #5041.

Solution

  • Make MetaMap preserve the type id (the one reported by iroha's TypeId::id). Unlike type name, this string is not affected by the transparent types, and now adequately reports the problem with a missing Boxed type
  • Expose the type id in the no_extra_or_missing_schemas test
Error before
Missing types: {
    (
        "CompoundPredicate<AccountPredicateBox>",
        Enum(
            EnumMeta {
                variants: [
                    EnumVariant {
                        tag: "Atom",
                        discriminant: 0,
                        ty: Some(
                            TypeId {
                                t: (
                                    10095233817367655734,
                                    3465063886364562919,
                                ),
                            },
                        ),
                    },
                    EnumVariant {
                        tag: "Not",
                        discriminant: 1,
                        ty: Some(
                            TypeId {
                                t: (
                                    14448333017410507765,
                                    1039736120081770805,
                                ),
                            },
                        ),
                    },
                    EnumVariant {
                        tag: "And",
                        discriminant: 2,
                        ty: Some(
                            TypeId {
                                t: (
                                    13976757441058666220,
                                    14378548965820588092,
                                ),
                            },
                        ),
                    },
                    EnumVariant {
                        tag: "Or",
                        discriminant: 3,
                        ty: Some(
                            TypeId {
                                t: (
                                    13976757441058666220,
                                    14378548965820588092,
                                ),
                            },
                        ),
                    },
                ],
            },
        ),
    ),
}
Error after
Missing types: {
    MetaMapEntry {
        type_id: "Box<CompoundPredicate<AccountPredicateBox>>",
        type_name: "CompoundPredicate<AccountPredicateBox>",
        metadata: Enum(
            EnumMeta {
                variants: [
                    EnumVariant {
                        tag: "Atom",
                        discriminant: 0,
                        ty: Some(
                            TypeId {
                                t: (
                                    5033077372577703197,
                                    9237201265375853478,
                                ),
                            },
                        ),
                    },
                    EnumVariant {
                        tag: "Not",
                        discriminant: 1,
                        ty: Some(
                            TypeId {
                                t: (
                                    1071909541625897376,
                                    5461414499519987801,
                                ),
                            },
                        ),
                    },
                    EnumVariant {
                        tag: "And",
                        discriminant: 2,
                        ty: Some(
                            TypeId {
                                t: (
                                    2726655154496140060,
                                    54165042778783804,
                                ),
                            },
                        ),
                    },
                    EnumVariant {
                        tag: "Or",
                        discriminant: 3,
                        ty: Some(
                            TypeId {
                                t: (
                                    2726655154496140060,
                                    54165042778783804,
                                ),
                            },
                        ),
                    },
                ],
            },
        ),
    },
}

Checklist

  • I've read CONTRIBUTING.md.
  • I've written unit tests for the code changes.
  • All review comments have been resolved.
  • All CI checks pass.

nxsaken
nxsaken previously approved these changes Sep 11, 2024
@nxsaken nxsaken force-pushed the report-type-id-in-no_extra_or_missing_schemas branch from ba7ecd1 to efc461d Compare September 12, 2024 13:56
@DCNick3 DCNick3 merged commit e680397 into hyperledger:main Sep 18, 2024
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants