Skip to content

Commit

Permalink
add dummy check
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolay Nikolov <[email protected]>
  • Loading branch information
nickeynikolovv committed Dec 20, 2024
1 parent 534e15c commit dd74af8
Showing 1 changed file with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,33 +183,33 @@ void pureCall() throws Exception {
void pureCallModularizedServices() throws Exception {
// Given
final var modularizedServicesFlag = mirrorNodeEvmProperties.isModularizedServices();
mirrorNodeEvmProperties.setModularizedServices(true);
System.out.println("TEST FLAG IS SET TO " + modularizedServicesFlag);

Method postConstructMethod = Arrays.stream(MirrorNodeState.class.getDeclaredMethods())
.filter(method -> method.isAnnotationPresent(PostConstruct.class))
.findFirst()
.orElseThrow(() -> new IllegalStateException("@PostConstruct method not found"));

postConstructMethod.setAccessible(true); // Make the method accessible
postConstructMethod.invoke(state);

final var backupProperties = mirrorNodeEvmProperties.getProperties();
final Map<String, String> propertiesMap = new HashMap<>();
propertiesMap.put("contracts.maxRefundPercentOfGasLimit", "100");
propertiesMap.put("contracts.maxGasPerSec", "15000000");
mirrorNodeEvmProperties.setProperties(propertiesMap);

final var contract = testWeb3jService.deploy(EthCall::deploy);
meterRegistry.clear(); // Clear it as the contract deploy increases the gas limit metric

// When
contract.call_multiplySimpleNumbers().send();

// Then
// Restore changed property values.
mirrorNodeEvmProperties.setModularizedServices(modularizedServicesFlag);
mirrorNodeEvmProperties.setProperties(backupProperties);
assertThat(true).isFalse();
// mirrorNodeEvmProperties.setModularizedServices(true);
// Method postConstructMethod = Arrays.stream(MirrorNodeState.class.getDeclaredMethods())
// .filter(method -> method.isAnnotationPresent(PostConstruct.class))
// .findFirst()
// .orElseThrow(() -> new IllegalStateException("@PostConstruct method not found"));
//
// postConstructMethod.setAccessible(true); // Make the method accessible
// postConstructMethod.invoke(state);
//
// final var backupProperties = mirrorNodeEvmProperties.getProperties();
// final Map<String, String> propertiesMap = new HashMap<>();
// propertiesMap.put("contracts.maxRefundPercentOfGasLimit", "100");
// propertiesMap.put("contracts.maxGasPerSec", "15000000");
// mirrorNodeEvmProperties.setProperties(propertiesMap);
//
// final var contract = testWeb3jService.deploy(EthCall::deploy);
// meterRegistry.clear(); // Clear it as the contract deploy increases the gas limit metric
//
// // When
// contract.call_multiplySimpleNumbers().send();
//
// // Then
// // Restore changed property values.
// mirrorNodeEvmProperties.setModularizedServices(modularizedServicesFlag);
// mirrorNodeEvmProperties.setProperties(backupProperties);
}

@ParameterizedTest
Expand Down

0 comments on commit dd74af8

Please sign in to comment.