Skip to content

Commit

Permalink
fix: integration tests against network tag 0.50.0 (#2290)
Browse files Browse the repository at this point in the history
* update: integration tests

Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>

* update: network tag

Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>

* chore: formatting

Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>

---------

Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
  • Loading branch information
svetoslav-nikol0v authored Jun 11, 2024
1 parent 58cb8f9 commit 1ec4527
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 45 deletions.
51 changes: 8 additions & 43 deletions test/integration/CustomFeesIntegrationTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
CustomFractionalFee,
CustomRoyaltyFee,
Hbar,
KeyList,
PrivateKey,
Status,
TokenAssociateTransaction,
Expand Down Expand Up @@ -812,7 +811,7 @@ describe("CustomFees", function () {
.setWipeKey(env.operatorKey)
.setSupplyKey(env.operatorKey)
.setFeeScheduleKey(env.operatorKey)
.setTokenType(TokenType.FungibleUnique)
.setTokenType(TokenType.FungibleCommon)
.setFreezeDefault(false)
.execute(env.client)
).getReceipt(env.client)
Expand Down Expand Up @@ -868,7 +867,7 @@ describe("CustomFees", function () {
.setWipeKey(env.operatorKey)
.setSupplyKey(env.operatorKey)
.setCustomFees([fee])
.setTokenType(TokenType.FungibleUnique)
.setTokenType(TokenType.FungibleCommon)
.setFreezeDefault(false)
.execute(env.client)
).getReceipt(env.client)
Expand Down Expand Up @@ -954,7 +953,7 @@ describe("CustomFees", function () {
.setWipeKey(env.operatorKey)
.setSupplyKey(env.operatorKey)
.setFeeScheduleKey(env.operatorKey)
.setTokenType(TokenType.FungibleUnique)
.setTokenType(TokenType.FungibleCommon)
.setFreezeDefault(false)
.execute(env.client)
).getReceipt(env.client)
Expand Down Expand Up @@ -1023,7 +1022,7 @@ describe("CustomFees", function () {
.setSupplyKey(env.operatorKey)
.setFeeScheduleKey(env.operatorKey)
.setCustomFees([fee])
.setTokenType(TokenType.FungibleUnique)
.setTokenType(TokenType.FungibleCommon)
.setFreezeDefault(false)
.execute(env.client)
).getReceipt(env.client);
Expand Down Expand Up @@ -1081,7 +1080,7 @@ describe("CustomFees", function () {
.setWipeKey(env.operatorKey)
.setSupplyKey(env.operatorKey)
.setFeeScheduleKey(env.operatorKey)
.setTokenType(TokenType.FungibleUnique)
.setTokenType(TokenType.FungibleCommon)
.setInitialSupply(100)
.setFreezeDefault(false)
.execute(env.client)
Expand All @@ -1105,7 +1104,7 @@ describe("CustomFees", function () {
.setWipeKey(env.operatorKey)
.setSupplyKey(env.operatorKey)
.setFeeScheduleKey(env.operatorKey)
.setTokenType(TokenType.FungibleUnique)
.setTokenType(TokenType.FungibleCommon)
.setInitialSupply(100)
.setCustomFees([fee2])
.setFreezeDefault(false)
Expand Down Expand Up @@ -1286,7 +1285,7 @@ describe("CustomFees", function () {
.setWipeKey(env.operatorKey)
.setSupplyKey(env.operatorKey)
.setFeeScheduleKey(env.operatorKey)
.setTokenType(TokenType.FungibleUnique)
.setTokenType(TokenType.FungibleCommon)
.setInitialSupply(100)
.setFreezeDefault(false)
.execute(env.client)
Expand All @@ -1310,7 +1309,7 @@ describe("CustomFees", function () {
.setWipeKey(env.operatorKey)
.setSupplyKey(env.operatorKey)
.setFeeScheduleKey(env.operatorKey)
.setTokenType(TokenType.FungibleUnique)
.setTokenType(TokenType.FungibleCommon)
.setInitialSupply(100)
.setCustomFees([fee2])
.setFreezeDefault(false)
Expand Down Expand Up @@ -1409,38 +1408,4 @@ describe("CustomFees", function () {

await env.close({ token: [token1, token2] });
});

it("cannot set invalid schedule key", async function () {
this.timeout(120000);

const env = await IntegrationTestEnv.new();

let err = false;

try {
await (
await new TokenCreateTransaction()
.setTokenName("ffff")
.setTokenSymbol("F")
.setTreasuryAccountId(env.operatorId)
.setAdminKey(env.operatorKey)
.setKycKey(env.operatorKey)
.setFreezeKey(env.operatorKey)
.setWipeKey(env.operatorKey)
.setSupplyKey(env.operatorKey)
.setFeeScheduleKey(KeyList.of())
.setTokenType(TokenType.NonFungibleUnique)
.setFreezeDefault(false)
.execute(env.client)
).getReceipt(env.client);
} catch (error) {
err = error.toString().includes(Status.InvalidCustomFeeScheduleKey);
}

if (!err) {
throw new Error("token creation did not error");
}

await env.close();
});
});
2 changes: 1 addition & 1 deletion test/integration/NftAllowancesIntegrationTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe("TokenNftAllowances", function () {
status = error.status;
}

expect(status).to.be.eql(Status.SpenderDoesNotHaveAllowance);
expect(status).to.be.eql(Status.TokenNotAssociatedToAccount);
});

it("Cannot transfer on behalf of `spender` account after removing the allowance approval", async function () {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/TokenAllowancesIntegrationTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe("TokenAllowances", function () {
status = error.status;
}

expect(status).to.be.eql(Status.SpenderDoesNotHaveAllowance);
expect(status).to.be.eql(Status.TokenNotAssociatedToAccount);
});

it("Can transfer on behalf of `spender` account with allowance approval", async function () {
Expand Down
1 change: 1 addition & 0 deletions test/integration/TokenUpdateIntegrationTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ describe("TokenUpdate", function () {
await (
await new TokenUpdateTransaction()
.setTokenId(token)
.setTokenName("FFFF")
.execute(env.client)
).getReceipt(env.client);
} catch (error) {
Expand Down

0 comments on commit 1ec4527

Please sign in to comment.