core/types: rename SignAuthorization to SignSetCode

This commit is contained in:
Felix Lange 2024-12-18 14:07:15 +01:00
parent eceab538ce
commit 335901cb4c
2 changed files with 4 additions and 4 deletions

View file

@ -4273,12 +4273,12 @@ func TestEIP7702(t *testing.T) {
// 1. tx -> addr1 which is delegated to 0xaaaa // 1. tx -> addr1 which is delegated to 0xaaaa
// 2. addr1:0xaaaa calls into addr2:0xbbbb // 2. addr1:0xaaaa calls into addr2:0xbbbb
// 3. addr2:0xbbbb writes to storage // 3. addr2:0xbbbb writes to storage
auth1, _ := types.SignAuthorization(key1, types.SetCodeAuthorization{ auth1, _ := types.SignSetCode(key1, types.SetCodeAuthorization{
ChainID: gspec.Config.ChainID.Uint64(), ChainID: gspec.Config.ChainID.Uint64(),
Address: aa, Address: aa,
Nonce: 1, Nonce: 1,
}) })
auth2, _ := types.SignAuthorization(key2, types.SetCodeAuthorization{ auth2, _ := types.SignSetCode(key2, types.SetCodeAuthorization{
ChainID: 0, ChainID: 0,
Address: bb, Address: bb,
Nonce: 0, Nonce: 0,

View file

@ -87,8 +87,8 @@ type authorizationMarshaling struct {
S hexutil.U256 S hexutil.U256
} }
// SignAuthorization sets the signature of a code authorization. // SignSetCode creates a signed the SetCode authorization.
func SignAuthorization(prv *ecdsa.PrivateKey, auth SetCodeAuthorization) (SetCodeAuthorization, error) { func SignSetCode(prv *ecdsa.PrivateKey, auth SetCodeAuthorization) (SetCodeAuthorization, error) {
sighash := auth.sigHash() sighash := auth.sigHash()
sig, err := crypto.Sign(sighash[:], prv) sig, err := crypto.Sign(sighash[:], prv)
if err != nil { if err != nil {