mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
accounts, internal, signer: fix linter nits
This commit is contained in:
parent
bcd9790781
commit
9c2bb339aa
4 changed files with 10 additions and 12 deletions
2
accounts/external/backend.go
vendored
2
accounts/external/backend.go
vendored
|
|
@ -245,7 +245,7 @@ func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transactio
|
||||||
args.Commitments = sidecar.Commitments
|
args.Commitments = sidecar.Commitments
|
||||||
args.Proofs = sidecar.Proofs
|
args.Proofs = sidecar.Proofs
|
||||||
}
|
}
|
||||||
|
|
||||||
var res signTransactionResult
|
var res signTransactionResult
|
||||||
if err := api.client.Call(&res, "account_signTransaction", args); err != nil {
|
if err := api.client.Call(&res, "account_signTransaction", args); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
|
|
@ -1895,9 +1895,9 @@ func (s *TransactionAPI) SignTransaction(ctx context.Context, args TransactionAr
|
||||||
// to put back the blob(s).
|
// to put back the blob(s).
|
||||||
if args.IsEIP4844() {
|
if args.IsEIP4844() {
|
||||||
signed = signed.WithBlobTxSidecar(&types.BlobTxSidecar{
|
signed = signed.WithBlobTxSidecar(&types.BlobTxSidecar{
|
||||||
args.Blobs,
|
Blobs: args.Blobs,
|
||||||
args.Commitments,
|
Commitments: args.Commitments,
|
||||||
args.Proofs,
|
Proofs: args.Proofs,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
data, err := signed.MarshalBinary()
|
data, err := signed.MarshalBinary()
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ package apitypes
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"crypto/sha256"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
@ -28,7 +29,6 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"crypto/sha256"
|
|
||||||
"github.com/ethereum/go-ethereum/accounts"
|
"github.com/ethereum/go-ethereum/accounts"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@
|
||||||
package apitypes
|
package apitypes
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/sha256"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"crypto/sha256"
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/crypto/kzg4844"
|
"github.com/ethereum/go-ethereum/crypto/kzg4844"
|
||||||
|
|
@ -67,7 +67,6 @@ func TestTxArgs(t *testing.T) {
|
||||||
wantType: types.DynamicFeeTxType,
|
wantType: types.DynamicFeeTxType,
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
|
|
||||||
var txArgs SendTxArgs
|
var txArgs SendTxArgs
|
||||||
if err := json.Unmarshal(tc.data, &txArgs); err != nil {
|
if err := json.Unmarshal(tc.data, &txArgs); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|
@ -110,16 +109,16 @@ func TestTxArgs(t *testing.T) {
|
||||||
|
|
||||||
func TestBlobTxs(t *testing.T) {
|
func TestBlobTxs(t *testing.T) {
|
||||||
blob := kzg4844.Blob{0x1}
|
blob := kzg4844.Blob{0x1}
|
||||||
committment, err := kzg4844.BlobToCommitment(blob)
|
commitment, err := kzg4844.BlobToCommitment(blob)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
proof, err := kzg4844.ComputeBlobProof(blob, committment)
|
proof, err := kzg4844.ComputeBlobProof(blob, commitment)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
hash := kzg4844.CalcBlobHashV1(sha256.New(), &committment)
|
hash := kzg4844.CalcBlobHashV1(sha256.New(), &commitment)
|
||||||
b := &types.BlobTx{
|
b := &types.BlobTx{
|
||||||
ChainID: uint256.NewInt(6),
|
ChainID: uint256.NewInt(6),
|
||||||
Nonce: 8,
|
Nonce: 8,
|
||||||
|
|
@ -131,7 +130,7 @@ func TestBlobTxs(t *testing.T) {
|
||||||
Value: uint256.NewInt(100),
|
Value: uint256.NewInt(100),
|
||||||
Sidecar: &types.BlobTxSidecar{
|
Sidecar: &types.BlobTxSidecar{
|
||||||
Blobs: []kzg4844.Blob{blob},
|
Blobs: []kzg4844.Blob{blob},
|
||||||
Commitments: []kzg4844.Commitment{committment},
|
Commitments: []kzg4844.Commitment{commitment},
|
||||||
Proofs: []kzg4844.Proof{proof},
|
Proofs: []kzg4844.Proof{proof},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -141,5 +140,4 @@ func TestBlobTxs(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
t.Logf("tx %v", string(data))
|
t.Logf("tx %v", string(data))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue