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

[PLA-2120] MinInfusion dispatch rule #304

Merged
merged 1 commit into from
Dec 20, 2024
Merged

[PLA-2120] MinInfusion dispatch rule #304

merged 1 commit into from
Dec 20, 2024

Conversation

leonardocustodio
Copy link
Contributor

@leonardocustodio leonardocustodio commented Dec 20, 2024

PR Type

enhancement


Description

  • Introduced a new dispatch rule kind MinimumInfusion to the DispatchRuleKind enum in TankStorage.json.
  • Updated the DispatchRuleStorage enum to include MinimumInfusion with type u128.

Changes walkthrough 📝

Relevant files
Enhancement
TankStorage.json
Add `MinimumInfusion` dispatch rule to TankStorage             

src/Services/Processor/Substrate/Codec/Types/TankStorage.json

  • Added a new dispatch rule kind MinimumInfusion to the DispatchRuleKind
    enum.
  • Added MinimumInfusion with type u128 to the DispatchRuleStorage enum.
  • +4/-2     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Enum Consistency

    Ensure that the newly added MinimumInfusion dispatch rule is correctly integrated and does not conflict with existing rules in both DispatchRuleKind and DispatchRuleStorage.

          "RequireSignature",
          "MinimumInfusion"
        ]
      },
      "DispatchRuleStorage": {
        "_enum": {
          "WhitelistedCallers": "Vec<AccountId>",
          "WhitelistedCollections": "Vec<u128>",
          "MaxFuelBurnPerTransaction": "u128",
          "UserFuelBudget": "UserFuelBudgetRuleStorage",
          "TankFuelBudget": "TankFuelBudgetRuleStorage",
          "RequireToken": "RequireTokenRuleStorage",
          "PermittedCalls": "PermittedCallsRuleStorage",
          "PermittedExtrinsics": "PermittedExtrinsicsRuleStorage",
          "WhitelistedPallets": "Vec<Bytes>",
          "RequireSignature": "[u8; 32]",
          "MinimumInfusion": "u128"

    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    General
    Validate and handle new fields to prevent runtime issues

    Ensure that the new MinimumInfusion and RequireSignature fields are properly
    validated and handled in the corresponding application logic to avoid potential
    runtime errors or misconfigurations.

    src/Services/Processor/Substrate/Codec/Types/TankStorage.json [53-54]

    -"MinimumInfusion": "u128"
    +"MinimumInfusion": "u128",
    +"RequireSignature": "[u8; 32]"
    Suggestion importance[1-10]: 6

    Why: The suggestion to ensure proper validation and handling of the new fields "MinimumInfusion" and "RequireSignature" is relevant and important for preventing runtime errors or misconfigurations. However, it is not actionable in the context of the provided code diff, as it pertains to application logic outside the JSON schema. This reduces its immediate impact on the PR.

    6

    @leonardocustodio leonardocustodio merged commit 8c04d1d into master Dec 20, 2024
    5 of 7 checks passed
    @leonardocustodio leonardocustodio deleted the PLA-2120 branch December 20, 2024 15:21
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Development

    Successfully merging this pull request may close these issues.

    2 participants