Move the table to the implementation.

This commit is contained in:
JoelKatz
2012-03-19 09:08:55 -07:00
parent a03076823b
commit 7e6406a484
2 changed files with 47 additions and 43 deletions

View File

@@ -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 } }
}
};

View File

@@ -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