You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
core/types: updates for EIP-7702 API functions (ethereum#30933)
Here I am proposing two small changes to the exported API for EIP-7702:
(1) `Authorization` has a very generic name, but it is in fact only used
for one niche use case: authorizing code in a `SetCodeTx`. So I propose
calling it `SetCodeAuthorization` instead. The signing function is
renamed to `SignSetCode` instead of `SignAuth`.
(2) The signing function for authorizations should take key as the first
parameter, and the authorization second. The key will almost always be
in a variable, while the authorization can be given as a literal.
Copy file name to clipboardExpand all lines: core/types/tx_setcode.go
+15-21Lines changed: 15 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -58,18 +58,18 @@ type SetCodeTx struct {
58
58
Value*uint256.Int
59
59
Data []byte
60
60
AccessListAccessList
61
-
AuthList []Authorization
61
+
AuthList []SetCodeAuthorization
62
62
63
63
// Signature values
64
64
V*uint256.Int`json:"v" gencodec:"required"`
65
65
R*uint256.Int`json:"r" gencodec:"required"`
66
66
S*uint256.Int`json:"s" gencodec:"required"`
67
67
}
68
68
69
-
//go:generate go run github.com/fjl/gencodec -type Authorization -field-override authorizationMarshaling -out gen_authorization.go
69
+
//go:generate go run github.com/fjl/gencodec -type SetCodeAuthorization -field-override authorizationMarshaling -out gen_authorization.go
70
70
71
-
// Authorization is an authorization from an account to deploy code at its address.
72
-
typeAuthorizationstruct {
71
+
// SetCodeAuthorization is an authorization from an account to deploy code at its address.
0 commit comments