From 7e6406a484df066150a31e698155ec17b51fa781 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 19 Mar 2012 09:08:55 -0700 Subject: [PATCH] Move the table to the implementation. --- src/TransactionFormats.cpp | 46 ++++++++++++++++++++++++++++++++++++++ src/TransactionFormats.h | 44 +----------------------------------- 2 files changed, 47 insertions(+), 43 deletions(-) create mode 100644 src/TransactionFormats.cpp diff --git a/src/TransactionFormats.cpp b/src/TransactionFormats.cpp new file mode 100644 index 0000000000..0ad2982b7c --- /dev/null +++ b/src/TransactionFormats.cpp @@ -0,0 +1,46 @@ + +#include "TransactionFormats.h" + +TransactionFormat InnerTxnFormats[]= +{ + { "MakePayment", 0, { + { "Flags", STI_UINT16, SOE_FLAGS, 0 }, + { "Sequence", STI_UINT32, SOE_REQUIRED, 0 }, + { "Destination", STI_ACCOUNT, SOE_REQUIRED, 0 }, + { "Amount", STI_UINT64, SOE_REQUIRED, 0 }, + { "Currency", STI_HASH160, SOE_IFFLAG, 1 }, + { "SourceTag", STI_UINT32, SOE_IFFLAG, 2 }, + { "TargetLedger", STI_UINT32, SOE_IFFLAG, 4 }, + { "InvoiceID", STI_HASH256, SOE_IFFLAG, 8 }, + { "Extensions", STI_TL, SOE_IFFLAG, 32768 }, + { NULL, STI_DONE, SOE_NEVER, -1 } } + }, + { "Invoice", 1, { + { "Flags", STI_UINT16, SOE_FLAGS, 0 }, + { "Sequence", STI_UINT32, SOE_REQUIRED, 0 }, + { "Target", STI_ACCOUNT, SOE_REQUIRED, 0 }, + { "Amount", STI_UINT64, SOE_REQUIRED, 0 }, + { "Currency", STI_HASH160, SOE_IFFLAG, 1 }, + { "SourceTag", STI_UINT32, SOE_IFFLAG, 2 }, + { "Destination", STI_ACCOUNT, SOE_IFFLAG, 4 }, + { "TargetLedger", STI_UINT32, SOE_IFFLAG, 8 }, + { "Identifier", STI_VL, SOE_IFFLAG, 16 }, + { "Extensions", STI_TL, SOE_IFFLAG, 32768 }, + { NULL, STI_DONE, SOE_NEVER, -1 } } + }, + { "Offer", 2, { + { "Flags", STI_UINT16, SOE_FLAGS, 0 }, + { "Sequence", STI_UINT32, SOE_REQUIRED, 0 }, + { "AmountIn", STI_UINT64, SOE_REQUIRED, 0 }, + { "CurrencyIn", STI_HASH160, SOE_IFFLAG, 2 }, + { "AmountOut", STI_UINT64, SOE_REQUIRED, 0 }, + { "CurrencyOut", STI_HASH160, SOE_IFFLAG, 4 }, + { "SourceTag", STI_UINT32, SOE_IFFLAG, 8 }, + { "Destination", STI_ACCOUNT, SOE_IFFLAG, 16 }, + { "TargetLedger", STI_UINT32, SOE_IFFLAG, 32 }, + { "ExpireLedger", STI_UINT32, SOE_IFFLAG, 64 }, + { "Identifier", STI_VL, SOE_IFFLAG, 128 }, + { "Extensions", STI_TL, SOE_IFFLAG, 32768 }, + { NULL, STI_DONE, SOE_NEVER, -1 } } + } +}; diff --git a/src/TransactionFormats.h b/src/TransactionFormats.h index 3064178ad0..a0b06283da 100644 --- a/src/TransactionFormats.h +++ b/src/TransactionFormats.h @@ -12,48 +12,6 @@ struct TransactionFormat SOElement elements[16]; }; -TransactionFormat InnerTxnFormats[]= -{ - { "MakePayment", 0, { - { "Flags", STI_UINT16, SOE_FLAGS, 0 }, - { "Sequence", STI_UINT32, SOE_REQUIRED, 0 }, - { "Destination", STI_ACCOUNT, SOE_REQUIRED, 0 }, - { "Amount", STI_UINT64, SOE_REQUIRED, 0 }, - { "Currency", STI_HASH160, SOE_IFFLAG, 1 }, - { "SourceTag", STI_UINT32, SOE_IFFLAG, 2 }, - { "TargetLedger", STI_UINT32, SOE_IFFLAG, 4 }, - { "InvoiceID", STI_HASH256, SOE_IFFLAG, 8 }, - { "Extensions", STI_TL, SOE_IFFLAG, 32768 }, - { NULL, STI_DONE, SOE_NEVER, -1 } } - }, - { "Invoice", 1, { - { "Flags", STI_UINT16, SOE_FLAGS, 0 }, - { "Sequence", STI_UINT32, SOE_REQUIRED, 0 }, - { "Target", STI_ACCOUNT, SOE_REQUIRED, 0 }, - { "Amount", STI_UINT64, SOE_REQUIRED, 0 }, - { "Currency", STI_HASH160, SOE_IFFLAG, 1 }, - { "SourceTag", STI_UINT32, SOE_IFFLAG, 2 }, - { "Destination", STI_ACCOUNT, SOE_IFFLAG, 4 }, - { "TargetLedger", STI_UINT32, SOE_IFFLAG, 8 }, - { "Identifier", STI_VL, SOE_IFFLAG, 16 }, - { "Extensions", STI_TL, SOE_IFFLAG, 32768 }, - { NULL, STI_DONE, SOE_NEVER, -1 } } - }, - { "Offer", 2, { - { "Flags", STI_UINT16, SOE_FLAGS, 0 }, - { "Sequence", STI_UINT32, SOE_REQUIRED, 0 }, - { "AmountIn", STI_UINT64, SOE_REQUIRED, 0 }, - { "CurrencyIn", STI_HASH160, SOE_IFFLAG, 2 }, - { "AmountOut", STI_UINT64, SOE_REQUIRED, 0 }, - { "CurrencyOut", STI_HASH160, SOE_IFFLAG, 4 }, - { "SourceTag", STI_UINT32, SOE_IFFLAG, 8 }, - { "Destination", STI_ACCOUNT, SOE_IFFLAG, 16 }, - { "TargetLedger", STI_UINT32, SOE_IFFLAG, 32 }, - { "ExpireLedger", STI_UINT32, SOE_IFFLAG, 64 }, - { "Identifier", STI_VL, SOE_IFFLAG, 128 }, - { "Extensions", STI_TL, SOE_IFFLAG, 32768 }, - { NULL, STI_DONE, SOE_NEVER, -1 } } - } -}; +extern TransactionFormat InnerTxnFormats[]; #endif