mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
make checks more strict
This commit is contained in:
parent
b5c2db7368
commit
3503dde3c7
2 changed files with 11 additions and 6 deletions
|
|
@ -470,7 +470,7 @@ func (s *PersonalAccountAPI) SendTransaction(ctx context.Context, args Transacti
|
|||
s.nonceLock.LockAddr(args.from())
|
||||
defer s.nonceLock.UnlockAddr(args.from())
|
||||
}
|
||||
if args.BlobVersionedHashes != nil {
|
||||
if args.IsEIP4844() {
|
||||
return common.Hash{}, errBlobTxNotSupported
|
||||
}
|
||||
signed, err := s.signTransaction(ctx, &args, passwd)
|
||||
|
|
@ -498,8 +498,8 @@ func (s *PersonalAccountAPI) SignTransaction(ctx context.Context, args Transacti
|
|||
if args.GasPrice == nil && (args.MaxFeePerGas == nil || args.MaxPriorityFeePerGas == nil) {
|
||||
return nil, errors.New("missing gasPrice or maxFeePerGas/maxPriorityFeePerGas")
|
||||
}
|
||||
if args.BlobVersionedHashes != nil && args.MaxFeePerBlobGas == nil {
|
||||
return nil, errors.New("missing maxFeePerBlobGas")
|
||||
if args.IsEIP4844() && (args.BlobVersionedHashes == nil || args.MaxFeePerBlobGas == nil) {
|
||||
return nil, errors.New("missing maxFeePerBlobGas or blobVersionedHashes")
|
||||
}
|
||||
if args.Nonce == nil {
|
||||
return nil, errors.New("nonce not specified")
|
||||
|
|
@ -1819,7 +1819,7 @@ func (s *TransactionAPI) SendTransaction(ctx context.Context, args TransactionAr
|
|||
s.nonceLock.LockAddr(args.from())
|
||||
defer s.nonceLock.UnlockAddr(args.from())
|
||||
}
|
||||
if args.BlobVersionedHashes != nil {
|
||||
if args.IsEIP4844() {
|
||||
return common.Hash{}, errBlobTxNotSupported
|
||||
}
|
||||
|
||||
|
|
@ -1906,8 +1906,8 @@ func (s *TransactionAPI) SignTransaction(ctx context.Context, args TransactionAr
|
|||
if args.GasPrice == nil && (args.MaxPriorityFeePerGas == nil || args.MaxFeePerGas == nil) {
|
||||
return nil, errors.New("missing gasPrice or maxFeePerGas/maxPriorityFeePerGas")
|
||||
}
|
||||
if args.BlobVersionedHashes != nil && args.MaxFeePerBlobGas == nil {
|
||||
return nil, errors.New("missing maxFeePerBlobGas")
|
||||
if args.IsEIP4844() && (args.BlobVersionedHashes == nil || args.MaxFeePerBlobGas == nil) {
|
||||
return nil, errors.New("missing maxFeePerBlobGas or blobVersionedHashes")
|
||||
}
|
||||
if args.Nonce == nil {
|
||||
return nil, errors.New("nonce not specified")
|
||||
|
|
|
|||
|
|
@ -408,3 +408,8 @@ func (args *TransactionArgs) toTransaction() *types.Transaction {
|
|||
func (args *TransactionArgs) ToTransaction() *types.Transaction {
|
||||
return args.toTransaction()
|
||||
}
|
||||
|
||||
// IsEIP4844 returns an indicator if the args contains EIP4844 fields.
|
||||
func (args *TransactionArgs) IsEIP4844() bool {
|
||||
return args.BlobVersionedHashes != nil || args.MaxFeePerBlobGas != nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue