@@ -155,6 +155,12 @@ isFrozen(
155
155
MPTIssue const & mptIssue,
156
156
int depth = 0 );
157
157
158
+ /* *
159
+ * isFrozen check is recursive for MPT shares in a vault, descending to assets
160
+ * in the vault. These assets could be themselves MPT shares in another vault.
161
+ * For this reason we limit depth of check, up to maxAssetCheckDepth. If this
162
+ * depth is exceeded, we return true (i.e. the asset is considered frozen).
163
+ */
158
164
[[nodiscard]] inline bool
159
165
isFrozen (
160
166
ReadView const & view,
@@ -502,14 +508,19 @@ dirLink(ApplyView& view, AccountID const& owner, std::shared_ptr<SLE>& object);
502
508
AccountID
503
509
pseudoAccountAddress (ReadView const & view, uint256 const & pseudoOwnerKey);
504
510
505
- // Which of the owner-object fields should we set: sfAMMID, sfVaultID
506
- enum class PseudoAccountOwnerType : int { AMM, Vault };
507
-
511
+ /* *
512
+ *
513
+ * Create pseudo-account, storing pseudoOwnerKey into ownerField.
514
+ *
515
+ * The list of valid ownerField is maintained in View.cpp and the caller to
516
+ * this function must perform necessary amendment check(s) before using a
517
+ * field. The amendment check is **not** performed in createPseudoAccount.
518
+ */
508
519
[[nodiscard]] Expected<std::shared_ptr<SLE>, TER>
509
520
createPseudoAccount (
510
521
ApplyView& view,
511
522
uint256 const & pseudoOwnerKey,
512
- PseudoAccountOwnerType type );
523
+ SField const & ownerField );
513
524
514
525
// Returns true iff sleAcct is a pseudo-account.
515
526
//
@@ -691,12 +702,6 @@ transferXRP(
691
702
STAmount const & amount,
692
703
beast::Journal j);
693
704
694
- struct TokenDescriptor
695
- {
696
- std::shared_ptr<SLE const > token;
697
- std::shared_ptr<SLE const > issuance;
698
- };
699
-
700
705
/* * Check if the account lacks required authorization.
701
706
*
702
707
* Return tecNO_AUTH or tecNO_LINE if it does
@@ -711,6 +716,13 @@ requireAuth(ReadView const& view, Issue const& issue, AccountID const& account);
711
716
* from preclaim, the user should convert result tecEXPIRED to tesSUCCESS and
712
717
* proceed to also check permissions with enforceMPTokenAuthorization inside
713
718
* doApply. This will ensure that any expired credentials are deleted.
719
+ *
720
+ * requireAuth check is recursive for MPT shares in a vault, descending to
721
+ * assets in the vault. These assets could be themselves MPT shares in another
722
+ * vault. For this reason we limit depth of check, up to maxAssetCheckDepth.
723
+ * This function will return tecKILLED if maximum depth is exceeded.
724
+ * Transaction VaultCreate checks for tecKILLED to prevent such vaults being
725
+ * created.
714
726
*/
715
727
[[nodiscard]] TER
716
728
requireAuth (
@@ -728,7 +740,7 @@ requireAuth(
728
740
* in order for the transactor to proceed to doApply.
729
741
*
730
742
* This function will create MPToken (if needed) on the basis of any
731
- * non-expired credentals and will delete any expired credentials, indirectly
743
+ * non-expired credentials and will delete any expired credentials, indirectly
732
744
* via verifyValidDomain, as per DomainID (if set in MPTokenIssuance).
733
745
*
734
746
* The caller does NOT need to ensure that DomainID is actually set - this
0 commit comments