mirror of
https://github.com/vacp2p/status-linea-besu.git
synced 2026-01-09 23:38:08 -05:00
rename methods and variables, clarify comments (#8155)
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
This commit is contained in:
@@ -70,7 +70,7 @@ abstract class AbstractCodeDelegationAccount implements Account {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCodeDelegation() {
|
||||
public boolean hasDelegatedCode() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public interface Account extends AccountState {
|
||||
*
|
||||
* @return true if the account has delegated code otherwise false.
|
||||
*/
|
||||
default boolean hasCodeDelegation() {
|
||||
default boolean hasDelegatedCode() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public interface AccountState {
|
||||
/**
|
||||
* The optional EVM bytecode if the account has set a 7702 code delegation.
|
||||
*
|
||||
* @return the code of the target account (which may be empty).
|
||||
* @return the code of the target account that this account delegates to (which may be empty).
|
||||
*/
|
||||
default Optional<Bytes> getCodeDelegationTargetCode() {
|
||||
return Optional.empty();
|
||||
|
||||
@@ -191,7 +191,7 @@ public abstract class AbstractCallOperation extends AbstractOperation {
|
||||
|
||||
final Account contract = frame.getWorldUpdater().get(to);
|
||||
|
||||
if (contract != null && contract.hasCodeDelegation()) {
|
||||
if (contract != null && contract.hasDelegatedCode()) {
|
||||
if (contract.getCodeDelegationTargetCode().isEmpty()) {
|
||||
throw new RuntimeException("A delegated code account must have delegated code");
|
||||
}
|
||||
@@ -357,7 +357,7 @@ public abstract class AbstractCallOperation extends AbstractOperation {
|
||||
return CodeV0.EMPTY_CODE;
|
||||
}
|
||||
|
||||
if (account.hasCodeDelegation()) {
|
||||
if (account.hasDelegatedCode()) {
|
||||
return evm.getCode(
|
||||
account.getCodeDelegationTargetHash().get(), account.getCodeDelegationTargetCode().get());
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ public abstract class AbstractExtCallOperation extends AbstractCallOperation {
|
||||
Address to = Words.toAddress(toBytes);
|
||||
final Account contract = frame.getWorldUpdater().get(to);
|
||||
|
||||
if (contract != null && contract.hasCodeDelegation()) {
|
||||
if (contract != null && contract.hasDelegatedCode()) {
|
||||
if (contract.getCodeDelegationTargetCode().isEmpty()) {
|
||||
throw new RuntimeException("A delegated code account must have delegated code");
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ abstract class AbstractExtCodeOperation extends AbstractOperation {
|
||||
return Bytes.EMPTY;
|
||||
}
|
||||
|
||||
return account.hasCodeDelegation()
|
||||
return account.hasDelegatedCode()
|
||||
? CodeDelegationHelper.getCodeDelegationForRead()
|
||||
: account.getCode();
|
||||
}
|
||||
@@ -68,7 +68,7 @@ abstract class AbstractExtCodeOperation extends AbstractOperation {
|
||||
* @return the code hash or the hash of the special 7702 designator
|
||||
*/
|
||||
protected Hash getCodeHash(final Account account) {
|
||||
if (account.hasCodeDelegation()) {
|
||||
if (account.hasDelegatedCode()) {
|
||||
return Hash.hash(CodeDelegationHelper.getCodeDelegationForRead());
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class CodeDelegationGasCostHelper {
|
||||
*/
|
||||
public static long codeDelegationGasCost(
|
||||
final MessageFrame frame, final GasCalculator gasCalculator, final Account account) {
|
||||
if (!account.hasCodeDelegation()) {
|
||||
if (!account.hasDelegatedCode()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user