-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add ability to submit signatures without embedding them into txns #710
Add ability to submit signatures without embedding them into txns #710
Conversation
…diamondhands/SIMPLIFY-SUBMIT-TRANSACTION-FLOW
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.
Approved w/ some minor nits on error messages.
routes/transaction.go
Outdated
if requestData.UnsignedTransactionHex != "" { | ||
if requestData.TransactionSignatureHex == "" { | ||
_AddBadRequestError(ww, fmt.Sprintf("SubmitTransactionRequest: "+ | ||
"Must provide TransactionSignature when submitting UnsignedTransactionHex.")) |
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.
"Must provide TransactionSignature when submitting UnsignedTransactionHex.")) | |
"Must provide TransactionSignatureHex when submitting UnsignedTransactionHex.")) |
Just adding Hex
for clarity. If a developer receives this error, it'll be more clear what the param should be in the request body.
routes/transaction.go
Outdated
if len(requestData.UnsignedInnerTransactionsHex) > 0 && | ||
len(requestData.UnsignedInnerTransactionsHex) != len(requestData.TransactionSignaturesHex) { | ||
_AddBadRequestError(ww, fmt.Sprintf("SubmitAtomicTransaction: "+ | ||
"Number of UnsignedInnerTransactionsHex must match number of TransactionSignatures.")) |
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.
"Number of UnsignedInnerTransactionsHex must match number of TransactionSignatures.")) | |
"Number of UnsignedInnerTransactionsHex must match number of TransactionSignaturesHex.")) |
I'm updating the Openfund docs and working on a tutorial to enable algorithmic trading, and this change makes it possible to trivially sign transactions in languages that we don't support, such as Python, which I was using for the tutorial (most commonly used by traders).
This code is now fully tested by the amm-service, which I adapted to use the alternative pathways in a couple of tests. See this PR here:
https://github.com/deso-protocol/amm-service/pull/15