cmd/clef, signer: support for eip-1559 txs in clef (#22966)

This commit is contained in:
Martin Holst Swende
2021-06-09 13:48:47 +02:00
committed by GitHub
parent c503f98f6d
commit 7a00378e2b
16 changed files with 177 additions and 58 deletions

View File

@ -73,6 +73,16 @@ func (db *Database) ValidateTransaction(selector *string, tx *core.SendTxArgs) (
if bytes.Equal(tx.To.Address().Bytes(), common.Address{}.Bytes()) {
messages.Crit("Transaction recipient is the zero address")
}
switch {
case tx.GasPrice == nil && tx.MaxFeePerGas == nil:
messages.Crit("Neither 'gasPrice' nor 'maxFeePerGas' specified.")
case tx.GasPrice == nil && tx.MaxPriorityFeePerGas == nil:
messages.Crit("Neither 'gasPrice' nor 'maxPriorityFeePerGas' specified.")
case tx.GasPrice != nil && tx.MaxFeePerGas != nil:
messages.Crit("Both 'gasPrice' and 'maxFeePerGas' specified.")
case tx.GasPrice != nil && tx.MaxPriorityFeePerGas != nil:
messages.Crit("Both 'gasPrice' and 'maxPriorityFeePerGas' specified.")
}
// Semantic fields validated, try to make heads or tails of the call data
db.ValidateCallData(selector, data, messages)
return messages, nil

View File

@ -60,7 +60,7 @@ func dummyTxArgs(t txtestcase) *core.SendTxArgs {
To: to,
Value: value,
Nonce: n,
GasPrice: gasPrice,
GasPrice: &gasPrice,
Gas: gas,
Data: data,
Input: input,