mirror of
https://github.com/XRPLF/rippled.git
synced 2026-08-22 14:50:54 +00:00
add some more helper functions
This commit is contained in:
@@ -118,6 +118,18 @@ public:
|
||||
[[nodiscard]] TER
|
||||
canTransfer(AccountID const& from, AccountID const& to) const override;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// Token capability checks (MPT-specific)
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
[[nodiscard]] bool
|
||||
canClawback() const override;
|
||||
|
||||
[[nodiscard]] bool
|
||||
requiresAuth() const override;
|
||||
|
||||
STAmount
|
||||
accountHolds(
|
||||
AccountID const& account,
|
||||
|
||||
@@ -95,6 +95,18 @@ public:
|
||||
[[nodiscard]] TER
|
||||
canTransfer(AccountID const& from, AccountID const& to) const override;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// Token capability checks (IOU-specific)
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
[[nodiscard]] bool
|
||||
canClawback() const override;
|
||||
|
||||
[[nodiscard]] bool
|
||||
requiresAuth() const override;
|
||||
|
||||
protected:
|
||||
Issue const issue_;
|
||||
AccountID const issuer_;
|
||||
|
||||
@@ -140,6 +140,26 @@ public:
|
||||
[[nodiscard]] virtual TER
|
||||
canTransfer(AccountID const& from, AccountID const& to) const = 0;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// Token capability checks (Asset-based dispatchers)
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Check if the token issuer has enabled clawback capability.
|
||||
* For IOUs, checks lsfAllowTrustLineClawback on issuer's AccountRoot.
|
||||
* For MPTs, checks lsfMPTCanClawback on the issuance.
|
||||
*/
|
||||
[[nodiscard]] virtual bool
|
||||
canClawback() const = 0;
|
||||
|
||||
/** Check if the token requires authorization for holders.
|
||||
* For IOUs, checks lsfRequireAuth on issuer's AccountRoot.
|
||||
* For MPTs, checks lsfMPTRequireAuth on the issuance.
|
||||
*/
|
||||
[[nodiscard]] virtual bool
|
||||
requiresAuth() const = 0;
|
||||
|
||||
protected:
|
||||
TokenBase(ReadView const& view, std::shared_ptr<SLE const> sle) : ReadOnlySLE(sle, view)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user