From bbff1f437d91d63d8e6cc64d597709f0c00bb582 Mon Sep 17 00:00:00 2001 From: Guido Vranken Date: Fri, 12 Apr 2024 10:03:57 +0200 Subject: [PATCH] Improve performance of mock getOriginAddress, getCallerAddress --- .../vm/program/invoke/ProgramInvokeMockImpl.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/rskj-core/src/test/java/org/ethereum/vm/program/invoke/ProgramInvokeMockImpl.java b/rskj-core/src/test/java/org/ethereum/vm/program/invoke/ProgramInvokeMockImpl.java index f9377f33a65..35e4d1f4c2b 100644 --- a/rskj-core/src/test/java/org/ethereum/vm/program/invoke/ProgramInvokeMockImpl.java +++ b/rskj-core/src/test/java/org/ethereum/vm/program/invoke/ProgramInvokeMockImpl.java @@ -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 */