Skip to content

ethclient: move TransactionOpts to avoid import internal package;#2736

Merged
zzzckck merged 2 commits intobnb-chain:developfrom
galaio:fix_ethclient_import
Oct 11, 2024
Merged

ethclient: move TransactionOpts to avoid import internal package;#2736
zzzckck merged 2 commits intobnb-chain:developfrom
galaio:fix_ethclient_import

Conversation

@galaio
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

buddh0 commented Oct 11, 2024

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

@galaio
Copy link
Copy Markdown
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
@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