Skip to content

Commit

Permalink
Fix/getaccount (#1493)
Browse files Browse the repository at this point in the history
* replace getaccount by get to avoid tracking

* update

* fix test build

* fix test build

* revert due to performance regression
  • Loading branch information
FlorianHuc authored Nov 26, 2024
1 parent 89bd38e commit 826eec2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class AccountSnapshot {
private boolean deploymentStatus;

// TODO: is there a "canonical" way to take a snapshot fo an account
// where getWorldUpdater().getAccount(address) return null ?
// where getWorldUpdater().get(address) return null ?

/**
* Canonical way of creating an account snapshot.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ public void callRomLex(final MessageFrame frame) {
!hub.deploymentStatusOf(foreignCodeAddress),
"EXTCODECOPY should only trigger a ROM_LEX chunk if its target isn't currently deploying");
checkArgument(
!frame.getWorldUpdater().getAccount(foreignCodeAddress).isEmpty()
&& frame.getWorldUpdater().getAccount(foreignCodeAddress).hasCode());
!frame.getWorldUpdater().get(foreignCodeAddress).isEmpty()
&& frame.getWorldUpdater().get(foreignCodeAddress).hasCode());

Optional.ofNullable(frame.getWorldUpdater().get(foreignCodeAddress))
.map(AccountState::getCode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public SStore(MessageFrame frame) {
this.frame = frame;
if (frame.stackSize() > 1) {
this.key = UInt256.fromBytes(frame.getStackItem(0));
final Account account = frame.getWorldUpdater().getAccount(frame.getRecipientAddress());
final Account account = frame.getWorldUpdater().get(frame.getRecipientAddress());
if (account == null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public MutableAccount getAccount(final Address address) {
if (addressAccountMap.containsKey(address)) {
return addressAccountMap.get(address);
} else if (parent != null) {
Account parentAccount = parent.getAccount(address);
Account parentAccount = parent.get(address);
if (parentAccount == null) {
return null;
} else {
Expand Down

0 comments on commit 826eec2

Please sign in to comment.