Skip to content

Commit

Permalink
Improve performance of mock getOriginAddress, getCallerAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
guidovranken authored and jurajpiar committed Apr 12, 2024
1 parent 12c9b32 commit bbff1f4
Showing 1 changed file with 2 additions and 10 deletions.
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

0 comments on commit bbff1f4

Please sign in to comment.