Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/ripple/protocol/KnownFormats.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;

Expand Down
6 changes: 6 additions & 0 deletions src/ripple/protocol/impl/TxFormats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ TxFormats::TxFormats()
},
commonFields);

addAlias(jss::RegularKeySet, ttREGULAR_KEY_SET);

add(jss::Payment,
ttPAYMENT,
{
Expand Down Expand Up @@ -326,6 +328,8 @@ TxFormats::TxFormats()
},
commonFields);

addAlias(jss::HookSet, ttHOOK_SET);

add(jss::ClaimReward,
ttCLAIM_REWARD,
{
Expand Down Expand Up @@ -465,6 +469,8 @@ TxFormats::TxFormats()
},
commonFields);

addAlias(jss::RemarksSet, ttREMARKS_SET);

add(jss::Clawback,
ttCLAWBACK,
{
Expand Down
3 changes: 3 additions & 0 deletions src/ripple/protocol/jss.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
Loading