mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
core/types: authorities to setcodeauthorities
This commit is contained in:
parent
8c984338b0
commit
ffa02b82e0
3 changed files with 4 additions and 4 deletions
|
|
@ -1755,7 +1755,7 @@ func (t *lookup) TxsBelowTip(threshold *big.Int) types.Transactions {
|
||||||
// addAuthorities tracks the supplied tx in relation to each authority it
|
// addAuthorities tracks the supplied tx in relation to each authority it
|
||||||
// specifies.
|
// specifies.
|
||||||
func (t *lookup) addAuthorities(tx *types.Transaction) {
|
func (t *lookup) addAuthorities(tx *types.Transaction) {
|
||||||
for _, addr := range tx.Authorities() {
|
for _, addr := range tx.SetCodeAuthorities() {
|
||||||
list, ok := t.auths[addr]
|
list, ok := t.auths[addr]
|
||||||
if !ok {
|
if !ok {
|
||||||
list = []common.Hash{}
|
list = []common.Hash{}
|
||||||
|
|
|
||||||
|
|
@ -280,7 +280,7 @@ func ValidateTransactionWithState(tx *types.Transaction, signer types.Signer, op
|
||||||
// Verify no authorizations will invalidate existing transactions known to
|
// Verify no authorizations will invalidate existing transactions known to
|
||||||
// the pool.
|
// the pool.
|
||||||
if opts.KnownConflicts != nil {
|
if opts.KnownConflicts != nil {
|
||||||
if conflicts := opts.KnownConflicts(from, tx.Authorities()); len(conflicts) > 0 {
|
if conflicts := opts.KnownConflicts(from, tx.SetCodeAuthorities()); len(conflicts) > 0 {
|
||||||
return fmt.Errorf("%w: authorization conflicts with other known tx", ErrAuthorityReserved)
|
return fmt.Errorf("%w: authorization conflicts with other known tx", ErrAuthorityReserved)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -483,8 +483,8 @@ func (tx *Transaction) SetCodeAuthorizations() []SetCodeAuthorization {
|
||||||
return setcodetx.AuthList
|
return setcodetx.AuthList
|
||||||
}
|
}
|
||||||
|
|
||||||
// Authorities returns a list of each authorization's corresponding authority.
|
// SetCodeAuthorities returns a list of each authorization's corresponding authority.
|
||||||
func (tx *Transaction) Authorities() []common.Address {
|
func (tx *Transaction) SetCodeAuthorities() []common.Address {
|
||||||
setcodetx, ok := tx.inner.(*SetCodeTx)
|
setcodetx, ok := tx.inner.(*SetCodeTx)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue