Skip to content

Commit b35fc3a

Browse files
authored
fix: Clear methods in TopicUpdateTransaction (#3265)
Signed-off-by: Ivan Ivanov <[email protected]>
1 parent e10aee0 commit b35fc3a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/topic/TopicUpdateTransaction.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,12 @@ export default class TopicUpdateTransaction extends Transaction {
439439
}
440440

441441
/**
442-
* Clears all keys that will be exempt from paying fees.
442+
* Clears all keys that will be exempt from paying fees, effectively removing them from the network state.
443443
* @returns {this}
444444
*/
445445
clearFeeExemptKeys() {
446446
this._requireNotFrozen();
447-
this._feeExemptKeys = null;
447+
this._feeExemptKeys = [];
448448

449449
return this;
450450
}
@@ -542,13 +542,13 @@ export default class TopicUpdateTransaction extends Transaction {
542542
}
543543

544544
/**
545-
* Clears fixed fees.
545+
* Clears fixed fees, effectively removing them from the network state.
546546
*
547547
* @returns {this}
548548
*/
549549
clearCustomFees() {
550550
this._requireNotFrozen();
551-
this._customFees = null;
551+
this._customFees = [];
552552

553553
return this;
554554
}

test/integration/TopicUpdateIntegrationTest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ describe("TopicUpdate", function () {
9090
// Update the topic and explicitly set fee exempt keys and custom fees to empty lists
9191
const updateResponse = await new TopicUpdateTransaction()
9292
.setTopicId(topicId)
93-
.setFeeExemptKeys([])
94-
.setCustomFees([])
93+
.clearCustomFees()
94+
.clearFeeExemptKeys()
9595
.execute(env.client);
9696

9797
await updateResponse.getReceipt(env.client);

test/unit/TopicUpdateTransaction.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe("TopicUpdateTransaction", function () {
9494

9595
topicUpdateTransaction.clearFeeExemptKeys();
9696

97-
expect(topicUpdateTransaction.getFeeExemptKeys()).to.be.null;
97+
expect(topicUpdateTransaction.getFeeExemptKeys().length).to.eql(0);
9898
});
9999

100100
it("should set topic custom fees", function () {
@@ -208,7 +208,7 @@ describe("TopicUpdateTransaction", function () {
208208

209209
topicUpdateTransaction.clearCustomFees();
210210

211-
expect(topicUpdateTransaction.getCustomFees()).to.be.null;
211+
expect(topicUpdateTransaction.getCustomFees().length).to.eql(0);
212212
});
213213

214214
it("should not include feeExemptKeyList in transaction data when feeExemptKeys is null", function () {

0 commit comments

Comments
 (0)