-
Notifications
You must be signed in to change notification settings - Fork 127
server,eth: add method for account balance retrieval #1284
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
Conversation
There was a problem hiding this 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.
Needs resolve after txData PR merged. Might as well squash down with a final commit too. |
3c5355f
to
a5d605d
Compare
// 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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
a5d605d
to
05b8d97
Compare
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
, andCoinLocker
.