Skip to content

Commit

Permalink
chore: adjustments
Browse files Browse the repository at this point in the history
Signed-off-by: svetoslav-nikol0v <[email protected]>
  • Loading branch information
svetoslav-nikol0v committed Apr 25, 2024
1 parent b83368f commit 3c0c3ee
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/Status.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,8 @@ export default class Status {
return "MISSING_TOKEN_METADATA";
case Status.MissingSerialNumbers:
return "MISSING_SERIAL_NUMBERS";
case Status.TokenHasNoAdminKey:
return "TOKEN_HAS_NO_ADMIN_KEY";
default:
return `UNKNOWN (${this._code})`;
}
Expand Down Expand Up @@ -1233,6 +1235,8 @@ export default class Status {
return Status.MissingTokenMetadata;
case 336:
return Status.MissingSerialNumbers;
case 337:
return Status.TokenHasNoAdminKey;
default:
throw new Error(
`(BUG) Status.fromCode() does not handle code: ${code}`,
Expand Down Expand Up @@ -2764,3 +2768,8 @@ Status.MissingTokenMetadata = new Status(335);
* NFT serial numbers are missing in the TokenUpdateNftsTransactionBody
*/
Status.MissingSerialNumbers = new Status(336);

/**
* Admin key is not set on token
*/
Status.TokenHasNoAdminKey = new Status(337);
4 changes: 2 additions & 2 deletions src/token/TokenWipeTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default class TokenWipeTransaction extends Transaction {

/**
* @private
* @type {Long[]}
* @type {?Long[]}
*/
this._serials = [];

Expand Down Expand Up @@ -217,7 +217,7 @@ export default class TokenWipeTransaction extends Transaction {
}

/**
* @returns {Long[]}
* @returns {?Long[]}
*/
get serials() {
return this._serials;
Expand Down
3 changes: 2 additions & 1 deletion test/integration/TokenWipeIntegrationTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ describe("TokenWipe", function () {
.toBytes();

const restoredTransaction = Transaction.fromBytes(transaction);
expect(restoredTransaction._serials).to.deep.equal([

expect(restoredTransaction._serials).to.deep.include.members([
Long.fromNumber(1),
Long.fromNumber(2),
Long.fromNumber(3),
Expand Down
1 change: 1 addition & 0 deletions test/unit/Status.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Status } from "../../src/exports.js";

describe("Status", function () {
it("has all the response codes", function () {
console.log(HashgraphProto.proto.ResponseCodeEnum);
for (const [s, code] of Object.entries(
HashgraphProto.proto.ResponseCodeEnum,
)) {
Expand Down

0 comments on commit 3c0c3ee

Please sign in to comment.