Skip to content

Commit

Permalink
fixup fields
Browse files Browse the repository at this point in the history
  • Loading branch information
thejohnfreeman committed Oct 11, 2024
1 parent 145b978 commit 3d043a9
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 100 deletions.
6 changes: 6 additions & 0 deletions include/xrpl/protocol/detail/transactions.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
#error "undefined macro: TRANSACTION"
#endif

/**
* TRANSACTION(tag, value, name, fields)
*
* You must define a transactor class in the `ripple` namespace named `name`.
*/

/** This transaction type executes a payment. */
TRANSACTION(ttPAYMENT, 0, Payment, ({
{sfDestination, soeREQUIRED},
Expand Down
2 changes: 2 additions & 0 deletions src/xrpld/app/tx/detail/CancelCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class CancelCheck : public Transactor
doApply() override;
};

using CheckCancel = CancelCheck;

} // namespace ripple

#endif
2 changes: 2 additions & 0 deletions src/xrpld/app/tx/detail/CancelOffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class CancelOffer : public Transactor
doApply() override;
};

using OfferCancel = CancelOffer;

} // namespace ripple

#endif
2 changes: 2 additions & 0 deletions src/xrpld/app/tx/detail/CashCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class CashCheck : public Transactor
doApply() override;
};

using CheckCash = CashCheck;

} // namespace ripple

#endif
4 changes: 4 additions & 0 deletions src/xrpld/app/tx/detail/Change.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ class Change : public Transactor
applyUNLModify();
};

using EnableAmendment = Change;
using SetFee = Change;
using UNLModify = Change;

} // namespace ripple

#endif
2 changes: 2 additions & 0 deletions src/xrpld/app/tx/detail/CreateCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class CreateCheck : public Transactor
doApply() override;
};

using CheckCreate = CreateCheck;

} // namespace ripple

#endif
2 changes: 2 additions & 0 deletions src/xrpld/app/tx/detail/CreateOffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ class CreateOffer : public Transactor
OfferStream::StepCounter stepCounter_;
};

using OfferCreate = CreateOffer;

} // namespace ripple

#endif
2 changes: 2 additions & 0 deletions src/xrpld/app/tx/detail/CreateTicket.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ class CreateTicket : public Transactor
doApply() override;
};

using TicketCreate = CreateTicket;

} // namespace ripple

#endif
2 changes: 2 additions & 0 deletions src/xrpld/app/tx/detail/DeleteAccount.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class DeleteAccount : public Transactor
doApply() override;
};

using AccountDelete = DeleteAccount;

} // namespace ripple

#endif
2 changes: 2 additions & 0 deletions src/xrpld/app/tx/detail/DeleteOracle.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class DeleteOracle : public Transactor
beast::Journal j);
};

using OracleDelete = DeleteOracle;

} // namespace ripple

#endif // RIPPLE_TX_DELETEORACLE_H_INCLUDED
6 changes: 6 additions & 0 deletions src/xrpld/app/tx/detail/PayChan.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class PayChanCreate : public Transactor
doApply() override;
};

using PaymentChannelCreate = PayChanCreate;

//------------------------------------------------------------------------------

class PayChanFund : public Transactor
Expand All @@ -67,6 +69,8 @@ class PayChanFund : public Transactor
doApply() override;
};

using PaymentChannelFund = PayChanFund;

//------------------------------------------------------------------------------

class PayChanClaim : public Transactor
Expand All @@ -85,6 +89,8 @@ class PayChanClaim : public Transactor
doApply() override;
};

using PaymentChannelClaim = PayChanClaim;

} // namespace ripple

#endif
2 changes: 2 additions & 0 deletions src/xrpld/app/tx/detail/SetAccount.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class SetAccount : public Transactor
doApply() override;
};

using AccountSet = SetAccount;

} // namespace ripple

#endif
2 changes: 2 additions & 0 deletions src/xrpld/app/tx/detail/SetOracle.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class SetOracle : public Transactor
doApply() override;
};

using OracleSet = SetOracle;

} // namespace ripple

#endif // RIPPLE_TX_SETORACLE_H_INCLUDED
2 changes: 2 additions & 0 deletions src/xrpld/app/tx/detail/SetSignerList.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ class SetSignerList : public Transactor
const;
};

using SignerListSet = SetSignerList;

} // namespace ripple

#endif
2 changes: 2 additions & 0 deletions src/xrpld/app/tx/detail/SetTrust.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class SetTrust : public Transactor
doApply() override;
};

using TrustSet = SetTrust;

} // namespace ripple

#endif
5 changes: 5 additions & 0 deletions src/xrpld/app/tx/detail/XChainBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ class BridgeModify : public Transactor
TER
doApply() override;
};

using XChainModifyBridge = BridgeModify;

//------------------------------------------------------------------------------

// Claim funds from a `XChainCommit` transaction. This is normally not needed,
Expand Down Expand Up @@ -248,6 +251,8 @@ class XChainCreateAccountCommit : public Transactor
doApply() override;
};

using XChainAccountCreateCommit = XChainCreateAccountCommit;

//------------------------------------------------------------------------------

} // namespace ripple
Expand Down
113 changes: 13 additions & 100 deletions src/xrpld/app/tx/detail/applySteps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include <xrpld/app/tx/detail/SetRegularKey.h>
#include <xrpld/app/tx/detail/SetSignerList.h>
#include <xrpld/app/tx/detail/SetTrust.h>
#include <xrpld/app/tx/detail/VaultSet.h>
#include <xrpld/app/tx/detail/XChainBridge.h>
#include <xrpl/protocol/TxFormats.h>

Expand All @@ -80,106 +81,18 @@ with_txn_type(TxType txnType, F&& f)
{
switch (txnType)
{
case ttACCOUNT_DELETE:
return f.template operator()<DeleteAccount>();
case ttACCOUNT_SET:
return f.template operator()<SetAccount>();
case ttCHECK_CANCEL:
return f.template operator()<CancelCheck>();
case ttCHECK_CASH:
return f.template operator()<CashCheck>();
case ttCHECK_CREATE:
return f.template operator()<CreateCheck>();
case ttDEPOSIT_PREAUTH:
return f.template operator()<DepositPreauth>();
case ttOFFER_CANCEL:
return f.template operator()<CancelOffer>();
case ttOFFER_CREATE:
return f.template operator()<CreateOffer>();
case ttESCROW_CREATE:
return f.template operator()<EscrowCreate>();
case ttESCROW_FINISH:
return f.template operator()<EscrowFinish>();
case ttESCROW_CANCEL:
return f.template operator()<EscrowCancel>();
case ttLEDGER_STATE_FIX:
return f.template operator()<LedgerStateFix>();
case ttPAYCHAN_CLAIM:
return f.template operator()<PayChanClaim>();
case ttPAYCHAN_CREATE:
return f.template operator()<PayChanCreate>();
case ttPAYCHAN_FUND:
return f.template operator()<PayChanFund>();
case ttPAYMENT:
return f.template operator()<Payment>();
case ttREGULAR_KEY_SET:
return f.template operator()<SetRegularKey>();
case ttSIGNER_LIST_SET:
return f.template operator()<SetSignerList>();
case ttTICKET_CREATE:
return f.template operator()<CreateTicket>();
case ttTRUST_SET:
return f.template operator()<SetTrust>();
case ttAMENDMENT:
case ttFEE:
case ttUNL_MODIFY:
return f.template operator()<Change>();
case ttNFTOKEN_MINT:
return f.template operator()<NFTokenMint>();
case ttNFTOKEN_BURN:
return f.template operator()<NFTokenBurn>();
case ttNFTOKEN_CREATE_OFFER:
return f.template operator()<NFTokenCreateOffer>();
case ttNFTOKEN_CANCEL_OFFER:
return f.template operator()<NFTokenCancelOffer>();
case ttNFTOKEN_ACCEPT_OFFER:
return f.template operator()<NFTokenAcceptOffer>();
case ttCLAWBACK:
return f.template operator()<Clawback>();
case ttAMM_CREATE:
return f.template operator()<AMMCreate>();
case ttAMM_DEPOSIT:
return f.template operator()<AMMDeposit>();
case ttAMM_WITHDRAW:
return f.template operator()<AMMWithdraw>();
case ttAMM_VOTE:
return f.template operator()<AMMVote>();
case ttAMM_BID:
return f.template operator()<AMMBid>();
case ttAMM_DELETE:
return f.template operator()<AMMDelete>();
case ttXCHAIN_CREATE_BRIDGE:
return f.template operator()<XChainCreateBridge>();
case ttXCHAIN_MODIFY_BRIDGE:
return f.template operator()<BridgeModify>();
case ttXCHAIN_CREATE_CLAIM_ID:
return f.template operator()<XChainCreateClaimID>();
case ttXCHAIN_COMMIT:
return f.template operator()<XChainCommit>();
case ttXCHAIN_CLAIM:
return f.template operator()<XChainClaim>();
case ttXCHAIN_ADD_CLAIM_ATTESTATION:
return f.template operator()<XChainAddClaimAttestation>();
case ttXCHAIN_ADD_ACCOUNT_CREATE_ATTESTATION:
return f.template operator()<XChainAddAccountCreateAttestation>();
case ttXCHAIN_ACCOUNT_CREATE_COMMIT:
return f.template operator()<XChainCreateAccountCommit>();
case ttDID_SET:
return f.template operator()<DIDSet>();
case ttDID_DELETE:
return f.template operator()<DIDDelete>();
case ttORACLE_SET:
return f.template operator()<SetOracle>();
case ttORACLE_DELETE:
return f.template operator()<DeleteOracle>();
case ttMPTOKEN_ISSUANCE_CREATE:
return f.template operator()<MPTokenIssuanceCreate>();
case ttMPTOKEN_ISSUANCE_DESTROY:
return f.template operator()<MPTokenIssuanceDestroy>();
case ttMPTOKEN_AUTHORIZE:
return f.template operator()<MPTokenAuthorize>();
case ttMPTOKEN_ISSUANCE_SET:
return f.template operator()<MPTokenIssuanceSet>();

#pragma push_macro("TRANSACTION")
#undef TRANSACTION

#define TRANSACTION(tag, value, name, fields) \
case tag: return f.template operator()<name>();

#include <xrpl/protocol/detail/transactions.m>

#undef TRANSACTION
#pragma pop_macro("TRANSACTION")

default:
throw UnknownTxnType(txnType);
}
Expand Down

0 comments on commit 3d043a9

Please sign in to comment.