mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 10:20:44 +00:00
This commit is contained in:
parent
142b1155d8
commit
0d381ece9f
3 changed files with 11 additions and 8 deletions
|
|
@ -20,16 +20,16 @@ func (a Authorization) MarshalJSON() ([]byte, error) {
|
||||||
Address common.Address `json:"address" gencodec:"required"`
|
Address common.Address `json:"address" gencodec:"required"`
|
||||||
Nonce hexutil.Uint64 `json:"nonce" gencodec:"required"`
|
Nonce hexutil.Uint64 `json:"nonce" gencodec:"required"`
|
||||||
V hexutil.Uint64 `json:"v" gencodec:"required"`
|
V hexutil.Uint64 `json:"v" gencodec:"required"`
|
||||||
R uint256.Int `json:"r" gencodec:"required"`
|
R hexutil.U256 `json:"r" gencodec:"required"`
|
||||||
S uint256.Int `json:"s" gencodec:"required"`
|
S hexutil.U256 `json:"s" gencodec:"required"`
|
||||||
}
|
}
|
||||||
var enc Authorization
|
var enc Authorization
|
||||||
enc.ChainID = hexutil.Uint64(a.ChainID)
|
enc.ChainID = hexutil.Uint64(a.ChainID)
|
||||||
enc.Address = a.Address
|
enc.Address = a.Address
|
||||||
enc.Nonce = hexutil.Uint64(a.Nonce)
|
enc.Nonce = hexutil.Uint64(a.Nonce)
|
||||||
enc.V = hexutil.Uint64(a.V)
|
enc.V = hexutil.Uint64(a.V)
|
||||||
enc.R = a.R
|
enc.R = hexutil.U256(a.R)
|
||||||
enc.S = a.S
|
enc.S = hexutil.U256(a.S)
|
||||||
return json.Marshal(&enc)
|
return json.Marshal(&enc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -40,8 +40,8 @@ func (a *Authorization) UnmarshalJSON(input []byte) error {
|
||||||
Address *common.Address `json:"address" gencodec:"required"`
|
Address *common.Address `json:"address" gencodec:"required"`
|
||||||
Nonce *hexutil.Uint64 `json:"nonce" gencodec:"required"`
|
Nonce *hexutil.Uint64 `json:"nonce" gencodec:"required"`
|
||||||
V *hexutil.Uint64 `json:"v" gencodec:"required"`
|
V *hexutil.Uint64 `json:"v" gencodec:"required"`
|
||||||
R *uint256.Int `json:"r" gencodec:"required"`
|
R *hexutil.U256 `json:"r" gencodec:"required"`
|
||||||
S *uint256.Int `json:"s" gencodec:"required"`
|
S *hexutil.U256 `json:"s" gencodec:"required"`
|
||||||
}
|
}
|
||||||
var dec Authorization
|
var dec Authorization
|
||||||
if err := json.Unmarshal(input, &dec); err != nil {
|
if err := json.Unmarshal(input, &dec); err != nil {
|
||||||
|
|
@ -66,10 +66,10 @@ func (a *Authorization) UnmarshalJSON(input []byte) error {
|
||||||
if dec.R == nil {
|
if dec.R == nil {
|
||||||
return errors.New("missing required field 'r' for Authorization")
|
return errors.New("missing required field 'r' for Authorization")
|
||||||
}
|
}
|
||||||
a.R = *dec.R
|
a.R = uint256.Int(*dec.R)
|
||||||
if dec.S == nil {
|
if dec.S == nil {
|
||||||
return errors.New("missing required field 's' for Authorization")
|
return errors.New("missing required field 's' for Authorization")
|
||||||
}
|
}
|
||||||
a.S = *dec.S
|
a.S = uint256.Int(*dec.S)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,8 @@ type authorizationMarshaling struct {
|
||||||
ChainID hexutil.Uint64
|
ChainID hexutil.Uint64
|
||||||
Nonce hexutil.Uint64
|
Nonce hexutil.Uint64
|
||||||
V hexutil.Uint64
|
V hexutil.Uint64
|
||||||
|
R hexutil.U256
|
||||||
|
S hexutil.U256
|
||||||
}
|
}
|
||||||
|
|
||||||
// SignAuth signs the provided authorization.
|
// SignAuth signs the provided authorization.
|
||||||
|
|
|
||||||
|
|
@ -344,6 +344,7 @@ func (args *TransactionArgs) ToMessage(b AccountBackend, baseFee *big.Int, skipN
|
||||||
GasTipCap: gasTipCap,
|
GasTipCap: gasTipCap,
|
||||||
Data: args.data(),
|
Data: args.data(),
|
||||||
AccessList: accessList,
|
AccessList: accessList,
|
||||||
|
AuthList: args.AuthorizationList,
|
||||||
SkipNonceChecks: skipNonceCheck,
|
SkipNonceChecks: skipNonceCheck,
|
||||||
SkipFromEOACheck: skipEoACheck,
|
SkipFromEOACheck: skipEoACheck,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue