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: move TransactionOpts to avoid import internal package; #2736

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

galaio
Copy link
Contributor

@galaio galaio commented Oct 11, 2024

Description

This PR aims to fix the issue #2722, developer cannot use ethclient.SendTransactionConditional directly that is caused by a import error.

Changes

Notable changes:

  • ethclient: move TransactionOpts to avoid import internal package;
  • ...

const MaxNumberOfEntries = 1000

func (o *TransactionOpts) Check(blockNumber uint64, timeStamp uint64, statedb *state.StateDB) error {
func TxOptsCheck(o types.TransactionOpts, blockNumber uint64, timeStamp uint64, statedb *state.StateDB) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why these Check functions also not transferred to the transaction_options.go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, state.StateDB cannot transfer to low-level package types, so I leave these util functions here.

)

type AccountStorage struct {
StorageRoot *common.Hash
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
StorageRoot *common.Hash
StorageSlots map[common.Hash]*common.Hash

Why not just a pointer

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean I know that code was just moved but maybe we could improve it

@buddh0
Copy link
Collaborator

buddh0 commented Oct 11, 2024

TransactionOpts is only used by clients,
maybe including it into dir common is better than core

@galaio
Copy link
Contributor Author

galaio commented Oct 11, 2024

TransactionOpts is only used by clients, maybe including it into dir common is better than core

common is a very low-level package, TransactionOpts is related Transaction, so maybe core package is ok.

@zzzckck zzzckck merged commit 3a6dbe4 into bnb-chain:develop Oct 11, 2024
7 checks passed
@zzzckck zzzckck mentioned this pull request Nov 25, 2024
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.

5 participants