-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
Sources/Profile/Entity/Account.swift
Outdated
public var depositRule: DepositRule | ||
|
||
/// Denies or allows third-party deposits of specific assets by ignoring the `depositMode` | ||
public var assetsExceptionList: OrderedDictionary<DepositAddress, DepositAddressExceptionRule> |
There was a problem hiding this comment.
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.
Sources/Profile/Entity/Account.swift
Outdated
@@ -169,3 +238,36 @@ extension Profile.Network.Account { | |||
""" | |||
} | |||
} | |||
|
|||
extension Profile.Network.Account.OnLedgerSettings.ThirdPartyDeposits.DepositAddress { |
There was a problem hiding this comment.
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
There was a problem hiding this 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", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add Third-Party deposits models to Profile