This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
sdk/state: new state StateClosedWithOutdatedState #324
Merged
Merged
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1caa2a0
add new state, use mod to check state if closed prematurely, unit test
acharb b87e7c6
lint
acharb cbcd541
move seq mod check to txbuild package
acharb c1426f1
add test
acharb d5e1329
add a transaction type for all possible seq num values
acharb 0b1d1df
add panic
acharb 84a3348
name change
acharb 486ff4c
Merge branch 'main' into acharb-ingestclose
acharb f3ad59f
make easier to read
acharb 78d5e63
Merge branch 'acharb-ingestclose' of github.com:stellar/experimental-…
acharb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could you add some tests that demonstrate even and odd starting sequences, and then both tx types? 😄
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.
that's a good idea c1426f1
writing the test made me think that we should add a
TransactionTypeOpen
(if they're the same)also there's 1 unique case of the startingSequence + 1, which isn't a transaction type. Maybe we should add a type for that as well (it would be something like TransactionTypeNone)
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.
added them here
d5e1329
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.
I wonder if we can focus on the transaction types being for close agreements then, because I don't think we get much bang out of adding other types.
I wouldn't worry about adding the none case either, we don't sign txs with those sequence numbers. I'd just panic in that case, it's code that should never be hit.
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.
added the panic 0b1d1df
imo I think the
TransactionTypeFormation
makes sense, isn't used now but may save a bug down the line if someone means to get the formation tx seq and not the declaration tx seq 🤷up to you though I can remove if it's added code for no reason
edit: "if they meant to be referring to a formation tx and not a declaration tx" I mean