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

[WIP] Add tx list request and response #5

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

drbh
Copy link

@drbh drbh commented Jul 13, 2019

I was hoping to get a better understanding of the project and the flow to add new features. Got stuck on the serialization of the response items. Once I fully understand how to parse these responses there are a few other features I would like to help add! Can we get this PR resolved and the responses serialized correctly?!

Changes

  1. example account to 82258967750773ea090d125f9aeb9b9e42f6c7ff6df0742336992bfc52b4096a since it was causing the example app to panic.
  2. Added GetTransactionList and used the existing Request Item types.
  3. Added to the tx.go file to support Transaction Lists

Help Needed

With FromTransactionListBlob not exactly sure how to serialize the response. Also with FromTransactionListResourceBlob

@drbh drbh changed the title Add tx list request and response [WIP] Add tx list request and response Jul 13, 2019
@philippgille
Copy link
Owner

philippgille commented Jul 14, 2019

Thanks for the PR already!

I don't have time to look at the code right now, maybe next week.

The CI build failed because of the linter. See https://travis-ci.org/philippgille/libra-sdk-go/builds/558352696#L631

Regarding the decoding you may find some inspiration here:

And could you please change the target branch from master to develop? Thanks!

@drbh drbh changed the base branch from master to develop July 22, 2019 23:47
@drbh
Copy link
Author

drbh commented Jul 22, 2019

Hey @philippgille,

I've made some good progress on pulling the TX list. Heres what a single transaction from a transaction list looks like

[
{
    "raw_bytes": "0x0a20000000000000000000000000000000000000000000000000000000000000000028904e38bfecb8e9051af4010abf014c49425241564d0a010007014a000000060000000350000000060000000c56000000050000000d5b00000004000000055f0000003300000004920000002000000007b20000000d000000000000010002000300010400020002040203020402063c53454c463e0c4c696272614163636f756e74094c69627261436f696e046d61696e0f6d696e745f746f5f6164647265737300000000000000000000000000000000000000000000000000000000000000000001020004000c000c01110102122408011220f7d5da0c23abd8a7d33fbf200ed9f5a25329020cfecb7d2375f7447b22940354120a120800e1f50500000000",
    "sender_pub_key": "0x4bd5f14227c3c3dfcb74454fb31005dac5631522552b30ac0edae67cc8abe405",
    "sender_sig": "0xd328f8b34c610cd19d57b1916fefefa0fd280744d1f789b610cafe7283a784e537992469cb3043287f4b8f11a26cf7dd9cfcb550301383108d6be78d1fe25300"
}]

I think the raw_bytes need to be decoded as you noted above - if you could help me get started that would be awesome! otherwise I'll take a stab at it next chance I get 👍

// Transaction is a transaction of Libra Coins.
type Transaction struct {
RawBytes []byte
SenderPubKey []byte
SenderSig []byte
}

// TransactionList
type TransactionList struct {
Copy link
Owner

Choose a reason for hiding this comment

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

An extra type for a transaction list that only contains a slice of transactions is not necessary I think.

@philippgille
Copy link
Owner

Great to see you're still working on it!

Did you check out the TypeScript SDK I linked to in the previous comment for clues regarding the decoding? I didn't check it in detail yet, maybe I can have a more thorough look soon.

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