mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-23 15:20:54 +00:00
Add Scale to SingleAssetVault (#5652)
* Add and Scale to VaultCreate * Add round-trip calculation to VaultDeposit VaultWithdraw and VaultClawback * Implement Number::truncate() for VaultClawback * Add rounding to DepositWithdraw * Disallow zero shares withdraw or deposit with tecPRECISION_LOSS * Return tecPATH_DRY on overflow when converting shares/assets * Remove empty shares MPToken in clawback or withdraw (except for vault owner) * Implicitly create shares MPToken for vault owner in VaultCreate * Review feedback: defensive checks in shares/assets calculations --------- Co-authored-by: Ed Hennis <ed@ripple.com>
This commit is contained in:
@@ -86,6 +86,14 @@ Account::Account(AcctStringType stringType, std::string base58SeedStr)
|
||||
{
|
||||
}
|
||||
|
||||
Account::Account(std::string name, AccountID const& id)
|
||||
: Account(name, randomKeyPair(KeyType::secp256k1), privateCtorTag{})
|
||||
{
|
||||
// override the randomly generated values
|
||||
id_ = id;
|
||||
human_ = toBase58(id_);
|
||||
}
|
||||
|
||||
IOU
|
||||
Account::operator[](std::string const& s) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user