Skip to content

Commit

Permalink
Bump com.hedera.hashgraph:hedera-protobuf-java-api from 0.57.3 to 0.5…
Browse files Browse the repository at this point in the history
…8.4 (#10227)

* Bump com.hedera.hashgraph:hedera-protobuf-java-api from 0.57.3 to 0.58.4

Bumps [com.hedera.hashgraph:hedera-protobuf-java-api](https://github.com/hashgraph/hedera-protobuf) from 0.57.3 to 0.58.4.
- [Release notes](https://github.com/hashgraph/hedera-protobuf/releases)
- [Commits](hashgraph/hedera-protobufs-java@v0.57.3...v0.58.4)

---
updated-dependencies:
- dependency-name: com.hedera.hashgraph:hedera-protobuf-java-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Xin Li <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Xin Li <[email protected]>
  • Loading branch information
dependabot[bot] and xin-hedera authored Jan 28, 2025
1 parent 724b623 commit 6879055
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies {
api("com.graphql-java:graphql-java-extended-validation:22.0")
api("com.hedera.hashgraph:app:0.58.4")
api("com.hedera.evm:hedera-evm:0.54.2")
api("com.hedera.hashgraph:hedera-protobuf-java-api:0.57.3")
api("com.hedera.hashgraph:hedera-protobuf-java-api:0.58.4")
api("com.hedera.hashgraph:sdk:2.46.0")
api("com.ongres.scram:client:2.1")
api("com.playtika.testcontainers:embedded-google-pubsub:3.1.10")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static String getPublicKey(@Nullable byte[] protobufKey) {
}
}

@SuppressWarnings("java:S1168")
@SuppressWarnings({"deprecation", "java:S1168"})
private static byte[] getPublicKey(Key key, int depth) {
// We don't support searching for primitive keys at multiple levels since the REST API matches by hex prefix
if (depth > 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ void getPublicKeyWhenECDSASecp256K1() throws Exception {
assertThat(DomainUtils.getPublicKey(bytes)).isEqualTo(ECDSA_SECP256K1_KEY);
}

@SuppressWarnings("deprecation")
@Test
void getPublicKeyWhenECDSA384() throws Exception {
var bytes = Key.newBuilder()
Expand All @@ -114,6 +115,7 @@ void getPublicKeyWhenECDSA384() throws Exception {
assertThat(DomainUtils.getPublicKey(bytes)).isEqualTo(ECDSA_384_KEY);
}

@SuppressWarnings("deprecation")
@Test
void getPublicKeyWhenRSA3072() throws Exception {
var bytes = Key.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ default Object mapKey(byte[] source) {
}
}

@SuppressWarnings("deprecation")
default Object mapKey(Key key) {
var keyCase = key.getKeyCase();
return switch (keyCase) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ void mapEntityIdLong() {
assertThat(commonMapper.mapEntityId(0L)).usingRecursiveComparison().isEqualTo(toEntityId(0L, 0L, 0L));
}

@SuppressWarnings("deprecation")
@Test
void mapKey() {
var bytes = ByteString.copyFromUtf8("public key");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ private void transferNftOwnership(
entityListener.onNft(nft);
}

@SuppressWarnings("java:S135")
@SuppressWarnings({"deprecation", "java:S135"})
private void insertTransactionSignatures(
EntityId entityId, long consensusTimestamp, List<SignaturePair> signaturePairList) {
Set<ByteString> publicKeyPrefixes = new HashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ class CryptoAddLiveHashTransactionHandler extends AbstractTransactionHandler {

@Override
public EntityId getEntity(RecordItem recordItem) {
return EntityId.of(recordItem
.getTransactionBody()
.getCryptoAddLiveHash()
.getLiveHash()
.getAccountId());
return EntityId.of(getLiveHash(recordItem).getAccountId());
}

@Override
Expand All @@ -55,10 +51,14 @@ protected void doUpdateTransaction(Transaction transaction, RecordItem recordIte
return;
}

var transactionBody = recordItem.getTransactionBody().getCryptoAddLiveHash();
var liveHash = new LiveHash();
liveHash.setConsensusTimestamp(transaction.getConsensusTimestamp());
liveHash.setLivehash(toBytes(transactionBody.getLiveHash().getHash()));
liveHash.setLivehash(toBytes(getLiveHash(recordItem).getHash()));
entityListener.onLiveHash(liveHash);
}

@SuppressWarnings("deprecation")
private com.hederahashgraph.api.proto.java.LiveHash getLiveHash(RecordItem recordItem) {
return recordItem.getTransactionBody().getCryptoAddLiveHash().getLiveHash();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public TransactionType getType() {
}

@Override
@SuppressWarnings("deprecation")
public EntityId getEntity(RecordItem recordItem) {
return EntityId.of(
recordItem.getTransactionBody().getCryptoDeleteLiveHash().getAccountOfLiveHash());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,7 @@ public Builder<TokenWipeAccountTransactionBody.Builder> tokenWipe(TokenType type
return new Builder<>(TransactionType.TOKENWIPE, transactionBody).receipt(r -> r.setNewTotalSupply(2L));
}

@SuppressWarnings("deprecation")
public Builder<UncheckedSubmitBody.Builder> uncheckedSubmit() {
var transactionBody = UncheckedSubmitBody.newBuilder().setTransactionBytes(bytes(32));
return new Builder<>(TransactionType.UNCHECKEDSUBMIT, transactionBody);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,7 @@ void cryptoDeleteFailedTransaction() {
() -> assertThat(dbAccountEntity).isNotNull().returns(false, Entity::getDeleted));
}

@SuppressWarnings("deprecation")
@Test
void cryptoAddLiveHashPersist() {
Transaction transaction = cryptoAddLiveHashTransaction();
Expand Down Expand Up @@ -1087,6 +1088,7 @@ void cryptoAddLiveHashPersist() {
dbLiveHash.getLivehash()));
}

@SuppressWarnings("deprecation")
@Test
void cryptoAddLiveHashDoNotPersist() {
entityProperties.getPersist().setClaims(false);
Expand All @@ -1107,6 +1109,7 @@ void cryptoAddLiveHashDoNotPersist() {
() -> assertTransactionAndRecord(transactionBody, txnRecord));
}

@SuppressWarnings("deprecation")
@Test
void cryptoDeleteLiveHash() {
Transaction transactionAddLiveHash = cryptoAddLiveHashTransaction();
Expand Down Expand Up @@ -2036,6 +2039,7 @@ private Transaction cryptoCreateTransaction(CryptoCreateTransactionBody.Builder
return buildTransaction(builder -> builder.setCryptoCreateAccount(cryptoCreateBuilder));
}

@SuppressWarnings("deprecation")
private Transaction cryptoAddLiveHashTransaction() {
return buildTransaction(builder -> builder.getCryptoAddLiveHashBuilder()
.getLiveHashBuilder()
Expand All @@ -2045,6 +2049,7 @@ private Transaction cryptoAddLiveHashTransaction() {
.setKeys(KeyList.newBuilder().addKeys(keyFromString(KEY))));
}

@SuppressWarnings("deprecation")
private Transaction cryptoDeleteLiveHashTransaction() {
return buildTransaction(builder -> builder.getCryptoDeleteLiveHashBuilder()
.setAccountOfLiveHash(accountId1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@
package com.hedera.mirror.importer.parser.record.entity;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertAll;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import com.google.protobuf.ByteString;
import com.google.protobuf.StringValue;
Expand Down Expand Up @@ -1010,6 +1016,7 @@ private Transaction fileCreateTransaction() {
.build());
}

@SuppressWarnings("deprecation")
private Transaction fileCreateTransaction(Timestamp expirationTime) {
return buildTransaction(builder -> builder.getFileCreateBuilder()
.setContents(ByteString.copyFromUtf8("Hedera hashgraph is great!"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ void scheduleSignDuplicateEd25519Signatures() {
assertThat(transactionRepository.count()).isEqualTo(1);
}

@SuppressWarnings("deprecation")
@Test
void unknownSignatureType() {
int unknownType = 999;
Expand Down Expand Up @@ -462,6 +463,7 @@ private Transaction scheduledTransaction() {
.addAccountAmounts(accountAmount(NODE.getAccountNum(), 2000)));
}

@SuppressWarnings("deprecation")
private SignatureMap getSigMap(int signatureCount, boolean isEd25519) {
SignatureMap.Builder builder = SignatureMap.newBuilder();
String salt = RandomStringUtils.secure().nextAlphabetic(5);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ protected TransactionHandler getTransactionHandler() {
return new CryptoAddLiveHashTransactionHandler(entityListener, entityProperties);
}

@SuppressWarnings("deprecation")
@Override
protected TransactionBody.Builder getDefaultTransactionBody() {
return recordItemBuilder
Expand All @@ -48,6 +49,7 @@ protected EntityType getExpectedEntityIdType() {
return EntityType.ACCOUNT;
}

@SuppressWarnings("deprecation")
@Test
void updateTransaction() {
// Given
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ protected TransactionHandler getTransactionHandler() {
return new CryptoDeleteLiveHashTransactionHandler();
}

@SuppressWarnings("deprecation")
@Override
protected TransactionBody.Builder getDefaultTransactionBody() {
return TransactionBody.newBuilder()
Expand Down

0 comments on commit 6879055

Please sign in to comment.