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

feat(x/intent)!: ability for modules to dynamically resolve variables on Action creation #139

Merged
merged 19 commits into from
Apr 4, 2024

Commits on Apr 3, 2024

  1. feat(wardend): prefer context.Context over sdk.Context where possible

    This allow us to pass other context to functions. In the future we might
    exploit this feature for enriching the sdk.Context with more fields.
    Pitasi committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    5c92f21 View commit details
    Browse the repository at this point in the history
  2. feat(shield): move Environment interface out of internal package

    Even if it was type-aliased (= re-exported), the depinject pkg from
    Cosmos SDK didn't like it. Since Environment is commonly accessed from
    outside of shield, it makes sense to move it outside the internal/ dir
    anyway.
    Pitasi committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    5c6d560 View commit details
    Browse the repository at this point in the history
  3. feat(shield): allow dots (.) in identifier names

    In this version of shield we'll treat dots as part of the identifier
    (i.e. we won't dig much into building "javascript objects" equivalents).
    It'll be up to the Environment resolving the identifier to do whatever
    it prefers.
    
    E.g. `warden.space.owners` will be treated as a single name. The
    resolution env from x/warden can split by '.' and resolve 'space'
    properties individually.
    Pitasi committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    1ec0cd3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d8ff2f7 View commit details
    Browse the repository at this point in the history
  5. feat(shield): add custom AST preprocessing

    This allows anyone to plug-in an implementer of the Expander interface
    to change the AST into another AST by replacing any Identifier with
    another AST node.
    
    This will be useful for resolving some Identifiers into Warden addresses
    and freeze them in time (e.g. when an Action is created).
    Pitasi committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    b0ca9d2 View commit details
    Browse the repository at this point in the history
  6. feat(shield): add ast.Stringify method to translate an AST back into …

    …its string definition
    Pitasi committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    243885f View commit details
    Browse the repository at this point in the history
  7. feat(x/intent): inject a constructor for a shield.Expander

    We'll use the Expander later, when creating an Action, to process the
    Intent definition at the time the Action is created.
    Pitasi committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    3f75ee0 View commit details
    Browse the repository at this point in the history
  8. feat(x/intent): provide an ast.Expander implementation

    The ExpanderManager will dispatch Expander calls based on "namespace",
    i.e. the first part of an identifier (separated by a dot).
    Pitasi committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    a739df6 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f9d9b42 View commit details
    Browse the repository at this point in the history
  10. feat(x/intent): move and rename Intent.Addresses to Action.Mentions

    This way we can populate this field *after* preprocessing. The Intent
    stored in the database will have the original definition written by the
    user, the Intent stored inside the Action will be preprocessed (so the
    user knows exactly what's being evaluated to decide on its Action).
    Pitasi committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    9ff1f3f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    259a8f8 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    35e54e4 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    0de2035 View commit details
    Browse the repository at this point in the history
  14. feat(x/warden): provide shield.Expander for warden module

    In this initial version, it's able to expand `space.owners` in the list
    of owners for the space.
    Only sdk.Msgs that have a SpaceId field are supported at this time.
    Pitasi committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    46eb179 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    2fb9011 View commit details
    Browse the repository at this point in the history
  16. chore: changelog

    Pitasi committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    b0be1b2 View commit details
    Browse the repository at this point in the history
  17. Update warden/x/warden/keeper/shield.go

    Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
    Pitasi and coderabbitai[bot] authored Apr 3, 2024
    Configuration menu
    Copy the full SHA
    570ac20 View commit details
    Browse the repository at this point in the history
  18. chore: fix changelog scope

    Pitasi committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    8e2d7e3 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    53ee308 View commit details
    Browse the repository at this point in the history