Skip to content

Commit

Permalink
Merge branch 'develop' into c/eth-tests-logging
Browse files Browse the repository at this point in the history
  • Loading branch information
cabrador authored Oct 7, 2024
2 parents 05cfc02 + 938b2f3 commit 74826f3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
34 changes: 19 additions & 15 deletions ethtest/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ type stTransaction struct {
PrivateKey hexutil.Bytes `json:"secretKey"`
BlobGasFeeCap *BigInt `json:"maxFeePerBlobGas"`
BlobHashes []common.Hash `json:"blobVersionedHashes"`
Sender *common.Address `json:"sender"`
}

func (tx *stTransaction) toMessage(ps stPost, baseFee *BigInt) (*core.Message, error) {
// Derive sender from private key if present.
var from common.Address
if len(tx.PrivateKey) > 0 {
// 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.
key, err := crypto.ToECDSA(tx.PrivateKey)
if err != nil {
return nil, fmt.Errorf("invalid private key: %v", err)
Expand Down Expand Up @@ -118,19 +122,19 @@ func (tx *stTransaction) toMessage(ps stPost, baseFee *BigInt) (*core.Message, e
}

msg := &core.Message{
to,
from,
tx.Nonce.Uint64(),
value,
gasLimit.Uint64(),
gasPrice.Convert(),
tx.MaxFeePerGas.Convert(),
tx.MaxPriorityFeePerGas.Convert(),
data,
accessList,
tx.BlobGasFeeCap.Convert(),
tx.BlobHashes,
false,
To: to,
From: from,
Nonce: tx.Nonce.Uint64(),
Value: value,
GasLimit: gasLimit.Uint64(),
GasPrice: gasPrice.Convert(),
GasFeeCap: tx.MaxFeePerGas.Convert(),
GasTipCap: tx.MaxPriorityFeePerGas.Convert(),
Data: data,
AccessList: accessList,
BlobGasFeeCap: tx.BlobGasFeeCap.Convert(),
BlobHashes: tx.BlobHashes,
SkipAccountChecks: false,
}
return msg, nil
}
1 change: 1 addition & 0 deletions executor/transaction_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func MakeTxProcessor(cfg *utils.Config) (*TxProcessor, error) {
if evm == nil {
available := maps.Keys(tosca.GetAllRegisteredProcessorFactories())
available = append(available, "aida")
available = append(available, "aida-geth")
slices.Sort(available)
return nil, fmt.Errorf("unknown EVM implementation: %s, supported: %v", cfg.EvmImpl, available)
}
Expand Down

0 comments on commit 74826f3

Please sign in to comment.