mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
core/types: rename SignAuthorization to SignSetCode
This commit is contained in:
parent
eceab538ce
commit
335901cb4c
2 changed files with 4 additions and 4 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue