From c05d4fb5590398ad39781d13771dd4413de70554 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Fri, 21 Dec 2012 17:05:31 -0800 Subject: [PATCH] Clean up - Ledger breaking changes. --- src/cpp/ripple/LedgerFormats.cpp | 2 +- src/cpp/ripple/SerializeProto.h | 2 +- src/cpp/ripple/TransactionFormats.h | 5 ++--- src/js/remote.js | 3 +-- test/offer-test.js | 4 ++-- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/cpp/ripple/LedgerFormats.cpp b/src/cpp/ripple/LedgerFormats.cpp index ae443179c9..2b9f01e80c 100644 --- a/src/cpp/ripple/LedgerFormats.cpp +++ b/src/cpp/ripple/LedgerFormats.cpp @@ -19,6 +19,7 @@ static bool LEFInit() << SOElement(sfAccount, SOE_REQUIRED) << SOElement(sfSequence, SOE_REQUIRED) << SOElement(sfBalance, SOE_REQUIRED) + << SOElement(sfOwnerCount, SOE_REQUIRED) << SOElement(sfPreviousTxnID, SOE_REQUIRED) << SOElement(sfPreviousTxnLgrSeq, SOE_REQUIRED) << SOElement(sfRegularKey, SOE_OPTIONAL) @@ -28,7 +29,6 @@ static bool LEFInit() << SOElement(sfMessageKey, SOE_OPTIONAL) << SOElement(sfTransferRate, SOE_OPTIONAL) << SOElement(sfDomain, SOE_OPTIONAL) - << SOElement(sfOwnerCount, SOE_OPTIONAL) ; DECLARE_LEF(Contract, ltCONTRACT) diff --git a/src/cpp/ripple/SerializeProto.h b/src/cpp/ripple/SerializeProto.h index e536f9d199..6b3d661150 100644 --- a/src/cpp/ripple/SerializeProto.h +++ b/src/cpp/ripple/SerializeProto.h @@ -43,7 +43,7 @@ FIELD(Expiration, UINT32, 10) FIELD(TransferRate, UINT32, 11) FIELD(WalletSize, UINT32, 12) - FIELD(OwnerCount, UINT32, 13) // Reorder on ledger reset. + FIELD(OwnerCount, UINT32, 13) // 32-bit integers (uncommon) FIELD(HighQualityIn, UINT32, 16) diff --git a/src/cpp/ripple/TransactionFormats.h b/src/cpp/ripple/TransactionFormats.h index 602b1fb3e9..6af1a74d96 100644 --- a/src/cpp/ripple/TransactionFormats.h +++ b/src/cpp/ripple/TransactionFormats.h @@ -62,11 +62,10 @@ const int TransactionMaxLen = 1048576; const uint32 tfPassive = 0x00010000; const uint32 tfOfferCreateMask = ~(tfPassive); -// Payment flags: (renumber on ledger wipe) -const uint32 tfPaymentLegacy = 0x00010000; // Left here to avoid ledger change. +// Payment flags: +const uint32 tfNoRippleDirect = 0x00010000; const uint32 tfPartialPayment = 0x00020000; const uint32 tfLimitQuality = 0x00040000; -const uint32 tfNoRippleDirect = 0x00080000; const uint32 tfPaymentMask = ~(tfPartialPayment|tfLimitQuality|tfNoRippleDirect); diff --git a/src/js/remote.js b/src/js/remote.js index 97ae40939f..eaca506514 100644 --- a/src/js/remote.js +++ b/src/js/remote.js @@ -267,10 +267,9 @@ Remote.flags = { }, 'Payment' : { - 'PaymentLegacy' : 0x00010000, + 'NoRippleDirect' : 0x00010000, 'PartialPayment' : 0x00020000, 'LimitQuality' : 0x00040000, - 'NoRippleDirect' : 0x00080000, }, }; diff --git a/test/offer-test.js b/test/offer-test.js index 8cb0332863..3716fc9c6f 100644 --- a/test/offer-test.js +++ b/test/offer-test.js @@ -346,9 +346,9 @@ buster.testCase("Offer tests", { testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob", "mtgox"], callback); }, function (callback) { - self.what = "Owner count undefined."; + self.what = "Owner count 0."; - testutils.verify_owner_count(self.remote, "bob", undefined, callback); + testutils.verify_owner_count(self.remote, "bob", 0, callback); }, function (callback) { self.what = "Set limits.";