Skip to content

Commit 0da588f

Browse files
committed
chore: lint/fmt fixes
1 parent 95fb1b4 commit 0da588f

8 files changed

Lines changed: 41 additions & 44 deletions

File tree

src/contract/spec.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,12 @@ function unionToJsonSchema(udt: ScSpecUdtUnionV0): any {
480480

481481
/**
482482
* Provides a ContractSpec class which can contains the XDR types defined by the contract.
483-
* This allows the class to be used to convert between native and raw `xdr.ScVal`s.
483+
* This allows the class to be used to convert between native and raw `ScVal`s.
484484
*
485485
* Constructs a new ContractSpec from an array of XDR spec entries.
486486
*
487487
* @memberof module:contract
488-
* @param {xdr.ScSpecEntry[] | string[]} entries the XDR spec entries
488+
* @param {ScSpecEntry[] | string[]} entries the XDR spec entries
489489
* @throws {Error} if entries is invalid
490490
*
491491
* @example
@@ -527,11 +527,11 @@ export class Spec {
527527

528528
/**
529529
* Generates a Spec instance from contract specs in any of the following forms:
530-
* - An XDR encoded stream of xdr.ScSpecEntry entries, the format of the spec
530+
* - An XDR encoded stream of ScSpecEntry entries, the format of the spec
531531
* stored inside Wasm files.
532-
* - A base64 XDR encoded stream of xdr.ScSpecEntry entries.
533-
* - An array of xdr.ScSpecEntry.
534-
* - An array of base64 XDR encoded xdr.ScSpecEntry.
532+
* - A base64 XDR encoded stream of ScSpecEntry entries.
533+
* - An array of ScSpecEntry.
534+
* - An array of base64 XDR encoded ScSpecEntry.
535535
*
536536
* @returns {Promise<module:contract.Client>} A Promise that resolves to a Client instance.
537537
* @throws {Error} If the contract spec cannot be obtained from the provided wasm binary.
@@ -558,7 +558,7 @@ export class Spec {
558558

559559
/**
560560
* Gets the XDR functions from the spec.
561-
* @returns {xdr.ScSpecFunctionV0[]} all contract functions
561+
* @returns {ScSpecFunctionV0[]} all contract functions
562562
*/
563563
funcs(): ScSpecFunctionV0[] {
564564
return this.entries
@@ -570,7 +570,7 @@ export class Spec {
570570
* Gets the XDR function spec for the given function name.
571571
*
572572
* @param {string} name the name of the function
573-
* @returns {xdr.ScSpecFunctionV0} the function spec
573+
* @returns {ScSpecFunctionV0} the function spec
574574
*
575575
* @throws {Error} if no function with the given name exists
576576
*/
@@ -587,7 +587,7 @@ export class Spec {
587587
*
588588
* @param {string} name the name of the function
589589
* @param {object} args the arguments object
590-
* @returns {xdr.ScVal[]} the converted arguments
590+
* @returns {ScVal[]} the converted arguments
591591
*
592592
* @throws {Error} if argument is missing or incorrect type
593593
*
@@ -609,7 +609,7 @@ export class Spec {
609609
* Converts the result ScVal of a function call to a native JS value.
610610
*
611611
* @param {string} name the name of the function
612-
* @param {xdr.ScVal | string} val_or_base64 the result ScVal or base64 encoded string
612+
* @param {ScVal | string} val_or_base64 the result ScVal or base64 encoded string
613613
* @returns {any} the converted native value
614614
*
615615
* @throws {Error} if return type mismatch or invalid input
@@ -650,7 +650,7 @@ export class Spec {
650650
* Finds the XDR spec entry for the given name.
651651
*
652652
* @param {string} name the name to find
653-
* @returns {xdr.ScSpecEntry} the entry
653+
* @returns {ScSpecEntry} the entry
654654
*
655655
* @throws {Error} if no entry with the given name exists
656656
*/
@@ -674,8 +674,8 @@ export class Spec {
674674
* Converts a native JS value to an ScVal based on the given type.
675675
*
676676
* @param {any} val the native JS value
677-
* @param {xdr.ScSpecTypeDef} [ty] the expected type
678-
* @returns {xdr.ScVal} the converted ScVal
677+
* @param {ScSpecTypeDef} [ty] the expected type
678+
* @returns {ScVal} the converted ScVal
679679
*
680680
* @throws {Error} if value cannot be converted to the given type
681681
*/
@@ -973,7 +973,7 @@ export class Spec {
973973
* Converts an base64 encoded ScVal back to a native JS value based on the given type.
974974
*
975975
* @param {string} scv the base64 encoded ScVal
976-
* @param {xdr.ScSpecTypeDef} typeDef the expected type
976+
* @param {ScSpecTypeDef} typeDef the expected type
977977
* @returns {any} the converted native JS value
978978
*
979979
* @throws {Error} if ScVal cannot be converted to the given type
@@ -985,8 +985,8 @@ export class Spec {
985985
/**
986986
* Converts an ScVal back to a native JS value based on the given type.
987987
*
988-
* @param {xdr.ScVal} scv the ScVal
989-
* @param {xdr.ScSpecTypeDef} typeDef the expected type
988+
* @param {ScVal} scv the ScVal
989+
* @param {ScSpecTypeDef} typeDef the expected type
990990
* @returns {any} the converted native JS value
991991
*
992992
* @throws {Error} if ScVal cannot be converted to the given type

src/rpc/api.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export namespace Api {
3434

3535
export interface RawLedgerEntryResult {
3636
lastModifiedLedgerSeq?: number;
37-
/** a base-64 encoded {@link xdr.LedgerKey} instance */
37+
/** a base-64 encoded {@link LedgerKey} instance */
3838
key: string;
39-
/** a base-64 encoded {@link xdr.LedgerEntryData} instance */
39+
/** a base-64 encoded {@link LedgerEntryData} instance */
4040
xdr: string;
4141
/**
4242
* optional, a future ledger number upon which this entry will expire
@@ -79,9 +79,9 @@ export namespace Api {
7979
sequence: number;
8080
protocolVersion: string;
8181
closeTime: string;
82-
/** a base-64 encoded {@link xdr.LedgerHeader} instance */
82+
/** a base-64 encoded {@link LedgerHeader} instance */
8383
headerXdr: string;
84-
/** a base-64 encoded {@link xdr.LedgerCloseMeta} instance */
84+
/** a base-64 encoded {@link LedgerCloseMeta} instance */
8585
metadataXdr: string;
8686
}
8787

@@ -343,9 +343,9 @@ export namespace Api {
343343
type: number;
344344
/** This is LedgerKey in base64 */
345345
key: string;
346-
/** This is xdr.LedgerEntry in base64 */
346+
/** This is LedgerEntry in base64 */
347347
before: string | null;
348-
/** This is xdr.LedgerEntry in base64 */
348+
/** This is LedgerEntry in base64 */
349349
after: string | null;
350350
}
351351

@@ -369,15 +369,15 @@ export namespace Api {
369369

370370
export interface RawSendTransactionResponse extends BaseSendTransactionResponse {
371371
/**
372-
* This is a base64-encoded instance of {@link xdr.TransactionResult}, set
372+
* This is a base64-encoded instance of {@link TransactionResult}, set
373373
* only when `status` is `"ERROR"`.
374374
*
375375
* It contains details on why the network rejected the transaction.
376376
*/
377377
errorResultXdr?: string;
378378
/**
379379
* This is a base64-encoded instance of an array of
380-
* {@link xdr.DiagnosticEvent}s, set only when `status` is `"ERROR"` and
380+
* {@link DiagnosticEvent}s, set only when `status` is `"ERROR"` and
381381
* diagnostic events are enabled on the server.
382382
*/
383383
diagnosticEventsXdr?: string[];
@@ -530,9 +530,9 @@ export namespace Api {
530530
id: string;
531531
latestLedger: number;
532532
error?: string;
533-
/** This is an xdr.SorobanTransactionData in base64 */
533+
/** This is an SorobanTransactionData in base64 */
534534
transactionData?: string;
535-
/** These are xdr.DiagnosticEvents in base64 */
535+
/** These are DiagnosticEvents in base64 */
536536
events?: string[];
537537
minResourceFee?: string;
538538
/**
@@ -693,9 +693,9 @@ export namespace Api {
693693
hash: string;
694694
sequence: number;
695695
ledgerCloseTime: string;
696-
/** a base-64 encoded {@link xdr.LedgerHeaderHistoryEntry} instance */
696+
/** a base-64 encoded {@link LedgerHeaderHistoryEntry} instance */
697697
headerXdr: string;
698-
/** a base-64 encoded {@link xdr.LedgerCloseMeta} instance */
698+
/** a base-64 encoded {@link LedgerCloseMeta} instance */
699699
metadataXdr: string;
700700
}
701701
}

src/xdr/generated/account-entry.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export class AccountEntry extends XdrValue {
8383
signers: array(Signer.schema, UNBOUNDED_MAX_LENGTH),
8484
ext: AccountEntryExt.schema,
8585
});
86+
8687
constructor(input: {
8788
accountId: PublicKey;
8889
balance: bigint;

src/xdr/generated/operation-result-tr.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -712,9 +712,6 @@ abstract class OperationResultTrBase extends XdrValue {
712712
abstract toXdrObject(): OperationResultTrWire;
713713
}
714714

715-
/**
716-
* {@inheritdoc OperationResultTrBase}
717-
*/
718715
export class OperationResultTrCreateAccount extends OperationResultTrBase {
719716
readonly type = "createAccount" as const;
720717
readonly createAccountResult: CreateAccountResult;

test/unit/base/memo.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ describe("Memo", () => {
231231

232232
const xdrMemo = memo.toXdrObject();
233233
expect(xdrMemo.type).toBe("memoReturn");
234-
if (xdrMemo.type !== "memoReturn")
235-
throw new Error("expected memoReturn");
234+
if (xdrMemo.type !== "memoReturn") throw new Error("expected memoReturn");
236235
const retHashBytes = xdrMemo.retHash.toBytes();
237236
expect(retHashBytes.length).toBe(32);
238237
expect(Buffer.from(retHashBytes).toString("hex")).toBe(

test/unit/server_async_transaction.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ describe("server.js async transaction submission tests", () => {
4242
.build();
4343
transaction.sign(keypair);
4444

45-
blob = encodeURIComponent(
46-
transaction.toEnvelope().toXdr("base64"),
47-
);
45+
blob = encodeURIComponent(transaction.toEnvelope().toXdr("base64"));
4846
});
4947

5048
afterEach(() => {

test/unit/server_transaction.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ describe("server.js transaction tests", () => {
4545
.build();
4646
transaction.sign(keypair);
4747

48-
blob = encodeURIComponent(
49-
transaction.toEnvelope().toXdr("base64"),
50-
);
48+
blob = encodeURIComponent(transaction.toEnvelope().toXdr("base64"));
5149
});
5250

5351
afterEach(() => {
@@ -352,9 +350,7 @@ describe("server.js transaction tests", () => {
352350
Networks.TESTNET,
353351
);
354352

355-
blob = encodeURIComponent(
356-
feeBumpTx.toEnvelope().toXdr("base64"),
357-
);
353+
blob = encodeURIComponent(feeBumpTx.toEnvelope().toXdr("base64"));
358354

359355
mockPost.mockImplementation((url: string, data: string) => {
360356
if (

test/unit/transaction.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ describe("assembleTransaction", () => {
118118

119119
const v1 = expectVariant(result.toEnvelope(), "envelopeTypeTx").v1;
120120
const opBody = v1.tx.operations[0]!.body;
121-
const invokeOp = expectVariant(opBody, "invokeHostFunction").invokeHostFunctionOp;
121+
const invokeOp = expectVariant(
122+
opBody,
123+
"invokeHostFunction",
124+
).invokeHostFunctionOp;
122125
const fn = expectVariant(
123126
invokeOp.auth[0]!.rootInvocation.function,
124127
"sorobanAuthorizedFunctionTypeContractFn",
@@ -129,7 +132,10 @@ describe("assembleTransaction", () => {
129132
invokeOp.auth[0]!.credentials,
130133
"sorobanCredentialsAddress",
131134
).address;
132-
const accountKey = expectVariant(credAddr.address, "scAddressTypeAccount").accountId;
135+
const accountKey = expectVariant(
136+
credAddr.address,
137+
"scAddressTypeAccount",
138+
).accountId;
133139
expect(StrKey.encodeEd25519PublicKey(Buffer.from(accountKey.value))).toBe(
134140
"GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI",
135141
);

0 commit comments

Comments
 (0)