Skip to content

Commit

Permalink
Added getters and deprecated old ones (hiero-ledger#1329)
Browse files Browse the repository at this point in the history
  • Loading branch information
ochikov authored Nov 22, 2022
1 parent 0b75bec commit d3c684f
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/topic/TopicCreateTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,20 @@ export default class TopicCreateTransaction extends Transaction {
}

/**
* @deprecated - Use `getTopicMemo()` instead
* @returns {?string}
*/
get topicMemo() {
return this._topicMemo;
}

/**
* @returns {?string}
*/
getTopicMemo() {
return this._topicMemo;
}

/**
* @param {string} topicMemo
* @returns {this}
Expand All @@ -179,12 +187,20 @@ export default class TopicCreateTransaction extends Transaction {
}

/**
* @deprecated - Use `getAdminKey()` instead
* @returns {?Key}
*/
get adminKey() {
return this._adminKey;
}

/**
* @returns {?Key}
*/
getAdminKey() {
return this._adminKey;
}

/**
* @param {Key} adminKey
* @returns {this}
Expand All @@ -197,12 +213,20 @@ export default class TopicCreateTransaction extends Transaction {
}

/**
* @deprecated - Use `getSubmitKey()` instead
* @returns {?Key}
*/
get submitKey() {
return this._submitKey;
}

/**
* @returns {?Key}
*/
getSubmitKey() {
return this._submitKey;
}

/**
* @param {Key} submitKey
* @returns {this}
Expand All @@ -215,12 +239,20 @@ export default class TopicCreateTransaction extends Transaction {
}

/**
* @deprecated - Use `getAutoRenewAccountId()` instead
* @returns {?AccountId}
*/
get autoRenewAccountId() {
return this._autoRenewAccountId;
}

/**
* @returns {?AccountId}
*/
getAutoRenewAccountId() {
return this._autoRenewAccountId;
}

/**
* @param {AccountId | string} autoRenewAccountId
* @returns {this}
Expand All @@ -236,12 +268,20 @@ export default class TopicCreateTransaction extends Transaction {
}

/**
* @deprecated - Use `getAutoRenewPeriod()` instead
* @returns {Duration}
*/
get autoRenewPeriod() {
return this._autoRenewPeriod;
}

/**
* @returns {Duration}
*/
getAutoRenewPeriod() {
return this._autoRenewPeriod;
}

/**
* Set the auto renew period for this account.
*
Expand Down
24 changes: 24 additions & 0 deletions src/topic/TopicMessageSubmitTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,20 @@ export default class TopicMessageSubmitTransaction extends Transaction {
}

/**
* @deprecated - Use `getMessage()` instead
* @returns {?Uint8Array}
*/
get message() {
return this._message;
}

/**
* @returns {?Uint8Array}
*/
getMessage() {
return this._message;
}

/**
* @param {string | Uint8Array} message
* @returns {this}
Expand All @@ -181,12 +189,20 @@ export default class TopicMessageSubmitTransaction extends Transaction {
}

/**
* @deprecated - Use `getMaxChunks()` instead
* @returns {?number}
*/
get maxChunks() {
return this._maxChunks;
}

/**
* @returns {?number}
*/
getMaxChunks() {
return this._maxChunks;
}

/**
* @param {number} maxChunks
* @returns {this}
Expand All @@ -198,12 +214,20 @@ export default class TopicMessageSubmitTransaction extends Transaction {
}

/**
* @deprecated - Use `getChunkSize()` instead
* @returns {?number}
*/
get chunkSize() {
return this._chunkSize;
}

/**
* @returns {?number}
*/
getChunkSize() {
return this._chunkSize;
}

/**
* @param {number} chunkSize
* @returns {this}
Expand Down

0 comments on commit d3c684f

Please sign in to comment.