Skip to content
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

Merged
merged 4 commits into from
Jan 15, 2025

Conversation

diamondhands0
Copy link
Member

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

@diamondhands0 diamondhands0 requested a review from a team as a code owner January 15, 2025 00:51
Copy link
Member

@lazynina lazynina left a 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.

if requestData.UnsignedTransactionHex != "" {
if requestData.TransactionSignatureHex == "" {
_AddBadRequestError(ww, fmt.Sprintf("SubmitTransactionRequest: "+
"Must provide TransactionSignature when submitting UnsignedTransactionHex."))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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.

if len(requestData.UnsignedInnerTransactionsHex) > 0 &&
len(requestData.UnsignedInnerTransactionsHex) != len(requestData.TransactionSignaturesHex) {
_AddBadRequestError(ww, fmt.Sprintf("SubmitAtomicTransaction: "+
"Number of UnsignedInnerTransactionsHex must match number of TransactionSignatures."))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Number of UnsignedInnerTransactionsHex must match number of TransactionSignatures."))
"Number of UnsignedInnerTransactionsHex must match number of TransactionSignaturesHex."))

@diamondhands0 diamondhands0 merged commit 8a00fd8 into main Jan 15, 2025
2 checks passed
@diamondhands0 diamondhands0 deleted the diamondhands/SIMPLIFY-SUBMIT-TRANSACTION-FLOW branch January 15, 2025 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants