mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
Merge c9bc896a58 into 12eabbd76d
This commit is contained in:
commit
121ea240de
2 changed files with 6 additions and 7 deletions
|
|
@ -1902,12 +1902,6 @@ func (api *TransactionAPI) SignTransaction(ctx context.Context, args Transaction
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// If the transaction-to-sign was a blob transaction, then the signed one
|
||||
// no longer retains the blobs, only the blob hashes. In this step, we need
|
||||
// to put back the blob(s).
|
||||
if args.IsEIP4844() {
|
||||
signed = signed.WithBlobTxSidecar(types.NewBlobTxSidecar(sidecarVersion, args.Blobs, args.Commitments, args.Proofs))
|
||||
}
|
||||
data, err := signed.MarshalBinary()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -2805,10 +2805,15 @@ func TestSignBlobTransaction(t *testing.T) {
|
|||
t.Fatalf("failed to fill tx defaults: %v\n", err)
|
||||
}
|
||||
|
||||
_, err = api.SignTransaction(context.Background(), argsFromTransaction(res.Tx, b.acc.Address))
|
||||
result, err := api.SignTransaction(context.Background(), argsFromTransaction(res.Tx, b.acc.Address))
|
||||
if err != nil {
|
||||
t.Fatalf("should not fail on blob transaction")
|
||||
}
|
||||
// When no blobs are provided (only blob hashes), the signed transaction
|
||||
// should not have an empty sidecar attached.
|
||||
if result.Tx.BlobTxSidecar() != nil {
|
||||
t.Fatal("signed transaction should not have a sidecar when no blobs were provided")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSendBlobTransaction(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue