diff --git a/src/ripple/protocol/KnownFormats.h b/src/ripple/protocol/KnownFormats.h index b59742259a..00fadbf907 100644 --- a/src/ripple/protocol/KnownFormats.h +++ b/src/ripple/protocol/KnownFormats.h @@ -188,6 +188,21 @@ class KnownFormats return item; } + Item const& + addAlias(char const* name, KeyType type) + { + auto const item = findByType(type); + if (!item) + { + LogicError( + std::string("Unknown type for item '") + name + + "': " + std::to_string(type)); + } + + names_[name] = item; + return *item; + } + private: std::string name_; diff --git a/src/ripple/protocol/impl/TxFormats.cpp b/src/ripple/protocol/impl/TxFormats.cpp index efcb44752d..52c80bbe70 100644 --- a/src/ripple/protocol/impl/TxFormats.cpp +++ b/src/ripple/protocol/impl/TxFormats.cpp @@ -102,6 +102,8 @@ TxFormats::TxFormats() }, commonFields); + addAlias(jss::RegularKeySet, ttREGULAR_KEY_SET); + add(jss::Payment, ttPAYMENT, { @@ -326,6 +328,8 @@ TxFormats::TxFormats() }, commonFields); + addAlias(jss::HookSet, ttHOOK_SET); + add(jss::ClaimReward, ttCLAIM_REWARD, { @@ -465,6 +469,8 @@ TxFormats::TxFormats() }, commonFields); + addAlias(jss::RemarksSet, ttREMARKS_SET); + add(jss::Clawback, ttCLAWBACK, { diff --git a/src/ripple/protocol/jss.h b/src/ripple/protocol/jss.h index 5cba9fb3cb..b28fa57170 100644 --- a/src/ripple/protocol/jss.h +++ b/src/ripple/protocol/jss.h @@ -121,6 +121,8 @@ JSS(Payment); // transaction type. JSS(PaymentChannelClaim); // transaction type. JSS(PaymentChannelCreate); // transaction type. JSS(PaymentChannelFund); // transaction type. +JSS(RegularKeySet); // transaction type. +JSS(RemarksSet); // transaction type. JSS(Remit); // transaction type. JSS(RippleState); // ledger type. JSS(SLE_hit_rate); // out: GetCounts. @@ -135,6 +137,7 @@ JSS(SetFlag); // field. JSS(SetRegularKey); // transaction type. JSS(SetHook); // transaction type. JSS(Hook); // ledger type. +JSS(HookSet); // transaction type. JSS(HookDefinition); // ledger type. JSS(HookState); // ledger type. JSS(HookStateData); // field.