From c1adbaf631fa0f0a9e239a6c57f2a0666ad1afe2 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Sun, 3 Jun 2012 19:44:29 -0700 Subject: [PATCH] Define transaction formats for PasswordFund and PasswordSet. --- src/LedgerFormats.h | 8 ++++++-- src/TransactionFormats.cpp | 17 +++++++++++++++++ src/TransactionFormats.h | 6 ++++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/LedgerFormats.h b/src/LedgerFormats.h index d1a18ea4b0..d90d0114d8 100644 --- a/src/LedgerFormats.h +++ b/src/LedgerFormats.h @@ -32,8 +32,12 @@ enum LedgerNameSpace enum LedgerSpecificFlags { - lsfLowIndexed = 0x00010000, - lsfHighIndexed = 0x00020000, + // ltRIPPLE_STATE + lsfLowIndexed = 0x00010000, + lsfHighIndexed = 0x00020000, + + // ltACCOUNT_ROOT + lsfPasswordSpent = 0x00010000, // True if password set fee is spent. }; struct LedgerEntryFormat diff --git a/src/TransactionFormats.cpp b/src/TransactionFormats.cpp index 09f95d226b..66995e5a92 100644 --- a/src/TransactionFormats.cpp +++ b/src/TransactionFormats.cpp @@ -55,6 +55,23 @@ TransactionFormat InnerTxnFormats[]= { S_FIELD(Extensions), STI_TL, SOE_IFFLAG, 0x02000000 }, { sfInvalid, NULL, STI_DONE, SOE_NEVER, -1 } } }, + { "PasswordFund", ttPASSWORD_FUND, { + { S_FIELD(Flags), STI_UINT32, SOE_FLAGS, 0 }, + { S_FIELD(Destination), STI_ACCOUNT, SOE_REQUIRED, 0 }, + { S_FIELD(SourceTag), STI_UINT32, SOE_IFFLAG, 1 }, + { S_FIELD(Extensions), STI_TL, SOE_IFFLAG, 0x02000000 }, + { sfInvalid, NULL, STI_DONE, SOE_NEVER, -1 } } + }, + { "PasswordSet", ttPASSWORD_SET, { + { S_FIELD(Flags), STI_UINT32, SOE_FLAGS, 0 }, + { S_FIELD(AuthorizedKey), STI_ACCOUNT, SOE_REQUIRED, 0 }, + { S_FIELD(Generator), STI_VL, SOE_REQUIRED, 0 }, + { S_FIELD(PubKey), STI_VL, SOE_REQUIRED, 0 }, + { S_FIELD(Signature), STI_VL, SOE_REQUIRED, 0 }, + { S_FIELD(SourceTag), STI_UINT32, SOE_IFFLAG, 1 }, + { S_FIELD(Extensions), STI_TL, SOE_IFFLAG, 0x02000000 }, + { sfInvalid, NULL, STI_DONE, SOE_NEVER, -1 } } + }, { "Payment", ttPAYMENT, { { S_FIELD(Flags), STI_UINT32, SOE_FLAGS, 0 }, { S_FIELD(Destination), STI_ACCOUNT, SOE_REQUIRED, 0 }, diff --git a/src/TransactionFormats.h b/src/TransactionFormats.h index f8e8a34ed2..6833560696 100644 --- a/src/TransactionFormats.h +++ b/src/TransactionFormats.h @@ -10,10 +10,12 @@ enum TransactionType ttCLAIM = 1, ttWALLET_ADD = 2, ttACCOUNT_SET = 3, - ttINVOICE = 4, - ttOFFER = 5, + ttPASSWORD_FUND = 4, + ttPASSWORD_SET = 5, ttCREDIT_SET = 20, ttTRANSIT_SET = 21, + ttINVOICE = 10, + ttOFFER = 11, }; struct TransactionFormat