Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1165f63
bump to protocol v10
MonsieurNicolas Nov 27, 2017
03174c9
added "exists" method to testAccount
MonsieurNicolas Jan 30, 2018
44bd9e7
removed obsolete calls to setCurrentLedgerVersion in txEnvelopeTests
MonsieurNicolas Jan 30, 2018
534caf7
move tests for bound checking into their own sections
MonsieurNicolas Jan 30, 2018
10179d6
Move to new meta format
MonsieurNicolas Jan 30, 2018
69dda2e
Process sequence number during apply
MonsieurNicolas Jan 30, 2018
f879d41
reworked herder test to be a bit more representative of what is going on
MonsieurNicolas Jan 30, 2018
2e67acb
reworked logic for testing transactions (applyCheck)
MonsieurNicolas Jan 30, 2018
e82be46
Add the BumpSequence Operation & Tests
JeremyRubin Sep 22, 2017
7e5e2a0
Fix to make BumpSequence target the source
JeremyRubin Sep 22, 2017
805c759
small refactors, load account instead of direct access
JeremyRubin Sep 23, 2017
7506448
Refactor to use native tx_NOACCOUNT error
JeremyRubin Sep 25, 2017
d2d7871
updated Visual Studio project with BumpSeq files
MonsieurNicolas Mar 20, 2018
cbd8d6f
clang-format & renamed BUMP_SEQ -> BUMP_SEQUENCE
MonsieurNicolas Feb 1, 2018
e5a7110
updated BumpSequence to be compliant with specification dated 13-Oct-…
MonsieurNicolas Feb 1, 2018
7a15050
introduce opNOT_SUPPORTED when operations are not supported (yet/anym…
MonsieurNicolas Feb 3, 2018
e9ed4c5
remove BUMP_SEQUENCE_NOT_SUPPORTED_YET, use operation level failure i…
MonsieurNicolas Feb 3, 2018
1f05651
added safeConvertToSigned utility function
MonsieurNicolas Feb 5, 2018
1082eb0
make it safe for sequence numbers to use the entire uint64 space
MonsieurNicolas Feb 5, 2018
4fe0945
update BumpSequence to allow bumping through the entire uint64 space
MonsieurNicolas Feb 5, 2018
6257cb2
make AccountMerge fail when the current sequence number is too far
MonsieurNicolas Feb 5, 2018
474ece9
added tests for sequence number overflow
MonsieurNicolas Feb 5, 2018
d7a12fd
added missing merge test (signers)
MonsieurNicolas Feb 6, 2018
f9f9187
make SequenceNumber a signed integer (BumpSeq proposal 08-Feb-2018)
MonsieurNicolas Feb 9, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove BUMP_SEQUENCE_NOT_SUPPORTED_YET, use operation level failure i…
…nstead
  • Loading branch information
MonsieurNicolas committed Mar 20, 2018
commit e9ed4c5cd2aabf1577e0db60fb4718dfc3e47b20
2 changes: 0 additions & 2 deletions src/test/TestExceptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,6 @@ throwIf(BumpSequenceResult const& result)
break;
case BUMP_SEQUENCE_TOO_FAR:
throw ex_BUMP_SEQUENCE_TOO_FAR{};
case BUMP_SEQUENCE_NOT_SUPPORTED_YET:
throw ex_BUMP_SEQUENCE_NOT_SUPPORTED_YET{};
default:
throw ex_UNKNOWN{};
}
Expand Down
1 change: 0 additions & 1 deletion src/test/TestExceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ TEST_EXCEPTION(ex_ALLOW_TRUST_CANT_REVOKE)
TEST_EXCEPTION(ex_ALLOW_TRUST_SELF_NOT_ALLOWED)

TEST_EXCEPTION(ex_BUMP_SEQUENCE_TOO_FAR)
TEST_EXCEPTION(ex_BUMP_SEQUENCE_NOT_SUPPORTED_YET)

TEST_EXCEPTION(ex_CREATE_ACCOUNT_MALFORMED)
TEST_EXCEPTION(ex_CREATE_ACCOUNT_UNDERFUNDED)
Expand Down
16 changes: 6 additions & 10 deletions src/transactions/BumpSequenceOpFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ BumpSequenceOpFrame::getThresholdLevel() const
return ThresholdLevel::LOW;
}

bool
BumpSequenceOpFrame::isVersionSupported(uint32_t protocolVersion) const
{
return protocolVersion >= 10;
}

bool
BumpSequenceOpFrame::doApply(Application& app, LedgerDelta& delta,
LedgerManager& ledgerManager)
Expand Down Expand Up @@ -62,16 +68,6 @@ BumpSequenceOpFrame::doApply(Application& app, LedgerDelta& delta,
bool
BumpSequenceOpFrame::doCheckValid(Application& app)
{
if (app.getLedgerManager().getCurrentLedgerVersion() <= 9)
{
app.getMetrics()
.NewMeter({"op-bump-sequence", "failure", "not-supported-yet"},
"operation")
.Mark();
innerResult().code(BUMP_SEQUENCE_NOT_SUPPORTED_YET);
return false;
}

return true;
}
}
2 changes: 2 additions & 0 deletions src/transactions/BumpSequenceOpFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace stellar
class BumpSequenceOpFrame : public OperationFrame
{
ThresholdLevel getThresholdLevel() const override;
bool isVersionSupported(uint32_t protocolVersion) const override;

BumpSequenceResult&
innerResult()
{
Expand Down
3 changes: 1 addition & 2 deletions src/transactions/BumpSequenceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ TEST_CASE("bump sequence", "[tx][bumpsequence]")
}
});
for_versions_to(9, *app, [&]() {
REQUIRE_THROWS_AS(a.bumpSequence(maxSeqNum),
ex_BUMP_SEQUENCE_NOT_SUPPORTED_YET);
REQUIRE_THROWS_AS(a.bumpSequence(maxSeqNum), ex_opNOT_SUPPORTED);
});
}
5 changes: 2 additions & 3 deletions src/xdr/Stellar-transaction.x
Original file line number Diff line number Diff line change
Expand Up @@ -672,9 +672,8 @@ enum BumpSequenceResultCode
// codes considered as "success" for the operation
BUMP_SEQUENCE_SUCCESS = 0,
// codes considered as "failure" for the operation
BUMP_SEQUENCE_TOO_FAR = -1, // operation would bump past the maximum sequence number allowed
BUMP_SEQUENCE_NOT_SUPPORTED_YET =
-2 // The network hasn't moved to this protocol change yet
BUMP_SEQUENCE_TOO_FAR =
-1 // operation would bump past the maximum sequence number allowed
};

union BumpSequenceResult switch (BumpSequenceResultCode code)
Expand Down