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

ethclient: hex encode request args for TransactionInBlock #3505

Merged
merged 1 commit into from
Jan 4, 2017

Conversation

bas-vk
Copy link
Member

@bas-vk bas-vk commented Jan 3, 2017

The index arg for eth_getTransactionByBlockHashAndIndex is currently not hex encoded.

@mention-bot
Copy link

@bas-vk, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fjl and @karalabe to be potential reviewers.

fjl
fjl previously approved these changes Jan 3, 2017
@fjl fjl dismissed their stale review January 3, 2017 12:05

saw something

@@ -185,7 +185,7 @@ func (ec *Client) TransactionCount(ctx context.Context, blockHash common.Hash) (
// TransactionInBlock returns a single transaction at index in the given block.
func (ec *Client) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error) {
var tx *types.Transaction
err := ec.c.CallContext(ctx, &tx, "eth_getTransactionByBlockHashAndIndex", blockHash, index)
err := ec.c.CallContext(ctx, &tx, "eth_getTransactionByBlockHashAndIndex", blockHash, hexutil.EncodeUint64(uint64(index)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe just use hexutil.Uint(index) to save a conversion.

Copy link
Contributor

@fjl fjl left a comment

Choose a reason for hiding this comment

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

Good to merge, but note that hexutil.Uint is available for uint-sized integers.

Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

LGTM

@karalabe karalabe merged commit 1ca74ab into ethereum:master Jan 4, 2017
@obscuren obscuren removed the review label Jan 4, 2017
@karalabe karalabe added this to the 1.5.6 milestone Jan 4, 2017
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.

None yet

5 participants