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
// 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,

View file

@ -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 {