Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename packages in /sdk module #2045

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions scripts/premade/FeeDataType-0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* limitations under the License.
*
*/
package com.hedera.hashgraph.sdk;
package com.hiero.sdk;

import com.hedera.hashgraph.sdk.proto.SubType;
import com.hiero.sdk.proto.SubType;

/**
* Enum for the fee data types.
Expand Down
2 changes: 1 addition & 1 deletion scripts/premade/FreezeType-0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*
*/
package com.hedera.hashgraph.sdk;
package com.hiero.sdk;

/**
* Enum for the freeze types.
Expand Down
6 changes: 3 additions & 3 deletions scripts/premade/FreezeType-2.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
final com.hedera.hashgraph.sdk.proto.FreezeType code;
final com.hiero.sdk.proto.FreezeType code;

FreezeType(com.hedera.hashgraph.sdk.proto.FreezeType code) {
FreezeType(com.hiero.sdk.proto.FreezeType code) {
this.code = code;
}

static FreezeType valueOf(com.hedera.hashgraph.sdk.proto.FreezeType code) {
static FreezeType valueOf(com.hiero.sdk.proto.FreezeType code) {
return switch (code) {
4 changes: 2 additions & 2 deletions scripts/premade/RequestType-0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* limitations under the License.
*
*/
package com.hedera.hashgraph.sdk;
package com.hiero.sdk;

import com.hedera.hashgraph.sdk.proto.HederaFunctionality;
import com.hiero.sdk.proto.HederaFunctionality;

/**
* Enum for the request types.
Expand Down
4 changes: 2 additions & 2 deletions scripts/premade/Status-0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* limitations under the License.
*
*/
package com.hedera.hashgraph.sdk;
package com.hiero.sdk;

import com.hedera.hashgraph.sdk.proto.ResponseCodeEnum;
import com.hiero.sdk.proto.ResponseCodeEnum;

import java.util.Objects;

Expand Down
10 changes: 5 additions & 5 deletions scripts/update_protobufs.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def go_to_script_dir():
MAIN_PATH = os.path.join("..", "sdk", "src", "main")
PROTO_OUT_PATH = os.path.join(MAIN_PATH, "proto")
PROTO_MIRROR_OUT_PATH = os.path.join(PROTO_OUT_PATH, "mirror")
JAVA_OUT_PATH = os.path.join(MAIN_PATH, "java", "com", "hedera", "hashgraph", "sdk")
JAVA_OUT_PATH = os.path.join(MAIN_PATH, "java", "com", "hiero", "sdk")
REQUEST_TYPE_OUT_PATH = os.path.join(JAVA_OUT_PATH, "RequestType.java")
STATUS_OUT_PATH = os.path.join(JAVA_OUT_PATH, "Status.java")
FEE_DATA_TYPE_OUT_PATH = os.path.join(JAVA_OUT_PATH, "FeeDataType.java")
Expand Down Expand Up @@ -75,13 +75,13 @@ def go_to_script_dir():

PROTO_REPLACEMENTS = (
("option java_package = \"com.hederahashgraph.api.proto.java\";",
"option java_package = \"com.hedera.hashgraph.sdk.proto\";"),
"option java_package = \"com.hiero.sdk.proto\";"),

("option java_package = \"com.hederahashgraph.service.proto.java\";",
"option java_package = \"com.hedera.hashgraph.sdk.proto\";"),
"option java_package = \"com.hiero.sdk.proto\";"),

("option java_package = \"com.hedera.mirror.api.proto\";",
"option java_package = \"com.hedera.hashgraph.sdk.proto.mirror\";")
"option java_package = \"com.hiero.sdk.proto.mirror\";")
)

PROTO_REPLACEMENTS_IMPORTS = (
Expand Down Expand Up @@ -325,7 +325,7 @@ def add_to_FeeDataType(original_name, cap_snake_name, comment_lines):

def add_to_FreezeType(original_name, cap_snake_name, comment_lines):
FreezeType_sections[1] += \
generate_enum(original_name, cap_snake_name, comment_lines, "com.hedera.hashgraph.sdk.proto.FreezeType", 1)
generate_enum(original_name, cap_snake_name, comment_lines, "com.hiero.sdk.proto.FreezeType", 1)
FreezeType_sections[3] += generate_valueOf(original_name, cap_snake_name, 3)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
* limitations under the License.
*
*/
package com.hedera.hashgraph.sdk;
package com.hiero.sdk;

import com.google.protobuf.InvalidProtocolBufferException;
import com.hiero.sdk.proto.TokenTransferList;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
Expand All @@ -41,7 +42,7 @@ protected AbstractTokenTransferTransaction() {}
* @throws InvalidProtocolBufferException when there is an issue with the protobuf
*/
AbstractTokenTransferTransaction(
LinkedHashMap<TransactionId, LinkedHashMap<AccountId, com.hedera.hashgraph.sdk.proto.Transaction>> txs)
LinkedHashMap<TransactionId, LinkedHashMap<AccountId, com.hiero.sdk.proto.Transaction>> txs)
throws InvalidProtocolBufferException {
super(txs);
}
Expand All @@ -51,7 +52,7 @@ protected AbstractTokenTransferTransaction() {}
*
* @param txBody protobuf TransactionBody
*/
AbstractTokenTransferTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) {
AbstractTokenTransferTransaction(com.hiero.sdk.proto.TransactionBody txBody) {
super(txBody);
}

Expand Down Expand Up @@ -299,8 +300,8 @@ public T setNftTransferApproval(NftId nftId, boolean isApproved) {
return (T) this;
}

protected ArrayList<com.hedera.hashgraph.sdk.TokenTransferList> sortTransfersAndBuild() {
var transferLists = new ArrayList<com.hedera.hashgraph.sdk.TokenTransferList>();
protected ArrayList<com.hiero.sdk.TokenTransferList> sortTransfersAndBuild() {
var transferLists = new ArrayList<com.hiero.sdk.TokenTransferList>();

this.tokenTransfers.sort(Comparator.comparing((TokenTransfer a) -> a.tokenId).thenComparing(a -> a.accountId)
.thenComparing(a -> a.isApproved));
Expand Down Expand Up @@ -331,14 +332,14 @@ protected ArrayList<com.hedera.hashgraph.sdk.TokenTransferList> sortTransfersAnd
var result = iTokenId.compareTo(jTokenId);

if (result == 0) {
transferLists.add(new com.hedera.hashgraph.sdk.TokenTransferList(iTokenId,
transferLists.add(new com.hiero.sdk.TokenTransferList(iTokenId,
this.tokenTransfers.get(i).expectedDecimals, this.tokenTransfers.get(i++),
this.nftTransfers.get(j++)));
} else if (result < 0) {
transferLists.add(new com.hedera.hashgraph.sdk.TokenTransferList(iTokenId,
transferLists.add(new com.hiero.sdk.TokenTransferList(iTokenId,
this.tokenTransfers.get(i).expectedDecimals, this.tokenTransfers.get(i++), null));
} else {
transferLists.add(new com.hedera.hashgraph.sdk.TokenTransferList(jTokenId, null, null,
transferLists.add(new com.hiero.sdk.TokenTransferList(jTokenId, null, null,
this.nftTransfers.get(j++)));
}
} else if (i < this.tokenTransfers.size()) {
Expand All @@ -351,7 +352,7 @@ protected ArrayList<com.hedera.hashgraph.sdk.TokenTransferList> sortTransfersAnd
continue;
}

transferLists.add(new com.hedera.hashgraph.sdk.TokenTransferList(iTokenId,
transferLists.add(new com.hiero.sdk.TokenTransferList(iTokenId,
this.tokenTransfers.get(i).expectedDecimals, this.tokenTransfers.get(i++), null));
} else {
var jTokenId = this.nftTransfers.get(j).tokenId;
Expand All @@ -364,7 +365,7 @@ protected ArrayList<com.hedera.hashgraph.sdk.TokenTransferList> sortTransfersAnd
}

transferLists.add(
new com.hedera.hashgraph.sdk.TokenTransferList(jTokenId, null, null, this.nftTransfers.get(j++)));
new com.hiero.sdk.TokenTransferList(jTokenId, null, null, this.nftTransfers.get(j++)));
}
}
return transferLists;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
* limitations under the License.
*
*/
package com.hedera.hashgraph.sdk;
package com.hiero.sdk;

import com.google.protobuf.InvalidProtocolBufferException;
import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc;
import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody;
import com.hedera.hashgraph.sdk.proto.TransactionBody;
import com.hedera.hashgraph.sdk.proto.TransactionResponse;
import com.hiero.sdk.proto.CryptoServiceGrpc;
import com.hiero.sdk.proto.SchedulableTransactionBody;
import com.hiero.sdk.proto.TransactionBody;
import com.hiero.sdk.proto.TransactionResponse;
import io.grpc.MethodDescriptor;

import javax.annotation.Nonnegative;
Expand Down Expand Up @@ -55,13 +55,13 @@ public AccountAllowanceAdjustTransaction() {
}

AccountAllowanceAdjustTransaction(
LinkedHashMap<TransactionId, LinkedHashMap<AccountId, com.hedera.hashgraph.sdk.proto.Transaction>> txs
LinkedHashMap<TransactionId, LinkedHashMap<AccountId, com.hiero.sdk.proto.Transaction>> txs
) throws InvalidProtocolBufferException {
super(txs);
initFromTransactionBody();
}

AccountAllowanceAdjustTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) {
AccountAllowanceAdjustTransaction(com.hiero.sdk.proto.TransactionBody txBody) {
super(txBody);
initFromTransactionBody();
}
Expand Down Expand Up @@ -388,7 +388,7 @@ public List<TokenNftAllowance> getTokenNftAllowances() {
}

@Override
MethodDescriptor<com.hedera.hashgraph.sdk.proto.Transaction, TransactionResponse> getMethodDescriptor() {
MethodDescriptor<com.hiero.sdk.proto.Transaction, TransactionResponse> getMethodDescriptor() {
throw new UnsupportedOperationException("Cannot get method descriptor for AccountAllowanceAdjustTransaction");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
* limitations under the License.
*
*/
package com.hedera.hashgraph.sdk;
package com.hiero.sdk;

import com.google.protobuf.InvalidProtocolBufferException;
import com.hedera.hashgraph.sdk.proto.CryptoApproveAllowanceTransactionBody;
import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc;
import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody;
import com.hedera.hashgraph.sdk.proto.TransactionBody;
import com.hedera.hashgraph.sdk.proto.TransactionResponse;
import com.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody;
import com.hiero.sdk.proto.CryptoServiceGrpc;
import com.hiero.sdk.proto.SchedulableTransactionBody;
import com.hiero.sdk.proto.TransactionBody;
import com.hiero.sdk.proto.TransactionResponse;
import io.grpc.MethodDescriptor;

import javax.annotation.Nullable;
Expand Down Expand Up @@ -59,7 +59,7 @@ public AccountAllowanceApproveTransaction() {
* @param txs Compound list of transaction id's list of (AccountId, Transaction) records
*/
AccountAllowanceApproveTransaction(
LinkedHashMap<TransactionId, LinkedHashMap<AccountId, com.hedera.hashgraph.sdk.proto.Transaction>> txs
LinkedHashMap<TransactionId, LinkedHashMap<AccountId, com.hiero.sdk.proto.Transaction>> txs
) throws InvalidProtocolBufferException {
super(txs);
initFromTransactionBody();
Expand All @@ -70,7 +70,7 @@ public AccountAllowanceApproveTransaction() {
*
* @param txBody protobuf TransactionBody
*/
AccountAllowanceApproveTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) {
AccountAllowanceApproveTransaction(com.hiero.sdk.proto.TransactionBody txBody) {
super(txBody);
initFromTransactionBody();
}
Expand Down Expand Up @@ -439,14 +439,14 @@ public List<TokenNftAllowance> getTokenNftApprovals() {
}

@Override
MethodDescriptor<com.hedera.hashgraph.sdk.proto.Transaction, TransactionResponse> getMethodDescriptor() {
MethodDescriptor<com.hiero.sdk.proto.Transaction, TransactionResponse> getMethodDescriptor() {
return CryptoServiceGrpc.getApproveAllowancesMethod();
}

/**
* Build the correct transaction body.
*
* @return {@link com.hedera.hashgraph.sdk.proto.CryptoApproveAllowanceTransactionBody builder }
* @return {@link com.hiero.sdk.proto.CryptoApproveAllowanceTransactionBody builder }
*/
CryptoApproveAllowanceTransactionBody.Builder build() {
var builder = CryptoApproveAllowanceTransactionBody.newBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
* limitations under the License.
*
*/
package com.hedera.hashgraph.sdk;
package com.hiero.sdk;

import com.google.protobuf.InvalidProtocolBufferException;
import com.hedera.hashgraph.sdk.proto.CryptoDeleteAllowanceTransactionBody;
import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc;
import com.hedera.hashgraph.sdk.proto.SchedulableTransactionBody;
import com.hedera.hashgraph.sdk.proto.Transaction;
import com.hedera.hashgraph.sdk.proto.TransactionBody;
import com.hedera.hashgraph.sdk.proto.TransactionResponse;
import com.hiero.sdk.proto.CryptoDeleteAllowanceTransactionBody;
import com.hiero.sdk.proto.CryptoServiceGrpc;
import com.hiero.sdk.proto.SchedulableTransactionBody;
import com.hiero.sdk.proto.Transaction;
import com.hiero.sdk.proto.TransactionBody;
import com.hiero.sdk.proto.TransactionResponse;
import io.grpc.MethodDescriptor;

import javax.annotation.Nullable;
Expand All @@ -39,7 +39,7 @@
/**
* This transaction type is for deleting an account allowance.
*/
public class AccountAllowanceDeleteTransaction extends com.hedera.hashgraph.sdk.Transaction<AccountAllowanceDeleteTransaction> {
public class AccountAllowanceDeleteTransaction extends com.hiero.sdk.Transaction<AccountAllowanceDeleteTransaction> {
private final List<HbarAllowance> hbarAllowances = new ArrayList<>();
private final List<TokenAllowance> tokenAllowances = new ArrayList<>();
private final List<TokenNftAllowance> nftAllowances = new ArrayList<>();
Expand All @@ -59,7 +59,7 @@ public AccountAllowanceDeleteTransaction() {
* @throws InvalidProtocolBufferException when there is an issue with the protobuf
*/
AccountAllowanceDeleteTransaction(
LinkedHashMap<TransactionId, LinkedHashMap<AccountId, com.hedera.hashgraph.sdk.proto.Transaction>> txs
LinkedHashMap<TransactionId, LinkedHashMap<AccountId, com.hiero.sdk.proto.Transaction>> txs
) throws InvalidProtocolBufferException {
super(txs);
initFromTransactionBody();
Expand All @@ -70,7 +70,7 @@ public AccountAllowanceDeleteTransaction() {
*
* @param txBody protobuf TransactionBody
*/
AccountAllowanceDeleteTransaction(com.hedera.hashgraph.sdk.proto.TransactionBody txBody) {
AccountAllowanceDeleteTransaction(com.hiero.sdk.proto.TransactionBody txBody) {
super(txBody);
initFromTransactionBody();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
* limitations under the License.
*
*/
package com.hedera.hashgraph.sdk;
package com.hiero.sdk;

import com.google.common.base.MoreObjects;
import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException;
import com.hedera.hashgraph.sdk.proto.CryptoGetAccountBalanceResponse;
import com.hedera.hashgraph.sdk.proto.TokenBalance;
import com.hiero.sdk.proto.CryptoGetAccountBalanceResponse;
import com.hiero.sdk.proto.TokenBalance;

import javax.annotation.Nonnegative;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
* limitations under the License.
*
*/
package com.hedera.hashgraph.sdk;
package com.hiero.sdk;

import com.hedera.hashgraph.sdk.proto.CryptoGetAccountBalanceQuery;
import com.hedera.hashgraph.sdk.proto.CryptoServiceGrpc;
import com.hedera.hashgraph.sdk.proto.QueryHeader;
import com.hedera.hashgraph.sdk.proto.Response;
import com.hedera.hashgraph.sdk.proto.ResponseHeader;
import com.hiero.sdk.proto.CryptoGetAccountBalanceQuery;
import com.hiero.sdk.proto.CryptoServiceGrpc;
import com.hiero.sdk.proto.QueryHeader;
import com.hiero.sdk.proto.Response;
import com.hiero.sdk.proto.ResponseHeader;
import io.grpc.MethodDescriptor;

import javax.annotation.Nullable;
Expand Down Expand Up @@ -112,7 +112,7 @@ boolean isPaymentRequired() {
}

@Override
void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, QueryHeader header) {
void onMakeRequest(com.hiero.sdk.proto.Query.Builder queryBuilder, QueryHeader header) {
var builder = CryptoGetAccountBalanceQuery.newBuilder();
if (accountId != null) {
builder.setAccountID(accountId.toProtobuf());
Expand All @@ -126,7 +126,7 @@ void onMakeRequest(com.hedera.hashgraph.sdk.proto.Query.Builder queryBuilder, Qu
}

@Override
AccountBalance mapResponse(Response response, AccountId nodeId, com.hedera.hashgraph.sdk.proto.Query request) {
AccountBalance mapResponse(Response response, AccountId nodeId, com.hiero.sdk.proto.Query request) {
return AccountBalance.fromProtobuf(response.getCryptogetAccountBalance());
}

Expand All @@ -136,12 +136,12 @@ ResponseHeader mapResponseHeader(Response response) {
}

@Override
QueryHeader mapRequestHeader(com.hedera.hashgraph.sdk.proto.Query request) {
QueryHeader mapRequestHeader(com.hiero.sdk.proto.Query request) {
return request.getCryptogetAccountBalance().getHeader();
}

@Override
MethodDescriptor<com.hedera.hashgraph.sdk.proto.Query, Response> getMethodDescriptor() {
MethodDescriptor<com.hiero.sdk.proto.Query, Response> getMethodDescriptor() {
return CryptoServiceGrpc.getCryptoGetBalanceMethod();
}
}
Loading
Loading