/// Defines automatic repayment types
enum class credit_deal_auto_repayment_type
{
/// Do not repay automatically
no_auto_repayment = 0,
/// Automatically repay fully when and only when the account balance is sufficient
only_full_repayment = 1,
/// Automatically repay as much as possible using available account balance
allow_partial_repayment = 2,
/// Total number of available automatic repayment types
CDAR_TYPE_COUNT = 3
};
Update type of extensions field of credit_offer_accept_operation struct, add an auto_repay field inside, so that accounts can decide whether and how to automatically repay when accepting a credit offer
struct credit_offer_accept_operation : public base_operation
{
struct ext
{
/// After the core-2595 hard fork, the account can specify whether and how to automatically repay
fc::optional<uint8_t> auto_repay;
};
asset fee; ///< Operation fee
account_id_type borrower; ///< The account who accepts the offer
credit_offer_id_type offer_id; ///< ID of the credit offer
asset borrow_amount; ///< The amount to borrow
asset collateral; ///< The collateral
uint32_t max_fee_rate = 0; ///< The maximum acceptable fee rate
uint32_t min_duration_seconds = 0; ///< The minimum acceptable duration
extension<ext> extensions; ///< Extensions
};
New operation: credit_deal_update_operation, so that credit deal owners can change whether or how to automatically repay
operation_type = 76
default fee 1 BTS
struct credit_deal_update_operation : public base_operation
{
struct fee_params_t { uint64_t fee = 1 * GRAPHENE_BLOCKCHAIN_PRECISION; };
asset fee; ///< Operation fee
account_id_type account; ///< The account who owns the credit deal
credit_deal_id_type deal_id; ///< ID of the credit deal
uint8_t auto_repay; ///< The specified automatic repayment type
extensions_type extensions; ///< Unused. Reserved for future use.
};
PR for #2595.
Changes:
Add
enum class credit_deal_auto_repayment_type
Update type of
extensions
field ofcredit_offer_accept_operation
struct, add anauto_repay
field inside, so that accounts can decide whether and how to automatically repay when accepting a credit offerNew operation:
credit_deal_update_operation
, so that credit deal owners can change whether or how to automatically repayoperation_type
=76
default fee
1 BTS
Rename all
fee_parameters_type
in the codebase tofee_params_t
to get around the "string table overflow" issue in MinGW build