Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@swirldslabs.com>
  • Loading branch information
Neeharika-Sompalli committed May 3, 2023
1 parent a7f5d13 commit d726a8d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ public class CryptoOpsUsage {
static EstimatorFactory txnEstimateFactory = TxnUsageEstimator::new;
static Function<ResponseType, QueryUsage> queryEstimateFactory = QueryUsage::new;

private static final Logger log = LogManager.getLogger(CryptoOpsUsage.class);

@Inject
public CryptoOpsUsage() {
// Default constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.hedera.node.app.service.token.impl;

import static com.hedera.node.app.service.evm.accounts.HederaEvmContractAliases.EVM_ADDRESS_LEN;
import static java.util.Objects.requireNonNull;

import com.hedera.hapi.node.base.AccountID;
Expand Down Expand Up @@ -74,15 +75,15 @@ public void put(@NonNull final Account account) {
* @param alias - the alias to be added to modifications in state.
* @param accountNum - the account number to be added to modifications in state.
*/
public void putAlias(@NonNull final String alias, @NonNull final long accountNum) {
public void putAlias(@NonNull final String alias, final long accountNum) {
Objects.requireNonNull(alias);
aliases.put(alias, new EntityNumValue(accountNum));
}

/** Commits the changes to the underlying data storage. */
public void commit() {
((WritableKVStateBase) accountState).commit();
((WritableKVStateBase) aliases).commit();
((WritableKVStateBase<?, ?>) accountState).commit();
((WritableKVStateBase<?, ?>) aliases).commit();
}

/**
Expand All @@ -99,7 +100,7 @@ public Optional<Account> get(final AccountID accountID) {
}

/**
* Returns the {@link Account} with the given number using {@link
* Returns the {@link Account} with the given {@link AccountID using {@link
* WritableKVState#getForModify(Object K)}}. If no such account exists, returns {@code
* Optional.empty()}
*
Expand All @@ -117,7 +118,7 @@ public Optional<Account> getForModify(final AccountID id) {
if (alias.length() == EVM_ADDRESS_LEN && isMirror(alias)) {
yield fromMirror(alias);
} else {
final var entityNum = aliases.getForModify(alias.asUtf8String());
final var entityNum = aliases.get(alias.asUtf8String());
yield entityNum == null ? EntityNumValue.DEFAULT.num() : entityNum.num();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ private ResponseCodeEnum pureChecks(@NonNull final CryptoCreateTransactionBody o
return INVALID_RENEWAL_PERIOD;
}
if (op.sendRecordThreshold() < 0L) {
return INVALID_SEND_RECORD_THRESHOLD; // should this return SEND_RECORD_THRESHOLD_FIELD_IS_DEPRECATED
return INVALID_SEND_RECORD_THRESHOLD; //FUTURE: should this return SEND_RECORD_THRESHOLD_FIELD_IS_DEPRECATED
}
if (op.receiveRecordThreshold() < 0L) {
return INVALID_RECEIVE_RECORD_THRESHOLD; // should this return RECEIVE_RECORD_THRESHOLD_FIELD_IS_DEPRECATED
return INVALID_RECEIVE_RECORD_THRESHOLD; //FUTURE: should this return RECEIVE_RECORD_THRESHOLD_FIELD_IS_DEPRECATED
}
if (op.hasProxyAccountID() && !op.proxyAccountID().equals(AccountID.DEFAULT)) {
return PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@

/**
* Unit tests for {@link CryptoCreateHandler}.
* Tests the following:
* <ul>
* <li>preHandle works when there is a receiverSigRequired</li>
* </ul>
*/
@ExtendWith(MockitoExtension.class)
class CryptoCreateHandlerTest extends CryptoHandlerTestBase {
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ dependencyResolutionManagement {
// runtime.
create("libs") {
// The HAPI API version to use, this need to match the tag set on gitRepositories above
version("hapi-version", "0.38.0-allowance-SNAPSHOT")
version("hapi-version", "0.38.1-allowance-SNAPSHOT")

// Definition of version numbers for all libraries
version("pbj-version", "0.5.1")
Expand Down

0 comments on commit d726a8d

Please sign in to comment.