This commit is contained in:
John Freeman
2024-11-11 20:28:31 -06:00
committed by Bronek Kozicki
parent ff8c6491d7
commit a8ec8e7eaa
2 changed files with 17 additions and 2 deletions

View File

@@ -346,6 +346,7 @@ enum TECcodes : TERUnderlyingType {
tecLOCKED = 192, tecLOCKED = 192,
tecBAD_CREDENTIALS = 193, tecBAD_CREDENTIALS = 193,
tecWRONG_ASSET = 194, tecWRONG_ASSET = 194,
tecLIMIT_EXCEEDED = 195,
}; };
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View File

@@ -21,6 +21,7 @@
#include <xrpld/ledger/View.h> #include <xrpld/ledger/View.h>
#include <xrpl/protocol/Feature.h> #include <xrpl/protocol/Feature.h>
#include <xrpl/protocol/LedgerFormats.h>
#include <xrpl/protocol/STNumber.h> #include <xrpl/protocol/STNumber.h>
#include <xrpl/protocol/TxFlags.h> #include <xrpl/protocol/TxFlags.h>
@@ -69,9 +70,22 @@ VaultDeposit::doApply()
return tecINSUFFICIENT_FUNDS; return tecINSUFFICIENT_FUNDS;
} }
// STAmount assetTotalNew{sfAssetTotal}; Number assetTotalNew = vault->at(sfAssetTotal) + amount;
// assetTotalNew = vault->at(sfAssetTotal) + amount; if (assetTotalNew > vault->at(sfAssetMaximum))
return tecLIMIT_EXCEEDED;
// TODO: Check credentials.
if (vault->getFlags() & lsfVaultPrivate);
// TODO: transfer amount from account_ to vault.PseudoAccount.
// - handles balance of account_ and vault.PseudoAccount
// TODO: increase vault.AssetTotal
// TODO: increase vault.AssetAvailable
// TODO: calculate shares to give account_.
// TODO: grant shares from issuance to account_.
// - handles increasing account_.balance(vault.Asset)
// - handles increasing mptIssuance.OutstandingAmount
// TODO: copy mptIssuance.OutstandingAmount to vault.ShareTotal?
return tesSUCCESS; return tesSUCCESS;
} }