From 335901cb4cbebf0dbafda5fa38bef64a8fa07c5c Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 18 Dec 2024 14:07:15 +0100 Subject: [PATCH] core/types: rename SignAuthorization to SignSetCode --- core/blockchain_test.go | 4 ++-- core/types/tx_setcode.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 74b7c7b020..fc0e3d8446 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -4273,12 +4273,12 @@ func TestEIP7702(t *testing.T) { // 1. tx -> addr1 which is delegated to 0xaaaa // 2. addr1:0xaaaa calls into addr2:0xbbbb // 3. addr2:0xbbbb writes to storage - auth1, _ := types.SignAuthorization(key1, types.SetCodeAuthorization{ + auth1, _ := types.SignSetCode(key1, types.SetCodeAuthorization{ ChainID: gspec.Config.ChainID.Uint64(), Address: aa, Nonce: 1, }) - auth2, _ := types.SignAuthorization(key2, types.SetCodeAuthorization{ + auth2, _ := types.SignSetCode(key2, types.SetCodeAuthorization{ ChainID: 0, Address: bb, Nonce: 0, diff --git a/core/types/tx_setcode.go b/core/types/tx_setcode.go index 92d6ac29dd..1be90df615 100644 --- a/core/types/tx_setcode.go +++ b/core/types/tx_setcode.go @@ -87,8 +87,8 @@ type authorizationMarshaling struct { S hexutil.U256 } -// SignAuthorization sets the signature of a code authorization. -func SignAuthorization(prv *ecdsa.PrivateKey, auth SetCodeAuthorization) (SetCodeAuthorization, error) { +// SignSetCode creates a signed the SetCode authorization. +func SignSetCode(prv *ecdsa.PrivateKey, auth SetCodeAuthorization) (SetCodeAuthorization, error) { sighash := auth.sigHash() sig, err := crypto.Sign(sighash[:], prv) if err != nil {