Skip to content

Commit

Permalink
Merging with master
Browse files Browse the repository at this point in the history
  • Loading branch information
arboleya committed Oct 31, 2023
2 parents 1dd6794 + 5b4aee1 commit 8d5b561
Show file tree
Hide file tree
Showing 34 changed files with 1,661 additions and 703 deletions.
2 changes: 2 additions & 0 deletions .changeset/real-wombats-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module.exports = {
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:eslint-comments/recommended',
'plugin:@typescript-eslint/recommended',
],
settings: {
'import/core-modules': ['@internal/tsup'],
Expand All @@ -22,6 +21,7 @@ module.exports = {
},
},
rules: {
'@typescript-eslint/no-non-null-assertion': 1,
// Disable error on devDependencies importing since this isn't a TS library
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'no-await-in-loop': 0,
Expand Down
6 changes: 4 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": true
"bracketSpacing": true,
"trailingComma": "es5",
"parser": "typescript"
}
},
{
Expand All @@ -24,4 +26,4 @@
}
}
]
}
}
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.prettierPath": "./node_modules/prettier",
"prettier.configPath": ".prettierrc",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
Expand Down
2 changes: 1 addition & 1 deletion apps/demo-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"next": "13.4.4",
"react-dom": "18.2.0",
"react": "18.2.0",
"typescript": "^4.8.4"
"typescript": "~5.2.2"
}
}
2 changes: 1 addition & 1 deletion apps/demo-react-cra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"react": "^18.2.0",
"typescript": "^4.9.5",
"typescript": "~5.2.2",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion apps/demo-react-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"eslint": "^8.38.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
"typescript": "^5.0.2",
"typescript": "~5.2.2",
"vite": "^4.3.9"
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import type { CoinQuantityLike, Contract } from 'fuels';
import {
BN,
ContractFactory,
BaseAssetId,
ScriptTransactionRequest,
type WalletUnlocked,
} from 'fuels';
import { BN, ContractFactory, BaseAssetId, ScriptTransactionRequest } from 'fuels';
import type { CoinQuantityLike, Contract, WalletUnlocked } from 'fuels';

import { SnippetProjectEnum, getSnippetProjectArtifacts } from '../../../projects';
import { defaultTxParams, getTestWallet } from '../../utils';
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"markdown-it": "^13.0.1",
"nodemon": "^2.0.22",
"replace": "^1.2.2",
"typedoc": "^0.24.8",
"typedoc": "^0.25.1",
"typedoc-plugin-merge-modules": "^5.0.1",
"vitepress": "1.0.0-alpha.51",
"vitepress-plugin-search": "1.0.4-alpha.19",
Expand Down
2 changes: 1 addition & 1 deletion internal/check-imports/src/references.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import { InputCoinCoder } from '@fuel-ts/transactions';
import { versions } from '@fuel-ts/versions';
import { runVersions } from '@fuel-ts/versions/cli';
import { Wallet } from '@fuel-ts/wallet';
import { WalletManager } from '@fuel-ts/wallet-manager';
import { FUEL_NETWORK_URL } from '@fuel-ts/wallet/configs';
// TODO: Add `launchNode` and `launchNodeAndGetWallets` here
import { generateTestWallet, seedTestWallet } from '@fuel-ts/wallet/test-utils';
import { WalletManager } from '@fuel-ts/wallet-manager';
import { english, Language } from '@fuel-ts/wordlists';
import type { DeployContractOptions, FuelsConfig, UserFuelsConfig } from 'fuels';
import {
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,40 +55,40 @@
"@types/node-fetch": "^2.6.2",
"@types/shelljs": "^0.8.11",
"@types/web": "^0.0.65",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"conventional-changelog-angular": "^5.0.13",
"dotenv": "^9.0.2",
"eslint": "^8.26.0",
"eslint": "^8.52.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^16.2.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsdoc": "^46.8.2",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.10",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-tsdoc": "^0.2.17",
"ethers": "^6.7.1",
"glob": "^10.2.6",
"jest": "^29.5.0",
"jest": "^29.7.0",
"jest-text-transformer": "^1.0.4",
"nodemon": "^2.0.22",
"npm-run-all": "^4.1.5",
"open": "^8.4.0",
"prettier": "^2.8.8",
"prettier": "^3.0.3",
"rimraf": "^3.0.2",
"shelljs": "^0.8.5",
"textlint": "^13.3.2",
"textlint-rule-no-dead-link": "^5.1.2",
"ts-generator": "^0.1.1",
"ts-jest": "^29.0.3",
"ts-jest": "^29.1.1",
"tsup": "^6.7.0",
"tsx": "^3.12.7",
"turbo": "^1.8.8",
"typescript": "~5.1.6"
"typescript": "~5.2.2"
},
"pnpm": {
"overrides": {
Expand Down
1 change: 1 addition & 0 deletions packages/abi-coder/src/abi-coder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export abstract class AbiCoder {
}

// ABI types underneath MUST have components by definition

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const components = resolvedAbiType.components!;

Expand Down
2 changes: 1 addition & 1 deletion packages/abi-coder/src/function-fragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { isPointerType, unpackDynamicData, findOrThrow, isHeapType } from './uti

export class FunctionFragment<
TAbi extends JsonAbi = JsonAbi,
FnName extends TAbi['functions'][number]['name'] = string
FnName extends TAbi['functions'][number]['name'] = string,
> {
readonly signature: string;
readonly selector: string;
Expand Down
4 changes: 3 additions & 1 deletion packages/abi-coder/src/resolved-abi-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export class ResolvedAbiType {
const typeParametersAndArgsMap = typeParameters.reduce(
(obj, typeParameter, typeParameterIndex) => {
const o: Record<number, JsonAbiArgument> = { ...obj };
o[typeParameter] = structuredClone(arg.typeArguments?.[typeParameterIndex]);
o[typeParameter] = structuredClone(
arg.typeArguments?.[typeParameterIndex]
) as JsonAbiArgument;
return o;
},
{} as Record<number, JsonAbiArgument>
Expand Down
2 changes: 1 addition & 1 deletion packages/abi-typegen/src/templates/contract/dts.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getProjectResources, ForcProjectsEnum } from '../../../test/fixtures/forc-projects/index';
import expectedDtsMinimalConfigurableTemplate from '../../../test/fixtures/templates/contract-with-configurable/dts.hbs';
import expectedDtsFullTemplate from '../../../test/fixtures/templates/contract/dts.hbs';
import expectedDtsMinimalConfigurableTemplate from '../../../test/fixtures/templates/contract-with-configurable/dts.hbs';
import { mockVersions } from '../../../test/utils/mockVersions';
import { Abi } from '../../abi/Abi';
import { ProgramTypeEnum } from '../../types/enums/ProgramTypeEnum';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { safeExec } from '@fuel-ts/errors/test-utils';

import { getProjectResources, ForcProjectsEnum } from '../../../test/fixtures/forc-projects/index';
import factoryWithConfigurablesTemplate from '../../../test/fixtures/templates/predicate-with-configurable/factory.hbs';
import factoryTemplate from '../../../test/fixtures/templates/predicate/factory.hbs';
import factoryWithConfigurablesTemplate from '../../../test/fixtures/templates/predicate-with-configurable/factory.hbs';
import { mockVersions } from '../../../test/utils/mockVersions';
import { Abi } from '../../abi/Abi';
import { ProgramTypeEnum } from '../../types/enums/ProgramTypeEnum';
Expand Down
2 changes: 1 addition & 1 deletion packages/abi-typegen/src/templates/script/factory.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { safeExec } from '@fuel-ts/errors/test-utils';

import { getProjectResources, ForcProjectsEnum } from '../../../test/fixtures/forc-projects/index';
import factoryTemplateWithConfigurables from '../../../test/fixtures/templates/script-with-configurable/factory.hbs';
import factoryTemplate from '../../../test/fixtures/templates/script/factory.hbs';
import factoryTemplateWithConfigurables from '../../../test/fixtures/templates/script-with-configurable/factory.hbs';
import { mockVersions } from '../../../test/utils/mockVersions';
import { Abi } from '../../abi/Abi';
import { ProgramTypeEnum } from '../../types/enums/ProgramTypeEnum';
Expand Down
2 changes: 1 addition & 1 deletion packages/errors/src/error-codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export enum ErrorCode {
TYPE_NOT_FOUND = 'type-not-found',
TYPE_NOT_SUPPORTED = 'type-not-supported',
INVALID_DECODE_VALUE = 'invalid-decode-value',
JSON_ABI_ERROR = 'abi-main-method-missing',
JSON_ABI_ERROR = 'json-abi-error',
TYPE_ID_NOT_FOUND = 'type-id-not-found',
BIN_FILE_NOT_FOUND = 'bin-file-not-found',
CODER_NOT_FOUND = 'coder-not-found',
Expand Down
13 changes: 2 additions & 11 deletions packages/fuel-gauge/src/bytes.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import { generateTestWallet } from '@fuel-ts/wallet/test-utils';
import type { BN } from 'fuels';
import {
type Contract,
bn,
Predicate,
Wallet,
Address,
BaseAssetId,
Provider,
FUEL_NETWORK_URL,
} from 'fuels';
import { bn, Predicate, Wallet, Address, BaseAssetId, Provider, FUEL_NETWORK_URL } from 'fuels';
import type { BN, Contract } from 'fuels';

import predicateBytes from '../fixtures/forc-projects/predicate-bytes';
import predicateBytesAbi from '../fixtures/forc-projects/predicate-bytes/out/debug/predicate-bytes-abi.json';
Expand Down
2 changes: 1 addition & 1 deletion packages/fuel-gauge/src/e2e-script.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type MainArgs = [
SomeStruct[], // ENUM_IN_VEC
TwoDimensionArray, // TUPLE_IN_VEC
TwoDimensionArray, // VEC_IN_TUPLE
VecInAStructInAVec // VEC_IN_A_VEC_IN_A_STRUCT_IN_A_VEC
VecInAStructInAVec, // VEC_IN_A_VEC_IN_A_STRUCT_IN_A_VEC
];

describe('Live Script Test', () => {
Expand Down
13 changes: 2 additions & 11 deletions packages/fuel-gauge/src/raw-slice.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import { generateTestWallet } from '@fuel-ts/wallet/test-utils';
import type { BN } from 'fuels';
import {
type Contract,
bn,
Predicate,
Wallet,
Address,
BaseAssetId,
Provider,
FUEL_NETWORK_URL,
} from 'fuels';
import { bn, Predicate, Wallet, Address, BaseAssetId, Provider, FUEL_NETWORK_URL } from 'fuels';
import type { BN, Contract } from 'fuels';

import predicateRawSlice from '../fixtures/forc-projects/predicate-raw-slice';
import predicateRawSliceAbi from '../fixtures/forc-projects/predicate-raw-slice/out/debug/predicate-raw-slice-abi.json';
Expand Down
13 changes: 2 additions & 11 deletions packages/fuel-gauge/src/std-lib-string.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import { generateTestWallet } from '@fuel-ts/wallet/test-utils';
import type { BN } from 'fuels';
import {
type Contract,
bn,
Predicate,
Wallet,
Address,
BaseAssetId,
Provider,
FUEL_NETWORK_URL,
} from 'fuels';
import { bn, Predicate, Wallet, Address, BaseAssetId, Provider, FUEL_NETWORK_URL } from 'fuels';
import type { BN, Contract } from 'fuels';

import predicateStdString from '../fixtures/forc-projects/predicate-std-lib-string';
import predicateStdStringAbi from '../fixtures/forc-projects/predicate-std-lib-string/out/debug/predicate-std-lib-string-abi.json';
Expand Down
2 changes: 1 addition & 1 deletion packages/fuel-gauge/src/vector-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type MainArgs = [
SomeStruct[], // ENUM_IN_VEC
TwoDimensionArray, // TUPLE_IN_VEC
TwoDimensionArray, // VEC_IN_TUPLE
VecInAStructInAVec // VEC_IN_A_VEC_IN_A_STRUCT_IN_A_VEC
VecInAStructInAVec, // VEC_IN_A_VEC_IN_A_STRUCT_IN_A_VEC
];

const setup = async (balance = 500_000) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/fuel-gauge/src/vectors.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { BN } from 'fuels';
import { bn, randomBytes, type Contract, hexlify } from 'fuels';
import { bn, randomBytes, hexlify } from 'fuels';
import type { BN, Contract } from 'fuels';

import { getSetupContract } from './utils';

Expand Down
2 changes: 1 addition & 1 deletion packages/program/src/functions/invocation-results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class InvocationResult<T = any> {
*/
export class FunctionInvocationResult<
T = any,
TTransactionType = void
TTransactionType = void,
> extends InvocationResult<T> {
readonly transactionId: string;
readonly transactionResponse: TransactionResponse;
Expand Down
2 changes: 1 addition & 1 deletion packages/program/src/functions/invocation-scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { BaseInvocationScope } from './base-invocation-scope';
*/
export class FunctionInvocationScope<
TArgs extends Array<any> = Array<any>,
TReturn = any
TReturn = any,
> extends BaseInvocationScope<TReturn> {
protected func: FunctionFragment;
private callParameters?: CallParams;
Expand Down
3 changes: 1 addition & 2 deletions packages/providers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@graphql-codegen/typescript-graphql-request": "^4.5.7",
"@graphql-codegen/typescript-operations": "^2.5.5",
"@types/ramda": "^0.29.3",
"get-graphql-schema": "^2.1.2",
"typescript": "^4.8.4"
"get-graphql-schema": "^2.1.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import {
import type { TransactionResultReceipt } from '../transaction-response';

import { assembleTransactionSummary } from './assemble-transaction-summary';
import type { GraphqlTransactionStatus } from './types';
import { type Operation } from './types';
import type { GraphqlTransactionStatus, Operation } from './types';

describe('TransactionSummary', () => {
const id = '0x2bfbebca58da94ba3ee258698c9be5884e2874688bdffa29cb535cf05d665215';
Expand Down
11 changes: 3 additions & 8 deletions packages/providers/src/transaction-summary/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,15 @@ import {
getInputsCoin,
} from './input';
import { getOutputsCoin, getOutputsContract, getOutputsContractCreated } from './output';
import { AddressType, ChainName, OperationName, TransactionTypeName } from './types';
import type {
InputOutputParam,
InputParam,
OperationCoin,
RawPayloadParam,
ReceiptParam,
} from './types';
import {
type Operation,
type GetOperationParams,
AddressType,
ChainName,
OperationName,
TransactionTypeName,
Operation,
GetOperationParams,
} from './types';

/** @hidden */
Expand Down
2 changes: 1 addition & 1 deletion packages/providers/test/provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ describe('Provider', () => {
chain: MOCK_CHAIN,
nodeInfo: MOCK_NODE_INFO,
}),
} as unknown as GraphQL.GraphQLClient)
}) as unknown as GraphQL.GraphQLClient
);

const spyFetchChainAndNodeInfo = jest.spyOn(Provider.prototype, 'fetchChainAndNodeInfo');
Expand Down
2 changes: 1 addition & 1 deletion packages/script/src/script-invocation-scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ByteArrayCoder } from '@fuel-ts/transactions';

export class ScriptInvocationScope<
TArgs extends Array<any> = Array<any>,
TReturn = any
TReturn = any,
> extends FunctionInvocationScope<TArgs, TReturn> {
scriptRequest!: ScriptRequest<TArgs, TReturn>;

Expand Down
2 changes: 1 addition & 1 deletion packages/utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ console.log(safeExec(() => 123));
console.log(
safeExec(() => {
throw new Error("Some error");
})
}),
);
// { error: (Error: 'Some error'), result: null }
```
Expand Down
Loading

0 comments on commit 8d5b561

Please sign in to comment.