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: update protos to v0.59.0 #2216

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions scripts/update_protobufs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def go_to_script_dir():


PROTO_GIT_REMOTE = "https://github.com/hashgraph/hedera-services.git"
PROTO_GIT_PATH = os.path.join("hiero-protos-git")
PROTO_GIT_PATH = os.path.join("hedera-protos-git")
PROTO_GIT_REF = sys.argv[1] if len(sys.argv)>1 else ""


Expand All @@ -43,10 +43,10 @@ def go_to_script_dir():
FREEZE_TYPE_PATH = os.path.join(PROTO_IN_PATH, "freeze_type.proto")


MAIN_PATH = os.path.join("..", "sdk-java", "src", "main")
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", "org", "hiero", "sdk", "java")
JAVA_OUT_PATH = os.path.join(MAIN_PATH, "java", "com", "hedera", "hashgraph", "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 @@ -100,7 +100,7 @@ def do_replacements_proto_imports(s, replacements):
for r in replacements:
# Check if the replacement should be skipped
# Skip statements like `import "google/protobuf/wrappers.proto"`
# to update imports ONLY referred to hiero protobufs
# to update imports ONLY referred to hedera protobufs
if 'google' in s:
continue
s = re.sub(r[0], r[1], s)
Expand Down Expand Up @@ -136,7 +136,7 @@ def ensure_protobufs():
run_command("git", "clone", PROTO_GIT_REMOTE, PROTO_GIT_PATH)
os.chdir(PROTO_GIT_PATH)
run_command("git", "fetch")
checkout_ref = PROTO_GIT_REF if PROTO_GIT_REF else get_latest_tag()
checkout_ref = "v0.59.0-alpha.0"
print(f">>> Checking out {checkout_ref}")
run_command("git", "checkout", checkout_ref)
if is_branch(checkout_ref):
Expand Down Expand Up @@ -298,11 +298,6 @@ def output_java_file(out_path, section_list):
out_file.write(section)
out_file.close()






def add_to_RequestType(original_name, cap_snake_name, comment_lines):
RequestType_sections[1] += \
generate_enum(original_name, cap_snake_name, comment_lines, "HederaFunctionality", 1)
Expand Down

This file was deleted.

29 changes: 20 additions & 9 deletions sdk/src/main/java/com/hedera/hashgraph/sdk/FeeDataType.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,45 @@
*/
public enum FeeDataType {
/**
* The resource prices have no special scope
* The resource cost for the transaction type has no additional attributes
*/
DEFAULT(SubType.DEFAULT),

/**
* The resource prices are scoped to an operation on a fungible common token
* The resource cost for the transaction type includes an operation on a
* fungible/common token
*/
TOKEN_FUNGIBLE_COMMON(SubType.TOKEN_FUNGIBLE_COMMON),

/**
* The resource prices are scoped to an operation on a non-fungible unique token
* The resource cost for the transaction type includes an operation on
* a non-fungible/unique token
*/
TOKEN_NON_FUNGIBLE_UNIQUE(SubType.TOKEN_NON_FUNGIBLE_UNIQUE),

/**
* The resource prices are scoped to an operation on a fungible common
* token with a custom fee schedule
* The resource cost for the transaction type includes an operation on a
* fungible/common token with a custom fee schedule
*/
TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES(SubType.TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES),

/**
* The resource prices are scoped to an operation on a non-fungible unique
* token with a custom fee schedule
* The resource cost for the transaction type includes an operation on a
* non-fungible/unique token with a custom fee schedule
*/
TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES(SubType.TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES),

/**
* The resource prices are scoped to a ScheduleCreate containing a ContractCall.
* The resource cost for the transaction type includes a ScheduleCreate
* containing a ContractCall.
*/
SCHEDULE_CREATE_CONTRACT_CALL(SubType.SCHEDULE_CREATE_CONTRACT_CALL);
SCHEDULE_CREATE_CONTRACT_CALL(SubType.SCHEDULE_CREATE_CONTRACT_CALL),

/**
* The resource cost for the transaction type includes a TopicCreate
* with custom fees.
*/
TOPIC_CREATE_WITH_CUSTOM_FEES(SubType.TOPIC_CREATE_WITH_CUSTOM_FEES);

final SubType code;

Expand All @@ -53,6 +62,7 @@ static FeeDataType valueOf(SubType code) {
case TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES -> TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES;
case TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES -> TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES;
case SCHEDULE_CREATE_CONTRACT_CALL -> SCHEDULE_CREATE_CONTRACT_CALL;
case TOPIC_CREATE_WITH_CUSTOM_FEES -> TOPIC_CREATE_WITH_CUSTOM_FEES;
default -> throw new IllegalStateException("(BUG) unhandled SubType (FeeDataType)");
};
}
Expand All @@ -66,6 +76,7 @@ public String toString() {
case TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES -> "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES";
case TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES -> "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES";
case SCHEDULE_CREATE_CONTRACT_CALL -> "SCHEDULE_CREATE_CONTRACT_CALL";
case TOPIC_CREATE_WITH_CUSTOM_FEES -> "TOPIC_CREATE_WITH_CUSTOM_FEES";
};
}
}
83 changes: 69 additions & 14 deletions sdk/src/main/java/com/hedera/hashgraph/sdk/FreezeType.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,95 @@
*/
public enum FreezeType {
/**
* An (invalid) default value for this enum, to ensure the client explicitly sets
* the intended type of freeze transaction.
* An invalid freeze type.
* <p>
* The first value in a protobuf enum is a default value. This default
* is RECOMMENDED to be an invalid value to aid in detecting unset fields.
*/
UNKNOWN_FREEZE_TYPE(com.hedera.hashgraph.sdk.proto.FreezeType.UNKNOWN_FREEZE_TYPE),

/**
* Freezes the network at the specified time. The start_time field must be provided and
* must reference a future time. Any values specified for the update_file and file_hash
* fields will be ignored. This transaction does not perform any network changes or
* upgrades and requires manual intervention to restart the network.
* Freeze the network, and take no further action.
* <p>
* The `start_time` field is REQUIRED, MUST be strictly later than the
* consensus time when this transaction is handled, and SHOULD be between
* `300` and `3600` seconds after the transaction identifier
* `transactionValidStart` field.<br/>
* The fields `update_file` and `file_hash` SHALL be ignored.<br/>
* A `FREEZE_ONLY` transaction SHALL NOT perform any network
* changes or upgrades.<br/>
* After this freeze is processed manual intervention is REQUIRED
* to restart the network.
*/
FREEZE_ONLY(com.hedera.hashgraph.sdk.proto.FreezeType.FREEZE_ONLY),

/**
* A non-freezing operation that initiates network wide preparation in advance of a
* scheduled freeze upgrade. The update_file and file_hash fields must be provided and
* valid. The start_time field may be omitted and any value present will be ignored.
* This freeze type does not freeze the network, but begins
* "preparation" to upgrade the network.
* <p>
* The fields `update_file` and `file_hash` are REQUIRED
* and MUST be valid.<br/>
* The `start_time` field SHALL be ignored.<br/>
* A `PREPARE_UPGRADE` transaction SHALL NOT freeze the network or
* interfere with general transaction processing.<br/>
* If this freeze type is initiated after a `TELEMETRY_UPGRADE`, the
* prepared telemetry upgrade SHALL be reset and all telemetry upgrade
* artifacts in the filesystem SHALL be deleted.<br/>
* At some point after this freeze type completes (dependent on the size
* of the upgrade file), the network SHALL be prepared to complete
* a software upgrade of all nodes.
*/
PREPARE_UPGRADE(com.hedera.hashgraph.sdk.proto.FreezeType.PREPARE_UPGRADE),

/**
* Freezes the network at the specified time and performs the previously prepared
* automatic upgrade across the entire network.
* Freeze the network to perform a software upgrade.
* <p>
* The `start_time` field is REQUIRED, MUST be strictly later than the
* consensus time when this transaction is handled, and SHOULD be between
* `300` and `3600` seconds after the transaction identifier
* `transactionValidStart` field.<br/>
* A software upgrade file MUST be prepared prior to this transaction.<br/>
* After this transaction completes, the network SHALL initiate an
* upgrade and restart of all nodes at the start time specified.
*/
FREEZE_UPGRADE(com.hedera.hashgraph.sdk.proto.FreezeType.FREEZE_UPGRADE),

/**
* Aborts a pending network freeze operation.
* Abort a pending network freeze operation.
* <p>
* All fields SHALL be ignored for this freeze type.<br/>
* This freeze type MAY be submitted after a `FREEZE_ONLY`,
* `FREEZE_UPGRADE`, or `TELEMETRY_UPGRADE` is initiated.<br/>
* This freeze type MUST be submitted and reach consensus
* before the `start_time` designated for the current pending
* freeze to be effective.<br/>
* After this freeze type is processed, the upgrade file hash
* and pending freeze start time stored in the network SHALL
* be reset to default (empty) values.
*/
FREEZE_ABORT(com.hedera.hashgraph.sdk.proto.FreezeType.FREEZE_ABORT),

/**
* Performs an immediate upgrade on auxilary services and containers providing
* telemetry/metrics. Does not impact network operations.
* Prepare an upgrade of auxiliary services and containers
* providing telemetry/metrics.
* <p>
* The `start_time` field is REQUIRED, MUST be strictly later than the
* consensus time when this transaction is handled, and SHOULD be between
* `300` and `3600` seconds after the transaction identifier
* `transactionValidStart` field.<br/>
* The `update_file` field is REQUIRED and MUST be valid.<br/>
* A `TELEMETRY_UPGRADE` transaction SHALL NOT freeze the network or
* interfere with general transaction processing.<br/>
* This freeze type MUST NOT be initiated between a `PREPARE_UPGRADE`
* and `FREEZE_UPGRADE`. If this freeze type is initiated after a
* `PREPARE_UPGRADE`, the prepared upgrade SHALL be reset and all software
* upgrade artifacts in the filesystem SHALL be deleted.<br/>
* At some point after this freeze type completes (dependent on the
* size of the upgrade file), the network SHALL automatically upgrade
* the telemetry/metrics services and containers as directed in
* the specified telemetry upgrade file.
* <blockquote> The condition that `start_time` is REQUIRED is an
* historical anomaly and SHOULD change in a future release.</blockquote>
*/
TELEMETRY_UPGRADE(com.hedera.hashgraph.sdk.proto.FreezeType.TELEMETRY_UPGRADE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@
import javax.annotation.Nullable;

/**
* @deprecated
* This transaction is obsolete, not supported, and SHALL fail with a
* pre-check result of `NOT_SUPPORTED`.
* A hash---presumably of some kind of credential or certificate---along with a list of keys,
* each of which may be either a primitive or a threshold key.
*/
@Deprecated
public final class LiveHashAddTransaction extends Transaction<LiveHashAddTransaction> {
@Nullable
private AccountId accountId = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@
import javax.annotation.Nullable;

/**
* @deprecated
* This transaction is obsolete, not supported, and SHALL fail with a
* pre-check result of `NOT_SUPPORTED`.
* At consensus, deletes a livehash associated to the given account. The transaction must be signed
* by either the key of the owning account, or at least one of the keys associated to the livehash.
*/
@Deprecated
public final class LiveHashDeleteTransaction extends Transaction<LiveHashDeleteTransaction> {
@Nullable
private AccountId accountId = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
import javax.annotation.Nullable;

/**
* @deprecated This query is no longer supported.
* Requests a livehash associated to an account.
*/
@Deprecated
public final class LiveHashQuery extends Query<LiveHash, LiveHashQuery> {
@Nullable
private AccountId accountId = null;
Expand Down
Loading