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(TCK): Account transactions int64 props modify #2720

Merged
merged 4 commits into from
Dec 16, 2024
Merged
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
5 changes: 2 additions & 3 deletions packages/proto/src/proto/services/node_create.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import "basic_types.proto";
* address book. The transaction, once complete, enables a new consensus node
* to join the network, and requires governing council authorization.
*
* - A `NodeCreateTransactionBody` MUST be signed by the governing council.
* - A `NodeCreateTransactionBody` MUST be signed by the `Key` assigned to the
* `admin_key` field.
* `admin_key` field and one of those keys: treasure account (2) key,
* systemAdmin(50) key, or addressBookAdmin(55) key.
* - The newly created node information SHALL be added to the network address
* book information in the network state.
* - The new entry SHALL be created in "state" but SHALL NOT participate in
Expand Down Expand Up @@ -132,7 +132,6 @@ message NodeCreateTransactionBody {
* An administrative key controlled by the node operator.
* <p>
* This key MUST sign this transaction.<br/>
* This key MUST sign each transaction to update this node.<br/>
* This field MUST contain a valid `Key` value.<br/>
* This field is REQUIRED and MUST NOT be set to an empty `KeyList`.
*/
Expand Down
30 changes: 0 additions & 30 deletions packages/proto/src/proto/services/token_get_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -209,36 +209,6 @@ message TokenInfo {
* (token definition and individual NFTs).
*/
Key metadata_key = 28;

/**
* A function-specific account key.<br/>
* This key authorizes transactions to lock tokens in an account or account
* partition.
* <p>
* The key SHALL be used to authorize the locking and unlocking of tokens,
* or the transfer of locked tokens on balances held by the user
* on their account, or on the partition in their account.
*/
Key lock_key = 29;

/**
* A function-specific account key.<br/>
* This key authorizes transactions to partition fungible tokens and NFTs
* held by an account.
* <p>
* This key SHALL be used to authorize the creation, deletion, or updating
* of partition definitions owned by the token definition.
*/
Key partition_key = 30;

/**
* A function-specific account key.<br/>
* This key authorizes transactions to move tokens between partitions.
* <p>
* This key SHALL be used to authorize the movement of tokens between
* partitions.
*/
Key partition_move_key = 31;
}

/**
Expand Down
15 changes: 9 additions & 6 deletions tck/methods/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import {
AccountId,
AccountUpdateTransaction,
AccountDeleteTransaction,
Timestamp,
} from "@hashgraph/sdk";
import Long from "long";

import { sdk } from "../sdk_data";
import { AccountResponse } from "../response/account";
Expand Down Expand Up @@ -59,7 +61,7 @@ export const createAccount = async ({
}

if (stakedNodeId != null) {
transaction.setStakedNodeId(stakedNodeId);
transaction.setStakedNodeId(Long.fromString(stakedNodeId));
}

if (declineStakingReward != null) {
Expand All @@ -71,7 +73,7 @@ export const createAccount = async ({
}

if (autoRenewPeriod != null) {
transaction.setAutoRenewPeriod(autoRenewPeriod);
transaction.setAutoRenewPeriod(Long.fromString(autoRenewPeriod));
}

if (alias != null) {
Expand Down Expand Up @@ -135,12 +137,13 @@ export const updateAccount = async ({
}

if (stakedNodeId != null) {
transaction.setStakedNodeId(stakedNodeId);
transaction.setStakedNodeId(Long.fromString(stakedNodeId));
}

if (expirationTime != null) {
const expirationTimeInSeconds = new Date(expirationTime * 1000);
transaction.setExpirationTime(expirationTimeInSeconds);
transaction.setExpirationTime(
new Timestamp(Long.fromString(expirationTime), 0),
);
}

if (declineStakingReward != null) {
Expand All @@ -152,7 +155,7 @@ export const updateAccount = async ({
}

if (autoRenewPeriod != null) {
transaction.setAutoRenewPeriod(autoRenewPeriod);
transaction.setAutoRenewPeriod(Long.fromString(autoRenewPeriod));
}

if (commonTransactionParams != null) {
Expand Down
5 changes: 4 additions & 1 deletion tck/methods/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
CustomFixedFee,
CustomFractionalFee,
CustomRoyaltyFee,
Timestamp,
TokenCreateTransaction,
TokenDeleteTransaction,
TokenUpdateTransaction,
Expand Down Expand Up @@ -103,7 +104,9 @@ export const createToken = async ({
}

if (expirationTime != null) {
transaction.setExpirationTime(new Date(Number(expirationTime) * 1000));
transaction.setExpirationTime(
new Timestamp(Long.fromString(expirationTime), 0),
);
}

if (autoRenewAccountId != null) {
Expand Down
10 changes: 5 additions & 5 deletions tck/params/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ export interface CreateAccountParams {
readonly maxAutoTokenAssociations?: number;
readonly commonTransactionParams?: Record<string, any>;
readonly stakedAccountId?: string;
readonly stakedNodeId?: number;
readonly stakedNodeId?: string;
readonly declineStakingReward?: boolean;
readonly memo?: string;
readonly autoRenewPeriod?: number;
readonly autoRenewPeriod?: string;
readonly alias?: string;
}

export interface UpdateAccountParams {
readonly accountId?: string;
readonly key?: string;
readonly autoRenewPeriod?: number;
readonly expirationTime?: number;
readonly autoRenewPeriod?: string;
readonly expirationTime?: string;
readonly receiverSignatureRequired?: boolean;
readonly memo?: string;
readonly maxAutoTokenAssociations?: number;
readonly stakedAccountId?: string;
readonly stakedNodeId?: number;
readonly stakedNodeId?: string;
readonly declineStakingReward?: boolean;
readonly commonTransactionParams?: Record<string, any>;
}
Expand Down