Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
Signed-off-by: filev94 <[email protected]>
  • Loading branch information
filev94 committed Feb 5, 2025
1 parent 680d543 commit 8ee44e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
public abstract class AbstractContractCallServiceTest extends Web3IntegrationTest {

protected static final String TREASURY_ADDRESS = EvmTokenUtils.toAddress(2).toHexString();
public static final long BALANCE = 1_000_000_000_000_000L;
public static final long DEFAULT_ACCOUNT_BALANCE = 1_000_000_000_000_000L;

@Resource
protected TestWeb3jService testWeb3jService;
Expand Down Expand Up @@ -362,11 +362,11 @@ protected NftAllowance nftAllowancePersist(Token token, Entity owner, Entity spe
*/
protected Entity accountEntityPersist() {
return accountEntityPersistCustomizable(
e -> e.type(EntityType.ACCOUNT).evmAddress(null).alias(null).balance(BALANCE));
e -> e.type(EntityType.ACCOUNT).evmAddress(null).alias(null).balance(DEFAULT_ACCOUNT_BALANCE));
}

protected Entity accountEntityWithEvmAddressPersist() {
return accountEntityPersistCustomizable(e -> e.type(EntityType.ACCOUNT).balance(BALANCE));
return accountEntityPersistCustomizable(e -> e.type(EntityType.ACCOUNT).balance(DEFAULT_ACCOUNT_BALANCE));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ void callWithContractResultNotFoundExceptionTest() {
final var contract = testWeb3jService.deploy(ExchangeRatePrecompile::deploy);
final var functionCall = contract.call_tinybarsToTinycents(BigInteger.TEN);
final var callData = functionCall.encodeFunctionCall().getBytes();
final var senderEntity = accountPersist();
final var senderEntity = accountEntityPersist();
final var consensusTimestamp = domainBuilder.timestamp();
final var transactionIdOrHash = setUp(
TransactionType.CONTRACTCALL,
Expand All @@ -544,7 +544,7 @@ void callWithTransactionNotFoundExceptionTest() {
final var contract = testWeb3jService.deploy(ExchangeRatePrecompile::deploy);
final var functionCall = contract.call_tinybarsToTinycents(BigInteger.TEN);
final var callData = functionCall.encodeFunctionCall().getBytes();
final var senderEntity = accountPersist();
final var senderEntity = accountEntityPersist();

final var transactionIdOrHash = setUp(
TransactionType.CONTRACTCALL,
Expand Down Expand Up @@ -869,10 +869,6 @@ private Token nftPersist(final Entity treasuryEntity) {
return token;
}

private Entity accountPersist() {
return accountEntityPersist();
}

private Entity accountPersistWithAccountBalances() {
final var entity = accountEntityPersist();

Expand Down

0 comments on commit 8ee44e6

Please sign in to comment.