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

Account locker in manifest summary encountered entities #213

Merged
merged 11 commits into from
Sep 11, 2024

Conversation

sergiupuhalschi-rdx
Copy link
Contributor

No description provided.

address_union!(
/// A tagged union of all the encountered addresses in the manifest.
/// This is to be primarily used for the "using dApps" section of the wallet's tx review screen.
enum ManifestEncounteredAddress: component, locker
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure about the enum name

Copy link
Contributor

Choose a reason for hiding this comment

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

Did you ask Omar if there is any other address which belongs here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I didn't ask, but should we add other types even if we don't need them in the wallets right now? It will be quite easy to add a new address type when required.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not add other types for now, the logic in the Wallet to display the "used dApps" is explicitly for globalGenericComponents + account locker.

At some point, RET had a field called userApplications in summary, meant to point that these potentially have associated dApps. Maybe we can have the field in the execution summary more specific to potential dApps used, rather than generic ManifestEncounteredAddress, which presumably, by the name, should include all addresses

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@GhenadieVP do you have an example? I agree, but I still can't think of a better name to reflect what you described, UserApplicationAddress doesn't sound better and it lacks context (as the keyword manifest offers).

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't it too generic? I mean that we are filtering the original addresses after all

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At first, I thought that AddressReferencedInTX is more specific, but now that I think of it all of the addresses referenced in a manifest are referenced in the transaction so I guess you're right and it's better to put emphasis on the fact that the addresses are of components. I'll rename it to ManifestEncounteredComponentAddress.

Copy link
Contributor

Choose a reason for hiding this comment

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

but it is not component addresses. LockerAddress is not ComponentAddress right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's not a component address, but locker is a component, right? But I see what you're saying and that's why I didn't use component when naming it initially.

Copy link
Contributor Author

@sergiupuhalschi-rdx sergiupuhalschi-rdx Sep 11, 2024

Choose a reason for hiding this comment

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

Now the component keyword expresses that it's not just encountered addresses, but addresses of components (not resources or other types of addresses there are). I'd leave it as is unless someone has other suggestions that reflect the fact that the addresses were filtered to match this criteria.

Copy link

codecov bot commented Sep 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.4%. Comparing base (9c874a3) to head (354e519).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #213   +/-   ##
=====================================
  Coverage   97.4%   97.4%           
=====================================
  Files        932     938    +6     
  Lines      14954   15005   +51     
  Branches      64      66    +2     
=====================================
+ Hits       14572   14623   +51     
  Misses       375     375           
  Partials       7       7           
Flag Coverage Δ
kotlin 98.8% <100.0%> (+<0.1%) ⬆️
rust 96.9% <100.0%> (+<0.1%) ⬆️
swift 99.4% <100.0%> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ss/ManifestEncounteredAddress+Wrap+Functions.swift 100.0% <100.0%> (ø)
...ddress/ManifestEncounteredAddress+Swiftified.swift 100.0% <100.0%> (ø)
crates/sargon/src/core/error/common_error.rs 100.0% <ø> (ø)
...ic_types/manifest_encountered_component_address.rs 100.0% <100.0%> (ø)
...t/low_level/execution_summary/execution_summary.rs 100.0% <100.0%> (ø)
..._summary/transaction_manifest_execution_summary.rs 100.0% <ø> (ø)
.../extensions/ManifestEncounteredComponentAddress.kt 100.0% <100.0%> (ø)

... and 3 files with indirect coverage changes

@sergiupuhalschi-rdx sergiupuhalschi-rdx self-assigned this Sep 11, 2024
Copy link
Contributor

@CyonAlexRDX CyonAlexRDX left a comment

Choose a reason for hiding this comment

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

Good job!

Missing sample values. Can you also Swift and Kotlinify this.

In Swift conform to Address protocol, see https://github.com/radixdlt/sargon/blob/main/apple/Sources/Sargon/Extensions/Swiftified/Address/AddressOfAccountOrPersona%2BSwiftified.swift

Copy link
Contributor

@CyonAlexRDX CyonAlexRDX left a comment

Choose a reason for hiding this comment

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

LGTM ! Good job

@@ -139,6 +139,13 @@ jobs:
steps:
- uses: RDXWorks-actions/checkout@main

- name: Remove old xcode versions
Copy link
Contributor

Choose a reason for hiding this comment

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

We can try this.

But it is possible this breaks test Swift - and possible it works for most runs but fails for some due to non determinism.

If we have troubles we can change so that Kotlin tests are run AFTER Swift tests:

Which can be done by using needs: test-Swift

@sergiupuhalschi-rdx sergiupuhalschi-rdx merged commit 752616f into main Sep 11, 2024
10 checks passed
@sergiupuhalschi-rdx sergiupuhalschi-rdx deleted the fix/locker-encountered-entities branch September 11, 2024 13:49
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.

4 participants