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

client/dcr: Add rpc staking. #2316

Merged
merged 1 commit into from
Aug 16, 2023
Merged

Conversation

JoeGruffins
Copy link
Member

@JoeGruffins JoeGruffins commented Apr 20, 2023

part of #2264
depends on #2290

Adds a rpc consumer for ticket purchasing.

@JoeGruffins JoeGruffins changed the title Addharnessstaking client/dcr: Add rpc staking. Apr 20, 2023
@JoeGruffins JoeGruffins force-pushed the addharnessstaking branch 4 times, most recently from e8a76ec to 25a52a4 Compare August 8, 2023 12:15
@JoeGruffins JoeGruffins marked this pull request as ready for review August 8, 2023 12:15
client/core/core.go Outdated Show resolved Hide resolved
client/rpcserver/handlers.go Outdated Show resolved Hide resolved
client/rpcserver/handlers.go Outdated Show resolved Hide resolved
client/rpcserver/handlers.go Outdated Show resolved Hide resolved
client/rpcserver/handlers.go Outdated Show resolved Hide resolved
client/rpcserver/handlers.go Outdated Show resolved Hide resolved
client/rpcserver/handlers.go Outdated Show resolved Hide resolved
client/rpcserver/handlers.go Outdated Show resolved Hide resolved
client/rpcserver/handlers.go Outdated Show resolved Hide resolved
@JoeGruffins
Copy link
Member Author

JoeGruffins commented Aug 9, 2023

client/rpcserver/handlers.go Outdated Show resolved Hide resolved
client/core/core.go Outdated Show resolved Hide resolved
client/rpcserver/handlers.go Outdated Show resolved Hide resolved
client/rpcserver/handlers.go Outdated Show resolved Hide resolved
client/rpcserver/handlers.go Outdated Show resolved Hide resolved
@JoeGruffins JoeGruffins force-pushed the addharnessstaking branch 2 times, most recently from f4f9f02 to a465c48 Compare August 14, 2023 02:15
@JoeGruffins
Copy link
Member Author

@@ -912,26 +912,36 @@ func (w *rpcWallet) Tickets(ctx context.Context) ([]*asset.Ticket, error) {
w.log.Errorf("GetTransaction error for ticket %s: %v", h, err)
continue
}
blkHash, err := chainhash.NewHashFromStr(tx.BlockHash)
Copy link
Member

Choose a reason for hiding this comment

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

How would this work for unmined tickets? Or are all tickets guaranteed to be included in a block?

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe it errors and I saw this while testing with a block hash of all zeros....

Copy link
Member Author

Choose a reason for hiding this comment

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

Testing out on simnet, it seems vsp is only including mined tickets in the results. @buck54321 do we need confirming tickets for native wallets? Or we can ignore these here as well so they act the same. Probably we want the unconfirmed tickets in results...

Copy link
Member

Choose a reason for hiding this comment

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

I saw that too, but I figured we could follow up since it's not particular to RPC staking.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will set unmined block heights to -1 here and leave a TODO in the vsp wallet logic.

client/core/core.go Outdated Show resolved Hide resolved
@JoeGruffins
Copy link
Member Author

Fixed update balance logic and adding unmined tickets to rpc wallet stake status response. https://github.com/decred/dcrdex/compare/a465c48681aca261a21c62f62bf24575c9820227..ea84ec5eac9a56a29524596167db2d165a21b0c5

@JoeGruffins
Copy link
Member Author

JoeGruffins commented Aug 16, 2023

@buck54321 buck54321 merged commit 3c1aeb4 into decred:master Aug 16, 2023
5 checks passed
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.

3 participants