Skip to content

Commit

Permalink
updated the unit test
Browse files Browse the repository at this point in the history
Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
  • Loading branch information
svetoslav-nikol0v committed Jan 11, 2024
1 parent 305662b commit 7708b44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 62 deletions.
3 changes: 3 additions & 0 deletions test/integration/TokenUpdateIntegrationTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe("TokenUpdate", function () {
const key2 = PrivateKey.generateED25519();
const key3 = PrivateKey.generateED25519();
const key4 = PrivateKey.generateED25519();
const key5 = PrivateKey.generateED25519();

const response = await new TokenCreateTransaction()
.setTokenName("ffff")
Expand All @@ -41,6 +42,7 @@ describe("TokenUpdate", function () {
.setKycKey(key1)
.setFreezeKey(key2)
.setWipeKey(key3)
.setPauseKey(key5)
.setSupplyKey(key4)
.setFreezeDefault(false)
.execute(env.client);
Expand All @@ -64,6 +66,7 @@ describe("TokenUpdate", function () {
expect(info.freezeKey.toString()).to.eql(key2.publicKey.toString());
expect(info.wipeKey.toString()).to.eql(key3.publicKey.toString());
expect(info.supplyKey.toString()).to.eql(key4.publicKey.toString());
expect(info.pauseKey.toString()).to.eql(key5.pauseKey.toString());
expect(info.defaultFreezeStatus).to.be.false;
expect(info.defaultKycStatus).to.be.false;
expect(info.isDeleted).to.be.false;
Expand Down
62 changes: 0 additions & 62 deletions test/unit/TokenUpdateTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,66 +119,4 @@ describe("TokenUpdateTransaction", function () {
},
});
});

it("should set only pauseKey prop", function () {
const key4 = PrivateKey.fromStringDer(
"302e020100300506032b6570042204205a8571fe4badbc6bd76f03170f5ec4bdc69f2edb93f133477d0ef8f9e17a0f3a",
);

const transaction = new TokenUpdateTransaction()
.setTransactionId(
TransactionId.withValidStart(
new AccountId(1),
new Timestamp(2, 3),
),
)
.setNodeAccountIds([new AccountId(4)])
.setTransactionMemo("random memo")
.setPauseKey(key4)
.freeze();

const protobuf = transaction._makeTransactionBody();

expect(protobuf).to.deep.include({
tokenUpdate: {
token: null,
name: null,
symbol: null,
memo: null,
autoRenewAccount: null,
autoRenewPeriod: null,
expiry: null,
treasury: null,
adminKey: null,
kycKey: null,
freezeKey: null,
pauseKey: {
ed25519: key4.publicKey.toBytesRaw(),
},
wipeKey: null,
supplyKey: null,
feeScheduleKey: null,
},
transactionFee: Long.fromNumber(200000000),
memo: "random memo",
transactionID: {
accountID: {
accountNum: Long.fromNumber(1),
shardNum: Long.fromNumber(0),
realmNum: Long.fromNumber(0),
alias: null,
},
transactionValidStart: {
seconds: Long.fromNumber(2),
nanos: 3,
},
scheduled: false,
nonce: null,
},
nodeAccountID: null,
transactionValidDuration: {
seconds: Long.fromNumber(120),
},
})
});
});

0 comments on commit 7708b44

Please sign in to comment.