Skip to content

Commit

Permalink
Revert "tests: use 'sender' in state tests if present (ethereum#28023)"
Browse files Browse the repository at this point in the history
This reverts commit bf49356.
  • Loading branch information
devopsbo3 authored Nov 10, 2023
1 parent 0524514 commit d9b1eb1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
6 changes: 0 additions & 6 deletions tests/gen_sttransaction.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions tests/state_test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ type stTransaction struct {
GasLimit []uint64 `json:"gasLimit"`
Value []string `json:"value"`
PrivateKey []byte `json:"secretKey"`
Sender *common.Address `json:"sender"`
BlobVersionedHashes []common.Hash `json:"blobVersionedHashes,omitempty"`
BlobGasFeeCap *big.Int `json:"maxFeePerBlobGas,omitempty"`
}
Expand Down Expand Up @@ -360,12 +359,9 @@ func (t *StateTest) genesis(config *params.ChainConfig) *core.Genesis {
}

func (tx *stTransaction) toMessage(ps stPostState, baseFee *big.Int) (*core.Message, error) {
// Derive sender from private key if present.
var from common.Address
// If 'sender' field is present, use that
if tx.Sender != nil {
from = *tx.Sender
} else if len(tx.PrivateKey) > 0 {
// Derive sender from private key if needed.
if len(tx.PrivateKey) > 0 {
key, err := crypto.ToECDSA(tx.PrivateKey)
if err != nil {
return nil, fmt.Errorf("invalid private key: %v", err)
Expand Down

0 comments on commit d9b1eb1

Please sign in to comment.