Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of mock getOriginAddress, getCallerAddress #2287

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,13 @@ public DataWord getBalance() {
/* ORIGIN op */
@Override
public DataWord getOriginAddress() {

byte[] cowPrivKey = HashUtil.keccak256("horse".getBytes(StandardCharsets.UTF_8));
byte[] addr = ECKey.fromPrivate(cowPrivKey).getAddress();

return DataWord.valueOf(addr);
return DataWord.valueFromHex("00000000000000000000000013978aee95f38490e9769c39b2773ed763d9cd5f");
}

/* CALLER op */
@Override
public DataWord getCallerAddress() {

byte[] cowPrivKey = HashUtil.keccak256("monkey".getBytes(StandardCharsets.UTF_8));
byte[] addr = ECKey.fromPrivate(cowPrivKey).getAddress();

return DataWord.valueOf(addr);
return DataWord.valueFromHex("000000000000000000000000885f93eed577f2fc341ebb9a5c9b2ce4465d96c4");
}

/* GASPRICE op */
Expand Down
Loading