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

Submit binary transaction endpoint #78

Closed
lrettig opened this issue Jun 22, 2020 · 2 comments · Fixed by #79
Closed

Submit binary transaction endpoint #78

lrettig opened this issue Jun 22, 2020 · 2 comments · Fixed by #79
Assignees
Milestone

Comments

@lrettig
Copy link
Member

lrettig commented Jun 22, 2020

We don't currently have one of these. The TxService.SubmitTransaction endpoint accepts a Transaction type which is structured and does not contain binary data (aside from the signature):

message Transaction {
TransactionId id = 1;
oneof data {
CoinTransferTransaction coin_transfer = 2;
SmartContractTransaction smart_contract = 3;
}
AccountId sender = 4; // tx originator, should match signer inside Signature
GasOffered gas_offered = 5; // gas price and max gas offered
Amount amount = 6; // amount of coin transfered in this tx by sender
uint64 counter = 7; // tx counter aka nonce
Signature signature = 8; // sender signature on transaction
}

Per spacemeshos/SMIPS#23 it looks like we need an endpoint to receive signed, binary tx data. Note that the existing, old API does contain an endpoint that does this (SubmitTransaction).

CC @avive

@avive
Copy link
Contributor

avive commented Jun 23, 2020

I think that this is just an oversight on our part that we should correct. TxService.SubmitTransaction() should accept a byte[] and clients are expected to pass an XDR encoded transaction which includes the signature. Clients need to generate this blob based on the transactions syntax spec - similar to how Smapp and CLIwallet do this today.

@avive avive self-assigned this Jun 24, 2020
@avive
Copy link
Contributor

avive commented Jul 25, 2020

We will need to update all transactions related api methods to support the new sm tx format - this is part of the reason I'm pushing for a spec via the smip asap.

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 a pull request may close this issue.

2 participants