Skip to content

Commit

Permalink
fix: sonar smells
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitar Dinev <mitkojc@gmail.com>
  • Loading branch information
dimitar-dinev committed Feb 3, 2023
1 parent cd9ec76 commit 8553ce0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 60 deletions.
28 changes: 0 additions & 28 deletions test-clients/src/eet/java/EndToEndTests.java
Expand Up @@ -14,15 +14,6 @@
* limitations under the License.
*/
import com.hedera.services.bdd.suites.autorenew.GracePeriodRestrictionsSuite;
import com.hedera.services.bdd.suites.contract.precompile.AssociatePrecompileSuite;
import com.hedera.services.bdd.suites.contract.precompile.ContractBurnHTSSuite;
import com.hedera.services.bdd.suites.contract.precompile.ContractHTSSuite;
import com.hedera.services.bdd.suites.contract.precompile.ContractKeysHTSSuite;
import com.hedera.services.bdd.suites.contract.precompile.ContractMintHTSSuite;
import com.hedera.services.bdd.suites.contract.precompile.CreatePrecompileSuite;
import com.hedera.services.bdd.suites.contract.precompile.CryptoTransferHTSSuite;
import com.hedera.services.bdd.suites.contract.precompile.DelegatePrecompileSuite;
import com.hedera.services.bdd.suites.contract.precompile.DissociatePrecompileSuite;
import com.hedera.services.bdd.suites.fees.CongestionPricingSuite;
import com.hedera.services.bdd.suites.file.ExchangeRateControlSuite;
import com.hedera.services.bdd.suites.file.FileUpdateSuite;
Expand All @@ -43,7 +34,6 @@
import java.util.Collection;
import java.util.List;
import org.junit.jupiter.api.DynamicContainer;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Tag;
Expand Down Expand Up @@ -135,24 +125,6 @@ Collection<DynamicContainer> contractPrecompile() {
);
}

@Tag("contract")
@Tag("contract.precompile")
@Order(1)
@TestFactory
List<DynamicTest> contractPrecompileEth() {
return List.of(
concurrentEthSpecsFrom(
AssociatePrecompileSuite::new,
ContractBurnHTSSuite::new,
ContractHTSSuite::new,
ContractKeysHTSSuite::new,
ContractMintHTSSuite::new,
CreatePrecompileSuite::new,
DissociatePrecompileSuite::new,
CryptoTransferHTSSuite::new,
DelegatePrecompileSuite::new));
}

@Tag("contract")
@Tag("contract.precompile")
@Tag("contract.precompile.part2")
Expand Down
Expand Up @@ -1310,34 +1310,32 @@ private HapiSpec directTransferWorksForERC20() {
.via("autoAccount"))
.when(
withOpContext(
(spec, ignore) -> {
allRunFor(
spec,
ethereumCallWithFunctionAbi(
true,
FUNGIBLE_TOKEN,
getABIFor(
com.hedera.services.bdd.suites
.contract.Utils
.FunctionType.FUNCTION,
"transfer",
"ERC20ABI"),
asHeadlongAddress(
asHexedSolidityAddress(
spec.registry()
.getAccountID(
ACCOUNT))),
BigInteger.valueOf(tokenTransferAmount))
.signingWith(SECP_256K1_SOURCE_KEY)
.nonce(0)
.gasPrice(50L)
.via(transferTxn)
.gasLimit(1_000_000)
.maxFeePerGas(0)
.type(EthTransactionType.EIP1559)
.maxGasAllowance(ONE_HBAR * 5)
.payingWith(ACCOUNT));
}))
(spec, ignore) ->
allRunFor(
spec,
ethereumCallWithFunctionAbi(
true,
FUNGIBLE_TOKEN,
getABIFor(
Utils.FunctionType.FUNCTION,
"transfer",
"ERC20ABI"),
asHeadlongAddress(
asHexedSolidityAddress(
spec.registry()
.getAccountID(
ACCOUNT))),
BigInteger.valueOf(
tokenTransferAmount))
.signingWith(SECP_256K1_SOURCE_KEY)
.nonce(0)
.gasPrice(50L)
.via(transferTxn)
.gasLimit(1_000_000)
.maxFeePerGas(0)
.type(EthTransactionType.EIP1559)
.maxGasAllowance(ONE_HBAR * 5)
.payingWith(ACCOUNT))))
.then(
withOpContext(
(spec, ignore) ->
Expand Down Expand Up @@ -1464,7 +1462,6 @@ private HapiSpec nftApprove() {
}

private HapiSpec transferErc20TokenSenderAccount() {
final String ERC_20_CONTRACT = "ERC20Contract";
final var RECIPIENT = "recipient";
final var TXN = "txn";
return defaultHapiSpec("ERC_20_TRANSFER_SENDER_ACCOUNT")
Expand All @@ -1479,8 +1476,8 @@ private HapiSpec transferErc20TokenSenderAccount() {
.adminKey(MULTI_KEY)
.supplyKey(MULTI_KEY),
tokenAssociate(RECIPIENT, List.of(FUNGIBLE_TOKEN)),
uploadInitCode(ERC_20_CONTRACT),
contractCreate(ERC_20_CONTRACT),
uploadInitCode(ERC20_CONTRACT),
contractCreate(ERC20_CONTRACT),
newKeyNamed(SECP_256K1_SOURCE_KEY).shape(SECP_256K1_SHAPE),
cryptoTransfer(
moving(2, FUNGIBLE_TOKEN)
Expand All @@ -1492,7 +1489,7 @@ private HapiSpec transferErc20TokenSenderAccount() {
allRunFor(
spec,
ethereumCall(
ERC_20_CONTRACT,
ERC20_CONTRACT,
"delegateTransfer",
HapiParserUtil.asHeadlongAddress(
asAddress(
Expand Down

0 comments on commit 8553ce0

Please sign in to comment.