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

Rust action template generation issue #896

Open
James-Mart opened this issue Oct 23, 2024 · 1 comment
Open

Rust action template generation issue #896

James-Mart opened this issue Oct 23, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@James-Mart
Copy link
Member

Schema generation appears to tolower all of the action names:

"actions": {
    ...
    "debit": {
        "params": {
            "Object": {
                "nftId": "@0",
                "memo": "@3"
            }
        },
        "result": null
    },
    "setuserconf": {
        "params": {
            "Object": {
                "flag": "@6",
                "enable": "@7"
            }
        },
        "result": null
    },
    ...
},

Generating action_templates, in Rust, uses the generated schema, and therefore everything is lowercase.

"actions": {
        "setmetadata": {
            "params": {
                "Object": {
                    "name": "@0",
                    "short_description": "@0",
                    "long_description": "@0",
                    "icon": "@0",
                    "icon_mime_type": "@0",
                    "tos_subpage": "@0",
                    "privacy_policy_subpage": "@0",
                    "app_homepage_subpage": "@0",
                    "status": "@1",
                    "tags": "@2",
                    "redirect_uris": "@2",
                    "owners": "@4"
                }
            },
            "result": null
        },
        ...
}

But for a C++ endpoint, I can see that the generated action_templates is still case sensitive:

{
    ...
    "debit": {
        "nftId": 0,
        "memo": ""
    },
    "setUserConf": {
        "flag": "",
        "enable": false
    },
    ...
}

Practically, this results in the simple_ui being broken for Rust services for any mixed-case actions, since pack_action fails to match the specified action name.

@James-Mart James-Mart added the bug Something isn't working label Oct 23, 2024
@James-Mart
Copy link
Member Author

Idk if it's the right solution but a workaround is to use name.to_string().to_lowercase() right here

let name_str = name.to_string();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants