-
Notifications
You must be signed in to change notification settings - Fork 1.1k
BumpSequence #1533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BumpSequence #1533
Changes from 1 commit
1165f63
03174c9
44bd9e7
534caf7
10179d6
69dda2e
f879d41
2e67acb
e82be46
7e5e2a0
805c759
7506448
d2d7871
cbd8d6f
e5a7110
7a15050
e9ed4c5
1f05651
1082eb0
4fe0945
6257cb2
474ece9
d7a12fd
f9f9187
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,10 +48,10 @@ TEST_CASE("bump sequence", "[tx][bumpsequence]") | |
| } | ||
| SECTION("large bump") | ||
| { | ||
| auto newSeq = UINT64_MAX; | ||
| auto newSeq = INT64_MAX; | ||
| a.bumpSequence(newSeq); | ||
| REQUIRE(a.loadSequenceNumber() == newSeq); | ||
| SECTION("no more tx when UINT64_MAX is reached") | ||
| SECTION("no more tx when INT64_MAX is reached") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so this is second way to lock account, next to setting master weight to 0, nice!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no it doesn't lock the account, it just cannot be used as source account for a transaction |
||
| { | ||
| REQUIRE_THROWS_AS(a.pay(root, 1), ex_txBAD_SEQ); | ||
| } | ||
|
|
@@ -63,6 +63,12 @@ TEST_CASE("bump sequence", "[tx][bumpsequence]") | |
| // tx consumes sequence, bumpSequence doesn't do anything | ||
| REQUIRE(a.loadSequenceNumber() == oldSeq + 1); | ||
| } | ||
| SECTION("bad seq") | ||
| { | ||
| REQUIRE_THROWS_AS(a.bumpSequence(-1), ex_BUMP_SEQUENCE_BAD_SEQ); | ||
| REQUIRE_THROWS_AS(a.bumpSequence(INT64_MIN), | ||
| ex_BUMP_SEQUENCE_BAD_SEQ); | ||
| } | ||
| }); | ||
| } | ||
| SECTION("not supported") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bumping to 0 is OK (always no-op)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 is a valid sequence number, so yes