Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lukaszcz
Copy link
Collaborator

@lukaszcz lukaszcz requested review from Copilot and janmasrovira July 16, 2025 09:11
@lukaszcz lukaszcz self-assigned this Jul 16, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors how Intent.ResourceData is stored by introducing a Intent.LabelData wrapper in the label field and adjusting resource construction and extraction accordingly.

  • Introduce Intent.LabelData to combine the intent’s label and its resource data.
  • Update Intent.toResource to embed ResourceData inside LabelData and use Unit for value.
  • Refactor fromResource functions and translation logic to extract data from the new LabelData.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
AVM/Intent.lean Added Intent.LabelData, updated toResource and fromResource to use the label field.
AVM/Class/Translation.lean Updated intent logic to extract and validate LabelData instead of raw ResourceData.
Comments suppressed due to low confidence (2)

AVM/Intent.lean:41

  • [nitpick] Consider adding a docstring for the data field in Intent.LabelData explaining that it contains the original Intent.ResourceData to improve clarity.
  data : Intent.ResourceData

AVM/Intent.lean:64

  • Consider adding unit tests for Intent.LabelData.fromResource and Intent.ResourceData.fromResource to verify that resources are correctly encoded in the label and can be round-tripped.
def Intent.LabelData.fromResource (res : Anoma.Resource.{u,v}) : Option Intent.LabelData.{u} :=

@lukaszcz lukaszcz merged commit 4d809d0 into main Jul 16, 2025
2 of 4 checks passed
@lukaszcz lukaszcz deleted the intents-use-label branch July 16, 2025 13:47
janmasrovira added a commit that referenced this pull request Jul 18, 2025
commit 4b9457b
Author: Jan Mas Rovira <[email protected]>
Date:   Fri Jul 18 09:44:49 2025 +0200

    add keys

commit 0695dd3
Author: Jan Mas Rovira <[email protected]>
Date:   Fri Jul 18 08:00:17 2025 +0200

    action

commit 9c21534
Author: Jan Mas Rovira <[email protected]>
Date:   Thu Jul 17 22:01:49 2025 +0200

    Logic

commit c0c6d22
Author: Jan Mas Rovira <[email protected]>
Date:   Thu Jul 17 18:41:41 2025 +0200

    more refactors

commit bcaa410
Author: Jan Mas Rovira <[email protected]>
Date:   Thu Jul 17 17:30:49 2025 +0200

    refactor files

commit 5bb96be
Author: Jan Mas Rovira <[email protected]>
Date:   Thu Jul 17 15:47:59 2025 +0200

    adapt examples

commit 0e0cdf6
Author: Jan Mas Rovira <[email protected]>
Date:   Thu Jul 17 13:19:14 2025 +0200

    label for intents

commit eae64cf
Author: Jan Mas Rovira <[email protected]>
Date:   Thu Jul 17 10:06:38 2025 +0200

    logic checks

commit 7155377
Author: Jan Mas Rovira <[email protected]>
Date:   Wed Jul 16 22:32:16 2025 +0200

    move intents out

commit e0882f4
Author: Jan Mas Rovira <[email protected]>
Date:   Wed Jul 16 22:15:20 2025 +0200

    function logic

commit 2051950
Author: Jan Mas Rovira <[email protected]>
Date:   Wed Jul 16 14:37:26 2025 +0200

    more changes

commit 9e8ca17
Author: Jan Mas Rovira <[email protected]>
Date:   Tue Jul 15 19:14:04 2025 +0200

    ecosystem wip

commit 4d809d0
Author: Łukasz Czajka <[email protected]>
Date:   Wed Jul 16 15:47:23 2025 +0200

    Use the `label` field to store Intent.ResourceData (#44)

    - Closes #39

commit 3db1b8e
Author: Łukasz Czajka <[email protected]>
Date:   Wed Jul 16 06:42:20 2025 +0200

    Compliance units (#43)

    - Closes #10
    - The translation is modified to divide each action into compliance
    units. Dummy ephemeral resources with quantity 0 are added to satisfy
    the requirement that each compliance unit needs to have one consumed and
    one created resource.
    - The RLs are updated to filter out (ignore) the dummy resources.

    ---------

    Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Store intent resource data in the label instead of the value field

3 participants