accounts, internal, signer: fix linter nits

This commit is contained in:
Martin Holst Swende 2024-03-09 10:04:22 +01:00
parent bcd9790781
commit 9c2bb339aa
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0
4 changed files with 10 additions and 12 deletions

View file

@ -245,7 +245,7 @@ func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transactio
args.Commitments = sidecar.Commitments
args.Proofs = sidecar.Proofs
}
var res signTransactionResult
if err := api.client.Call(&res, "account_signTransaction", args); err != nil {
return nil, err

View file

@ -1895,9 +1895,9 @@ func (s *TransactionAPI) SignTransaction(ctx context.Context, args TransactionAr
// to put back the blob(s).
if args.IsEIP4844() {
signed = signed.WithBlobTxSidecar(&types.BlobTxSidecar{
args.Blobs,
args.Commitments,
args.Proofs,
Blobs: args.Blobs,
Commitments: args.Commitments,
Proofs: args.Proofs,
})
}
data, err := signed.MarshalBinary()

View file

@ -18,6 +18,7 @@ package apitypes
import (
"bytes"
"crypto/sha256"
"encoding/json"
"errors"
"fmt"
@ -28,7 +29,6 @@ import (
"strconv"
"strings"
"crypto/sha256"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"

View file

@ -17,10 +17,10 @@
package apitypes
import (
"crypto/sha256"
"encoding/json"
"testing"
"crypto/sha256"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto/kzg4844"
@ -67,7 +67,6 @@ func TestTxArgs(t *testing.T) {
wantType: types.DynamicFeeTxType,
},
} {
var txArgs SendTxArgs
if err := json.Unmarshal(tc.data, &txArgs); err != nil {
t.Fatal(err)
@ -110,16 +109,16 @@ func TestTxArgs(t *testing.T) {
func TestBlobTxs(t *testing.T) {
blob := kzg4844.Blob{0x1}
committment, err := kzg4844.BlobToCommitment(blob)
commitment, err := kzg4844.BlobToCommitment(blob)
if err != nil {
t.Fatal(err)
}
proof, err := kzg4844.ComputeBlobProof(blob, committment)
proof, err := kzg4844.ComputeBlobProof(blob, commitment)
if err != nil {
t.Fatal(err)
}
hash := kzg4844.CalcBlobHashV1(sha256.New(), &committment)
hash := kzg4844.CalcBlobHashV1(sha256.New(), &commitment)
b := &types.BlobTx{
ChainID: uint256.NewInt(6),
Nonce: 8,
@ -131,7 +130,7 @@ func TestBlobTxs(t *testing.T) {
Value: uint256.NewInt(100),
Sidecar: &types.BlobTxSidecar{
Blobs: []kzg4844.Blob{blob},
Commitments: []kzg4844.Commitment{committment},
Commitments: []kzg4844.Commitment{commitment},
Proofs: []kzg4844.Proof{proof},
},
}
@ -141,5 +140,4 @@ func TestBlobTxs(t *testing.T) {
t.Fatal(err)
}
t.Logf("tx %v", string(data))
}