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

Profile - Third-Party deposits #680

Merged
merged 4 commits into from
Aug 22, 2023
Merged

Conversation

GhenadieVP
Copy link
Contributor

Add Third-Party deposits models to Profile

public var depositRule: DepositRule

/// Denies or allows third-party deposits of specific assets by ignoring the `depositMode`
public var assetsExceptionList: OrderedDictionary<DepositAddress, DepositAddressExceptionRule>
Copy link
Contributor Author

@GhenadieVP GhenadieVP Aug 20, 2023

Choose a reason for hiding this comment

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

The main reason there is only one list modeled as dictionary, instead of having two list - allow and deny - is to make sure that an Address is either deny or allow.
Having two separate lists would require encapsulating the operations on those, to make sure that the Address is not in both lists.

@@ -169,3 +238,36 @@ extension Profile.Network.Account {
"""
}
}

extension Profile.Network.Account.OnLedgerSettings.ThirdPartyDeposits.DepositAddress {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Custom Encoding/Decodingr required for encoding/decoding NonFungibleGlobalID

@GhenadieVP GhenadieVP marked this pull request as ready for review August 20, 2023 07:06
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.

JSON format looks wrong?

{
"resourceAddress" : [ "resource_tdx_21_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxsmgder" ]
},
"allow",
Copy link
Contributor

@CyonAlexRDX CyonAlexRDX Aug 21, 2023

Choose a reason for hiding this comment

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

The JSON key looks wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually that is how a dictionary with object as a key is encoded. While this works, it is not ideal, reworked with my latest commit.

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

@GhenadieVP GhenadieVP merged commit 345bd1c into main Aug 22, 2023
5 checks passed
@GhenadieVP GhenadieVP deleted the third_party_deposits_profile branch August 22, 2023 12:50
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants