Skip to content

Conversation

buck54321
Copy link
Member

The interfaces are going to need to diverge when it comes to tracking funding ability. This PR is a first thrust at a reasonable interface scheme so that we can begin work in Swapper, Market, and CoinLocker.

Copy link
Member

@JoeGruffins JoeGruffins left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me. Please add meaningful commit messages.

@chappjc
Copy link
Member

chappjc commented Nov 13, 2021

Needs resolve after txData PR merged. Might as well squash down with a final commit too.

// accountBalance gets the account balance, including the effects of known
// unmined transactions.
func (c *rpcclient) accountBalance(ctx context.Context, addr common.Address) (*big.Int, error) {
bigBal, err := c.ec.PendingBalanceAt(ctx, addr)
Copy link
Member

@chappjc chappjc Nov 15, 2021

Choose a reason for hiding this comment

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

I wonder how this works with multiple txns in txpool with the same nonce, e.g. replacements commonly used to either cancel a txn or speed up a txn

Copy link
Member

@JoeGruffins JoeGruffins Nov 17, 2021

Choose a reason for hiding this comment

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

cancel a txn

How would that work? Like maybe send it to yourself instead? Or I guess could put the amount to zero?

Copy link
Member

@chappjc chappjc Nov 17, 2021

Choose a reason for hiding this comment

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

Exactly, a 0 ETH transaction to yourself with the same nonce as the txn to be canceled but higher fees. At least that's how I've seen it on etherscan.

Moves FundingCoin and VerifyUnspentCoin to a new interface called
OutputTracker. A different interface called AccountBalancer will
be used for eth and other "account-based" assets.
@chappjc chappjc added this to the 0.5 milestone Nov 28, 2021
@chappjc chappjc changed the title eth: add method for account balance retrieval server,eth: add method for account balance retrieval Nov 29, 2021
@chappjc chappjc merged commit 6cf3b83 into decred:master Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants