-
Notifications
You must be signed in to change notification settings - Fork 516
txnbuild: update challenge tx helpers for SEP-10 v1.3.0 #2071
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
7f8d793
txnbuild: update challenge tx helpers for sep-10 changes
leighmcculloch 1bd551f
feedback from @ire-and-curses
leighmcculloch 4fccf79
Merge branch 'master' into sep10prop
leighmcculloch ad17003
Add examples of using Horizon during verification
leighmcculloch c3a7169
Simplify the interface and make it easier to implement a check correctly
leighmcculloch 828d6ec
Make example comments clearer
leighmcculloch 3aacce3
Make the example more realistic by handling account not existing
leighmcculloch 2432aed
Reduce dupe code
leighmcculloch b051ebc
Improve comments
leighmcculloch ab75f08
Merge branch 'master' into sep10prop
leighmcculloch 3ca7923
Merge branch 'master' into sep10prop
leighmcculloch b419bad
add test
leighmcculloch 56097e4
update comments
leighmcculloch fe76f9e
Add clarifying comment to deprecated func
leighmcculloch 6492759
Add tests for VerifyChallengeTxThreshold
leighmcculloch 846e396
Add check that some signers are provided
leighmcculloch a83ffec
Merge branch 'master' into sep10prop
leighmcculloch f20703f
Remove dependency on clients/horizon
leighmcculloch b7bec9f
Remove addition of protocols/horizon dependency
leighmcculloch 731c0d4
Change how the signer data is copied from horizon to txnbuild
leighmcculloch d53c0b7
Fix the order of the signers that are outputted
leighmcculloch 0a9dbc8
Moved SignerSummary to its own file
leighmcculloch 99529e7
Fix bug in weight >= threshold check
leighmcculloch e2519cf
Fix tests failing due to slice ordering
leighmcculloch d3420d8
Fix test expectation
leighmcculloch 2a9e88d
Merge branch 'master' into sep10prop
leighmcculloch 330f692
Improve deprecated comment
leighmcculloch 30a4ef9
Restructured some of the challenge transaction verification process t…
leighmcculloch 3fedc4c
Remove unnecessary word in comment
leighmcculloch 916a4cf
More consistent variable names
leighmcculloch fb8198b
Preserve the order of client signers throughout the whole process
leighmcculloch 2a903e0
Add test proving duplicate signers in request are not included in errors
leighmcculloch 0914d38
Add tests to all functions to ensure server key missing will fail, an…
leighmcculloch a7e3838
More meaningful error message if signer is a seed
leighmcculloch 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
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.
As we discussed, I think this is a problem.
txnbuild
is a more basic library that is responsible for transactions. It doesn't know abouthorizonclient
.I do see the rationale as the similar but different nature of these signer structs is annoying.
One option would be to consider a third package that could hold helpers like this. Another reasonable compromise might be to put these helpers in horizonclient, as it already depends on txnbuild.
We should think again about a path forward to rationalise these structs.
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.
👍 Thanks for pointing this out, I forgot we discussed this last year. I'll remove this dependency.
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've changed it to only depend on horizon protocol, which you mentioned txnbuild is allowed to depend on. f20703f
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.
@ire-and-curses and I chatted about this offline and he said we need to keep horizon protocol out of the dependency list too. We agree the best way forward is to move these functions out to a new package
webauth
, but this is going to require sometime because it will require rewriting the existing verification code entirely.The rewrite is necessary because the code is dependent on txnbuild, and the only way to move it to a new package and maintain backwards compatibility by having the function here call the new function is to remove that dependency back on txnbuild. This is required because otherwise a circular dependency would occur.
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.
@ire-and-curses In b7bec9f and 731c0d4 I removed the horizon code and replaced it with no dependency on Horizon. I've changed the interface of the functions to accept a map of signers to weights and exported that same native data type in the horizon protocol package. We can pass data from one to the other without having an explicit dependency, and I think this is the best path forward. The data type I'm using is what we use in the XDR package for passing around a set of signers and weights (see this) Could you re-:eyes: and 👍 if you're happy?