From 25b0559c891075a2efdabb5243fe7f7a48387f13 Mon Sep 17 00:00:00 2001 From: marta-lokhova Date: Tue, 9 Apr 2019 18:00:14 -0700 Subject: [PATCH] Change offerID to int64_t --- src/invariant/LedgerEntryIsValid.cpp | 5 ++- src/ledger/LedgerTxnOfferSQL.cpp | 20 +++++------ src/ledger/test/LedgerTxnTests.cpp | 34 +++++++++--------- src/test/TestAccount.cpp | 10 +++--- src/test/TestAccount.h | 10 +++--- src/test/TestMarket.cpp | 2 +- src/test/TestMarket.h | 6 ++-- src/test/TxTests.cpp | 21 ++++++----- src/test/TxTests.h | 36 +++++++++---------- src/transactions/ManageOfferOpFrameBase.cpp | 4 +-- src/transactions/ManageOfferOpFrameBase.h | 4 +-- src/transactions/OfferExchange.cpp | 4 +-- src/transactions/TransactionUtils.cpp | 2 +- src/transactions/TransactionUtils.h | 2 +- src/transactions/test/ManageBuyOfferTests.cpp | 6 ++-- src/transactions/test/OfferTests.cpp | 16 ++------- src/transactions/test/PathPaymentTests.cpp | 4 +-- src/xdr/Stellar-ledger-entries.x | 2 +- src/xdr/Stellar-ledger.x | 2 +- src/xdr/Stellar-transaction.x | 6 ++-- 20 files changed, 90 insertions(+), 106 deletions(-) diff --git a/src/invariant/LedgerEntryIsValid.cpp b/src/invariant/LedgerEntryIsValid.cpp index bb6188dc77..3d1a7a5cd6 100644 --- a/src/invariant/LedgerEntryIsValid.cpp +++ b/src/invariant/LedgerEntryIsValid.cpp @@ -184,10 +184,9 @@ LedgerEntryIsValid::checkIsValid(TrustLineEntry const& tl, uint32 version) const std::string LedgerEntryIsValid::checkIsValid(OfferEntry const& oe, uint32 version) const { - if (oe.offerID > INT64_MAX) + if (oe.offerID <= 0) { - return fmt::format("Offer offerID ({}) exceeds limit ({})", oe.offerID, - INT64_MAX); + return fmt::format("Offer offerID ({}) must be positive", oe.offerID); } if (!isAssetValid(oe.selling)) { diff --git a/src/ledger/LedgerTxnOfferSQL.cpp b/src/ledger/LedgerTxnOfferSQL.cpp index 8342b889c4..0edadcc3c0 100644 --- a/src/ledger/LedgerTxnOfferSQL.cpp +++ b/src/ledger/LedgerTxnOfferSQL.cpp @@ -19,8 +19,8 @@ namespace stellar std::shared_ptr LedgerTxnRoot::Impl::loadOffer(LedgerKey const& key) const { - uint64_t offerID = key.offer().offerID; - if (offerID > INT64_MAX) + int64_t offerID = key.offer().offerID; + if (offerID < 0) { return nullptr; } @@ -34,8 +34,7 @@ LedgerTxnRoot::Impl::loadOffer(LedgerKey const& key) const auto prep = mDatabase.getPreparedStatement(sql); auto& st = prep.statement(); st.exchange(soci::use(actIDStrKey)); - int64_t signedOfferID = unsignedToSigned(offerID); - st.exchange(soci::use(signedOfferID)); + st.exchange(soci::use(offerID)); std::vector offers; { @@ -43,9 +42,8 @@ LedgerTxnRoot::Impl::loadOffer(LedgerKey const& key) const offers = loadOffers(prep); } - return offers.size() == 0 - ? nullptr - : std::make_shared(offers.front()); + return offers.empty() ? nullptr + : std::make_shared(offers.front()); } std::vector @@ -582,14 +580,14 @@ class BulkLoadOffersOperation { Database& mDb; std::vector mOfferIDs; - std::unordered_map mSellerIDsByOfferID; + std::unordered_map mSellerIDsByOfferID; std::vector executeAndFetch(soci::statement& st) { std::string sellerID, sellingAsset, buyingAsset; int64_t amount; - uint64_t offerID; + int64_t offerID; uint32_t flags, lastModified; Price price; @@ -648,9 +646,9 @@ class BulkLoadOffersOperation for (auto const& k : keys) { assert(k.type() == OFFER); - if (k.offer().offerID <= INT64_MAX) + if (k.offer().offerID >= 0) { - mOfferIDs.emplace_back(unsignedToSigned(k.offer().offerID)); + mOfferIDs.emplace_back(k.offer().offerID); mSellerIDsByOfferID[mOfferIDs.back()] = k.offer().sellerID; } } diff --git a/src/ledger/test/LedgerTxnTests.cpp b/src/ledger/test/LedgerTxnTests.cpp index 4686349d14..803eef9cd0 100644 --- a/src/ledger/test/LedgerTxnTests.cpp +++ b/src/ledger/test/LedgerTxnTests.cpp @@ -1282,7 +1282,7 @@ TEST_CASE("LedgerTxn loadWithoutRecord", "[ledgerstate]") static void applyLedgerTxnUpdates( AbstractLedgerTxn& ltx, - std::map, + std::map, std::tuple> const& updates) { for (auto const& kv : updates) @@ -1318,13 +1318,13 @@ static void testAllOffers( AbstractLedgerTxnParent& ltxParent, std::map>> const& + std::vector>> const& expected, - std::vector, + std::vector, std::tuple>>::const_iterator begin, std::vector< - std::map, + std::map, std::tuple>>::const_iterator const& end) { REQUIRE(begin != end); @@ -1370,9 +1370,9 @@ testAllOffers( static void testAllOffers( std::map>> const& + std::vector>> const& expected, - std::vector, + std::vector, std::tuple>> const& updates) { REQUIRE(!updates.empty()); @@ -1547,7 +1547,7 @@ TEST_CASE("LedgerTxn loadAllOffers", "[ledgerstate]") static void applyLedgerTxnUpdates( AbstractLedgerTxn& ltx, - std::map, + std::map, std::tuple> const& updates) { for (auto const& kv : updates) @@ -1583,12 +1583,12 @@ static void testBestOffer( AbstractLedgerTxnParent& ltxParent, Asset const& buying, Asset const& selling, - std::vector> const& + std::vector> const& expected, - std::vector, + std::vector, std::tuple>>:: const_iterator begin, - std::vector, + std::vector, std::tuple>>:: const_iterator const& end) { @@ -1621,9 +1621,9 @@ testBestOffer( static void testBestOffer( Asset const& buying, Asset const& selling, - std::vector> const& + std::vector> const& expected, - std::vector, + std::vector, std::tuple>> updates) { @@ -1826,12 +1826,12 @@ static void testOffersByAccountAndAsset( AbstractLedgerTxnParent& ltxParent, AccountID const& accountID, Asset const& asset, - std::vector> const& expected, - std::vector, + std::vector> const& expected, + std::vector, std::tuple>>::const_iterator begin, std::vector< - std::map, + std::map, std::tuple>>::const_iterator const& end) { REQUIRE(begin != end); @@ -1864,8 +1864,8 @@ testOffersByAccountAndAsset( static void testOffersByAccountAndAsset( AccountID const& accountID, Asset const& asset, - std::vector> const& expected, - std::vector, + std::vector> const& expected, + std::vector, std::tuple>> updates) { diff --git a/src/test/TestAccount.cpp b/src/test/TestAccount.cpp index aa16744d31..b8bf0f79bd 100644 --- a/src/test/TestAccount.cpp +++ b/src/test/TestAccount.cpp @@ -213,8 +213,8 @@ TestAccount::bumpSequence(SequenceNumber to) applyTx(tx({txtest::bumpSequence(to)}), mApp, false); } -uint64_t -TestAccount::manageOffer(uint64_t offerID, Asset const& selling, +int64_t +TestAccount::manageOffer(int64_t offerID, Asset const& selling, Asset const& buying, Price const& price, int64_t amount, ManageOfferEffect expectedEffect) { @@ -223,8 +223,8 @@ TestAccount::manageOffer(uint64_t offerID, Asset const& selling, expectedEffect); } -uint64_t -TestAccount::manageBuyOffer(uint64_t offerID, Asset const& selling, +int64_t +TestAccount::manageBuyOffer(int64_t offerID, Asset const& selling, Asset const& buying, Price const& price, int64_t amount, ManageOfferEffect expectedEffect) { @@ -233,7 +233,7 @@ TestAccount::manageBuyOffer(uint64_t offerID, Asset const& selling, expectedEffect); } -uint64_t +int64_t TestAccount::createPassiveOffer(Asset const& selling, Asset const& buying, Price const& price, int64_t amount, ManageOfferEffect expectedEffect) diff --git a/src/test/TestAccount.h b/src/test/TestAccount.h index be1ffa5685..fe7dd509d5 100644 --- a/src/test/TestAccount.h +++ b/src/test/TestAccount.h @@ -53,17 +53,17 @@ class TestAccount void bumpSequence(SequenceNumber to); - uint64_t - manageOffer(uint64_t offerID, Asset const& selling, Asset const& buying, + int64_t + manageOffer(int64_t offerID, Asset const& selling, Asset const& buying, Price const& price, int64_t amount, ManageOfferEffect expectedEffect = MANAGE_OFFER_CREATED); - uint64_t - manageBuyOffer(uint64_t offerID, Asset const& selling, Asset const& buying, + int64_t + manageBuyOffer(int64_t offerID, Asset const& selling, Asset const& buying, Price const& price, int64_t amount, ManageOfferEffect expectedEffect = MANAGE_OFFER_CREATED); - uint64_t + int64_t createPassiveOffer(Asset const& selling, Asset const& buying, Price const& price, int64_t amount, ManageOfferEffect expectedEffect = MANAGE_OFFER_CREATED); diff --git a/src/test/TestMarket.cpp b/src/test/TestMarket.cpp index ef1e4e7e41..9f8e6c4aa2 100644 --- a/src/test/TestMarket.cpp +++ b/src/test/TestMarket.cpp @@ -117,7 +117,7 @@ TestMarket::addOffer(TestAccount& account, OfferState const& state, } TestMarketOffer -TestMarket::updateOffer(TestAccount& account, uint64_t id, +TestMarket::updateOffer(TestAccount& account, int64_t id, OfferState const& state, OfferState const& finishedState) { diff --git a/src/test/TestMarket.h b/src/test/TestMarket.h index 78372fca56..db286bee81 100644 --- a/src/test/TestMarket.h +++ b/src/test/TestMarket.h @@ -20,7 +20,7 @@ struct OfferEntry; struct OfferKey { AccountID sellerID; - uint64_t offerID; + int64_t offerID; friend bool operator<(OfferKey const& x, OfferKey const& y); }; @@ -96,7 +96,7 @@ class TestMarket OfferState const& finishedState = OfferState::SAME); TestMarketOffer - updateOffer(TestAccount& account, uint64_t id, OfferState const& state, + updateOffer(TestAccount& account, int64_t id, OfferState const& state, OfferState const& finishedState = OfferState::SAME); void requireChanges(std::vector const& changes, @@ -112,7 +112,7 @@ class TestMarket private: Application& mApp; std::map mOffers; - uint64_t mLastAddedID{0}; + int64_t mLastAddedID{0}; void checkState(std::map const& offers, std::vector const& deletedOffers); diff --git a/src/test/TxTests.cpp b/src/test/TxTests.cpp index 99a2c25e93..d4ae391777 100644 --- a/src/test/TxTests.cpp +++ b/src/test/TxTests.cpp @@ -557,7 +557,7 @@ createPassiveOffer(Asset const& selling, Asset const& buying, } Operation -manageOffer(uint64 offerId, Asset const& selling, Asset const& buying, +manageOffer(int64 offerId, Asset const& selling, Asset const& buying, Price const& price, int64_t amount) { Operation op; @@ -572,7 +572,7 @@ manageOffer(uint64 offerId, Asset const& selling, Asset const& buying, } Operation -manageBuyOffer(uint64 offerId, Asset const& selling, Asset const& buying, +manageBuyOffer(int64 offerId, Asset const& selling, Asset const& buying, Price const& price, int64_t amount) { Operation op; @@ -587,10 +587,9 @@ manageBuyOffer(uint64 offerId, Asset const& selling, Asset const& buying, } static ManageSellOfferResult -applyCreateOfferHelper(Application& app, uint64 offerId, - SecretKey const& source, Asset const& selling, - Asset const& buying, Price const& price, int64_t amount, - SequenceNumber seq) +applyCreateOfferHelper(Application& app, int64 offerId, SecretKey const& source, + Asset const& selling, Asset const& buying, + Price const& price, int64_t amount, SequenceNumber seq) { auto getIdPool = [&]() { LedgerTxn ltx(app.getLedgerTxnRoot()); @@ -654,8 +653,8 @@ applyCreateOfferHelper(Application& app, uint64 offerId, return manageSellOfferResult; } -uint64_t -applyManageOffer(Application& app, uint64 offerId, SecretKey const& source, +int64_t +applyManageOffer(Application& app, int64 offerId, SecretKey const& source, Asset const& selling, Asset const& buying, Price const& price, int64_t amount, SequenceNumber seq, ManageOfferEffect expectedEffect) @@ -669,8 +668,8 @@ applyManageOffer(Application& app, uint64 offerId, SecretKey const& source, : 0; } -uint64_t -applyManageBuyOffer(Application& app, uint64 offerId, SecretKey const& source, +int64_t +applyManageBuyOffer(Application& app, int64 offerId, SecretKey const& source, Asset const& selling, Asset const& buying, Price const& price, int64_t amount, SequenceNumber seq, ManageOfferEffect expectedEffect) @@ -736,7 +735,7 @@ applyManageBuyOffer(Application& app, uint64 offerId, SecretKey const& source, : 0; } -uint64_t +int64_t applyCreatePassiveOffer(Application& app, SecretKey const& source, Asset const& selling, Asset const& buying, Price const& price, int64_t amount, SequenceNumber seq, diff --git a/src/test/TxTests.h b/src/test/TxTests.h index 1047bcc9b6..b094a52636 100644 --- a/src/test/TxTests.h +++ b/src/test/TxTests.h @@ -126,9 +126,9 @@ Operation pathPayment(PublicKey const& to, Asset const& sendCur, int64_t sendMax, Asset const& destCur, int64_t destAmount, std::vector const& path); -Operation manageOffer(uint64 offerId, Asset const& selling, Asset const& buying, +Operation manageOffer(int64 offerId, Asset const& selling, Asset const& buying, Price const& price, int64_t amount); -Operation manageBuyOffer(uint64 offerId, Asset const& selling, +Operation manageBuyOffer(int64 offerId, Asset const& selling, Asset const& buying, Price const& price, int64_t amount); @@ -136,24 +136,24 @@ Operation createPassiveOffer(Asset const& selling, Asset const& buying, Price const& price, int64_t amount); // returns the ID of the new offer if created -uint64_t applyManageOffer(Application& app, uint64 offerId, - SecretKey const& source, Asset const& selling, - Asset const& buying, Price const& price, - int64_t amount, SequenceNumber seq, - ManageOfferEffect expectedEffect); - -uint64_t applyManageBuyOffer(Application& app, uint64 offerId, - SecretKey const& source, Asset const& selling, - Asset const& buying, Price const& price, - int64_t amount, SequenceNumber seq, - ManageOfferEffect expectedEffect); +int64_t applyManageOffer(Application& app, int64 offerId, + SecretKey const& source, Asset const& selling, + Asset const& buying, Price const& price, + int64_t amount, SequenceNumber seq, + ManageOfferEffect expectedEffect); + +int64_t applyManageBuyOffer(Application& app, int64 offerId, + SecretKey const& source, Asset const& selling, + Asset const& buying, Price const& price, + int64_t amount, SequenceNumber seq, + ManageOfferEffect expectedEffect); // returns the ID of the new offer if created -uint64_t applyCreatePassiveOffer(Application& app, SecretKey const& source, - Asset const& selling, Asset const& buying, - Price const& price, int64_t amount, - SequenceNumber seq, - ManageOfferEffect expectedEffect); +int64_t applyCreatePassiveOffer(Application& app, SecretKey const& source, + Asset const& selling, Asset const& buying, + Price const& price, int64_t amount, + SequenceNumber seq, + ManageOfferEffect expectedEffect); Operation setOptions(SetOptionsArguments const& arguments); SetOptionsArguments setMasterWeight(int master); diff --git a/src/transactions/ManageOfferOpFrameBase.cpp b/src/transactions/ManageOfferOpFrameBase.cpp index dad0cc18cb..cf5f7ee9c5 100644 --- a/src/transactions/ManageOfferOpFrameBase.cpp +++ b/src/transactions/ManageOfferOpFrameBase.cpp @@ -15,8 +15,8 @@ namespace stellar ManageOfferOpFrameBase::ManageOfferOpFrameBase( Operation const& op, OperationResult& res, TransactionFrame& parentTx, - Asset const& sheep, Asset const& wheat, uint64_t offerID, - Price const& price, bool setPassiveOnCreate) + Asset const& sheep, Asset const& wheat, int64_t offerID, Price const& price, + bool setPassiveOnCreate) : OperationFrame(op, res, parentTx) , mSheep(sheep) , mWheat(wheat) diff --git a/src/transactions/ManageOfferOpFrameBase.h b/src/transactions/ManageOfferOpFrameBase.h index 5a5590a04c..ca1f6a5cd2 100644 --- a/src/transactions/ManageOfferOpFrameBase.h +++ b/src/transactions/ManageOfferOpFrameBase.h @@ -15,7 +15,7 @@ class ManageOfferOpFrameBase : public OperationFrame { Asset const mSheep; Asset const mWheat; - uint64_t const mOfferID; + int64_t const mOfferID; Price const mPrice; bool const mSetPassiveOnCreate; @@ -32,7 +32,7 @@ class ManageOfferOpFrameBase : public OperationFrame public: ManageOfferOpFrameBase(Operation const& op, OperationResult& res, TransactionFrame& parentTx, Asset const& sheep, - Asset const& wheat, uint64_t offerID, + Asset const& wheat, int64_t offerID, Price const& price, bool setPassiveOnCreate); bool doCheckValid(uint32_t ledgerVersion) override; diff --git a/src/transactions/OfferExchange.cpp b/src/transactions/OfferExchange.cpp index 31fc71dd48..44f90e9bc6 100644 --- a/src/transactions/OfferExchange.cpp +++ b/src/transactions/OfferExchange.cpp @@ -860,7 +860,7 @@ crossOffer(AbstractLedgerTxn& ltx, LedgerTxnEntry& sellingWheatOffer, Asset sheep = offer.buying; Asset wheat = offer.selling; AccountID accountBID = offer.sellerID; - uint64_t offerID = offer.offerID; + int64_t offerID = offer.offerID; int64_t newAmount = offer.amount; { @@ -975,7 +975,7 @@ crossOfferV10(AbstractLedgerTxn& ltx, LedgerTxnEntry& sellingWheatOffer, Asset sheep = offer.buying; Asset wheat = offer.selling; AccountID accountBID = offer.sellerID; - uint64_t offerID = offer.offerID; + int64_t offerID = offer.offerID; if (!stellar::loadAccountWithoutRecord(ltx, accountBID)) { diff --git a/src/transactions/TransactionUtils.cpp b/src/transactions/TransactionUtils.cpp index f8112595a2..914b6248aa 100644 --- a/src/transactions/TransactionUtils.cpp +++ b/src/transactions/TransactionUtils.cpp @@ -42,7 +42,7 @@ loadData(AbstractLedgerTxn& ltx, AccountID const& accountID, } LedgerTxnEntry -loadOffer(AbstractLedgerTxn& ltx, AccountID const& sellerID, uint64_t offerID) +loadOffer(AbstractLedgerTxn& ltx, AccountID const& sellerID, int64_t offerID) { LedgerKey key(OFFER); key.offer().sellerID = sellerID; diff --git a/src/transactions/TransactionUtils.h b/src/transactions/TransactionUtils.h index 47006cfd8e..9c0392256c 100644 --- a/src/transactions/TransactionUtils.h +++ b/src/transactions/TransactionUtils.h @@ -25,7 +25,7 @@ LedgerTxnEntry loadData(AbstractLedgerTxn& ltx, AccountID const& accountID, std::string const& dataName); LedgerTxnEntry loadOffer(AbstractLedgerTxn& ltx, AccountID const& sellerID, - uint64_t offerID); + int64_t offerID); TrustLineWrapper loadTrustLine(AbstractLedgerTxn& ltx, AccountID const& accountID, Asset const& asset); diff --git a/src/transactions/test/ManageBuyOfferTests.cpp b/src/transactions/test/ManageBuyOfferTests.cpp index a66bcf739c..2ab388007b 100644 --- a/src/transactions/test/ManageBuyOfferTests.cpp +++ b/src/transactions/test/ManageBuyOfferTests.cpp @@ -464,7 +464,7 @@ TEST_CASE("manage buy offer matches manage sell offer when not executing", int64_t const availableBalance = 100; int64_t const availableLimit = 100; - auto checkOffer = [&](AccountID const& acc, uint64_t offerID, + auto checkOffer = [&](AccountID const& acc, int64_t offerID, Asset const& selling, Asset const& buying, Price const& price) { LedgerTxn ltx(app->getLedgerTxnRoot()); @@ -581,7 +581,7 @@ TEST_CASE("manage buy offer matches manage sell offer when executing partially", int64_t const availableLimit = 1000; int64_t const offerSizeInLedger = 50; - auto checkOffer = [&](AccountID const& acc, uint64_t offerID, + auto checkOffer = [&](AccountID const& acc, int64_t offerID, Asset const& selling, Asset const& buying, Price const& price) { LedgerTxn ltx(app->getLedgerTxnRoot()); @@ -721,7 +721,7 @@ TEST_CASE("manage buy offer matches manage sell offer when executing entirely", int64_t const availableBalance = 100; int64_t const availableLimit = 100; - auto checkOffer = [&](AccountID const& acc, uint64_t offerID, + auto checkOffer = [&](AccountID const& acc, int64_t offerID, Asset const& selling, Asset const& buying, Price const& price) { LedgerTxn ltx(app->getLedgerTxnRoot()); diff --git a/src/transactions/test/OfferTests.cpp b/src/transactions/test/OfferTests.cpp index 6ec7011c6a..63b7945ade 100644 --- a/src/transactions/test/OfferTests.cpp +++ b/src/transactions/test/OfferTests.cpp @@ -2829,13 +2829,7 @@ TEST_CASE("create offer", "[tx][offers]") {usd, idr, Price{1, 1}, 1}), ex_MANAGE_SELL_OFFER_NOT_FOUND); REQUIRE_THROWS_AS( - market.updateOffer(acc1, - static_cast(INT64_MAX) + 1, - {usd, idr, Price{1, 1}, 1}), - ex_MANAGE_SELL_OFFER_NOT_FOUND); - REQUIRE_THROWS_AS( - market.updateOffer(acc1, UINT64_MAX, - {usd, idr, Price{1, 1}, 1}), + market.updateOffer(acc1, -1, {usd, idr, Price{1, 1}, 1}), ex_MANAGE_SELL_OFFER_NOT_FOUND); }); } @@ -2858,13 +2852,7 @@ TEST_CASE("create offer", "[tx][offers]") {usd, idr, Price{1, 1}, 0}), ex_MANAGE_SELL_OFFER_NOT_FOUND); REQUIRE_THROWS_AS( - market.updateOffer(acc1, - static_cast(INT64_MAX) + 1, - {usd, idr, Price{1, 1}, 0}), - ex_MANAGE_SELL_OFFER_NOT_FOUND); - REQUIRE_THROWS_AS( - market.updateOffer(acc1, UINT64_MAX, - {usd, idr, Price{1, 1}, 0}), + market.updateOffer(acc1, -1, {usd, idr, Price{1, 1}, 0}), ex_MANAGE_SELL_OFFER_NOT_FOUND); }); } diff --git a/src/transactions/test/PathPaymentTests.cpp b/src/transactions/test/PathPaymentTests.cpp index 3a6c5b935e..245fc6b4c1 100644 --- a/src/transactions/test/PathPaymentTests.cpp +++ b/src/transactions/test/PathPaymentTests.cpp @@ -3931,7 +3931,7 @@ TEST_CASE("pathpayment", "[tx][pathpayment]") } }; auto validateOffer = [&](const TestAccount& account, - uint64_t offerId, int64_t difference) { + int64_t offerId, int64_t difference) { LedgerTxn ltx(app->getLedgerTxnRoot()); auto offer = stellar::loadOffer(ltx, account.getPublicKey(), offerId); @@ -3962,7 +3962,7 @@ TEST_CASE("pathpayment", "[tx][pathpayment]") int maxMultipler, bool overSendMax) { SECTION(name) { - auto offers = std::deque{}; + auto offers = std::deque{}; for (int i = 0; i < pathSize; i++) { offers.push_back( diff --git a/src/xdr/Stellar-ledger-entries.x b/src/xdr/Stellar-ledger-entries.x index e12e35e426..c26afffcea 100644 --- a/src/xdr/Stellar-ledger-entries.x +++ b/src/xdr/Stellar-ledger-entries.x @@ -210,7 +210,7 @@ const MASK_OFFERENTRY_FLAGS = 1; struct OfferEntry { AccountID sellerID; - uint64 offerID; + int64 offerID; Asset selling; // A Asset buying; // B int64 amount; // amount of A diff --git a/src/xdr/Stellar-ledger.x b/src/xdr/Stellar-ledger.x index 2750f21c08..798be12c71 100644 --- a/src/xdr/Stellar-ledger.x +++ b/src/xdr/Stellar-ledger.x @@ -120,7 +120,7 @@ case OFFER: struct { AccountID sellerID; - uint64 offerID; + int64 offerID; } offer; case DATA: diff --git a/src/xdr/Stellar-transaction.x b/src/xdr/Stellar-transaction.x index 2109086cf1..1590ae7b97 100644 --- a/src/xdr/Stellar-transaction.x +++ b/src/xdr/Stellar-transaction.x @@ -99,7 +99,7 @@ struct ManageSellOfferOp Price price; // price of thing being sold in terms of what you are buying // 0=create a new offer, otherwise edit an existing offer - uint64 offerID; + int64 offerID; }; /* Creates, updates or deletes an offer with amount in terms of buying asset @@ -118,7 +118,7 @@ struct ManageBuyOfferOp // selling // 0=create a new offer, otherwise edit an existing offer - uint64 offerID; + int64 offerID; }; /* Creates an offer that doesn't take offers of the same price @@ -386,7 +386,7 @@ struct ClaimOfferAtom { // emitted to identify the offer AccountID sellerID; // Account that owns the offer - uint64 offerID; + int64 offerID; // amount and asset taken from the owner Asset assetSold;