-
Notifications
You must be signed in to change notification settings - Fork 499
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
txnbuild: function to verify sep10 challenge tx #1576
Conversation
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.
@poliha LGTM!
I think it could be useful to also validate the value of the manage_data operation, that is, after reading from the base64 string, it should be 48 bytes.
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.
This is mostly there, but needs some improvements.
txnbuild/transaction.go
Outdated
return verifyTxSignature(tx, serverAccountId) | ||
} | ||
|
||
// verifyTxSignature checks if a transaction has been signed by the provided stellar account. |
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.
stellar
-> Stellar
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.
looks great! Just one typo
txnbuild/transaction.go
Outdated
maxTime := currentTime.Add(timebound) | ||
txTimebound = NewTimebounds(currentTime.Unix(), maxTime.Unix()) | ||
if timebound == 0 { | ||
return "", errors.New("timebound can not be 0") |
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.
"cannot" is one word not two
This PR adds a function
VerifyChallengeTx
to the txnbuild package that verifies a SEP 10 challenge transaction according to the spec.This complements the
BuildChallengeTx
function which builds a challenge transaction.This PR closes #1530