Skip to content

Commit

Permalink
Merge branch 'master' of github.com:FuelLabs/fuels-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
petertonysmith94 committed Jan 20, 2024
2 parents d31ee60 + a29e08d commit 1b2d6b3
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .changeset/gold-pandas-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/happy-ducks-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
5 changes: 5 additions & 0 deletions .changeset/plenty-seals-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuel-ts/predicate": minor
---

exporting getPredicateRoot from the predicate package
2 changes: 2 additions & 0 deletions .changeset/rude-actors-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/twenty-onions-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
8 changes: 6 additions & 2 deletions .github/actions/ci-setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ runs:
with:
path: ~/.local/share/pnpm/store/v4
key: ${{ runner.os }}-node-${{ inputs.node-version }}-pnpm-${{ inputs.pnpm-version }}-lock-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm

- name: Cache Build
uses: actions/cache@v3
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}

- name: Setup Node.js
uses: actions/setup-node@v2
Expand Down
8 changes: 6 additions & 2 deletions .github/actions/test-setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ runs:
with:
path: ~/.local/share/pnpm/store/v4
key: ${{ runner.os }}-node-${{ inputs.node-version }}-pnpm-${{ inputs.pnpm-version }}-lock-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm

- name: Cache Build
uses: actions/cache@v3
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}

- name: Setup Node.js
uses: actions/setup-node@v2
Expand Down
4 changes: 1 addition & 3 deletions apps/demo-typegen/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
node_modules
src/contract-types
src/predicate-types
src/script-types
src/*-types

# Forc
**/out/debug/**
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"packageManager": "[email protected]",
"scripts": {
"dev": "nodemon --config nodemon.config.json -x 'pnpm build:packages'",
"build": "turbo run build",
"build": "turbo run build --cache-dir=.turbo",
"build:packages": "turbo run build --filter=!docs",
"ci:test": "./scripts/tests-ci.sh",
"pretest": "turbo run pretest",
Expand All @@ -23,7 +23,7 @@
"test:validate": "./scripts/tests-validate.sh",
"test:e2e": "vitest --run --config vite.node.config.mts $(scripts/tests-find.sh --e2e)",
"lint": "run-s lint:check prettier:check",
"lint:check": "eslint . --ext .ts",
"lint:check": "eslint . --ext .ts --max-warnings 0",
"lint:fix": "pnpm lint:check --fix",
"lint:md-links": "tsx ./scripts/lint-md-links",
"lint:package-jsons": "tsx ./scripts/lint-package-jsons",
Expand Down
1 change: 1 addition & 0 deletions packages/predicate/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './predicate';
export * from './utils/getPredicateRoot';
18 changes: 18 additions & 0 deletions packages/predicate/src/utils/getPredicateRoot.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { getBytesCopy } from 'ethers';

import { getPredicateRoot } from './getPredicateRoot';

describe('getPredicateRoot', () => {
it('should return the correct predicate root', () => {
const predicateBytes = getBytesCopy(
'0x740000034700000000000000000000805dfcc00110fff3001aec5000910000207144000361491200764800026141120c74000007724c0002134924c05a492001764800026141124a74000001240000005c450000504900085c43f0001341044076400001740000055d43f005104103007244002028ed0440a1412ee0244000000a0000000000000038966262edb5997574be45f94c665aedb41a1663f5b0528e765f355086eebf960000000000000088'
);

const predicateRoot = getPredicateRoot(predicateBytes);

const expectedPredicateRoot =
'0xd8fe10a7e398a8af7235e0a7d43388179d89c59d521dcf314e7ee407af8cddce';

expect(predicateRoot).toEqual(expectedPredicateRoot);
});
});
4 changes: 2 additions & 2 deletions scripts/postbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { join } from 'path';
*/
try {
if (existsSync(join(process.cwd(), 'tsconfig.dts.json'))) {
execSync('tsc --emitDeclarationOnly -p tsconfig.dts.json');
execSync('tsc --emitDeclarationOnly -p tsconfig.dts.json', { stdio: 'inherit' });
} else if (existsSync(join(process.cwd(), 'tsconfig.json'))) {
execSync('tsc --emitDeclarationOnly -p tsconfig.json');
execSync('tsc --emitDeclarationOnly -p tsconfig.json', { stdio: 'inherit' });
}
} catch (err) {
error(err.toString());
Expand Down

0 comments on commit 1b2d6b3

Please sign in to comment.