Skip to content

Commit 1b2d6b3

Browse files
Merge branch 'master' of github.com:FuelLabs/fuels-ts
2 parents d31ee60 + a29e08d commit 1b2d6b3

File tree

12 files changed

+49
-11
lines changed

12 files changed

+49
-11
lines changed

.changeset/gold-pandas-double.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.changeset/happy-ducks-change.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.changeset/plenty-seals-pay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@fuel-ts/predicate": minor
3+
---
4+
5+
exporting getPredicateRoot from the predicate package

.changeset/rude-actors-appear.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.changeset/twenty-onions-enjoy.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.github/actions/ci-setup/action.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ runs:
1414
with:
1515
path: ~/.local/share/pnpm/store/v4
1616
key: ${{ runner.os }}-node-${{ inputs.node-version }}-pnpm-${{ inputs.pnpm-version }}-lock-${{ hashFiles('**/pnpm-lock.yaml') }}
17-
restore-keys: |
18-
${{ runner.os }}-pnpm
17+
18+
- name: Cache Build
19+
uses: actions/cache@v3
20+
with:
21+
path: .turbo
22+
key: ${{ runner.os }}-turbo-${{ github.sha }}
1923

2024
- name: Setup Node.js
2125
uses: actions/setup-node@v2

.github/actions/test-setup/action.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ runs:
1414
with:
1515
path: ~/.local/share/pnpm/store/v4
1616
key: ${{ runner.os }}-node-${{ inputs.node-version }}-pnpm-${{ inputs.pnpm-version }}-lock-${{ hashFiles('**/pnpm-lock.yaml') }}
17-
restore-keys: |
18-
${{ runner.os }}-pnpm
17+
18+
- name: Cache Build
19+
uses: actions/cache@v3
20+
with:
21+
path: .turbo
22+
key: ${{ runner.os }}-turbo-${{ github.sha }}
1923

2024
- name: Setup Node.js
2125
uses: actions/setup-node@v2

apps/demo-typegen/.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
node_modules
2-
src/contract-types
3-
src/predicate-types
4-
src/script-types
2+
src/*-types
53

64
# Forc
75
**/out/debug/**

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"packageManager": "[email protected]",
1212
"scripts": {
1313
"dev": "nodemon --config nodemon.config.json -x 'pnpm build:packages'",
14-
"build": "turbo run build",
14+
"build": "turbo run build --cache-dir=.turbo",
1515
"build:packages": "turbo run build --filter=!docs",
1616
"ci:test": "./scripts/tests-ci.sh",
1717
"pretest": "turbo run pretest",
@@ -23,7 +23,7 @@
2323
"test:validate": "./scripts/tests-validate.sh",
2424
"test:e2e": "vitest --run --config vite.node.config.mts $(scripts/tests-find.sh --e2e)",
2525
"lint": "run-s lint:check prettier:check",
26-
"lint:check": "eslint . --ext .ts",
26+
"lint:check": "eslint . --ext .ts --max-warnings 0",
2727
"lint:fix": "pnpm lint:check --fix",
2828
"lint:md-links": "tsx ./scripts/lint-md-links",
2929
"lint:package-jsons": "tsx ./scripts/lint-package-jsons",

packages/predicate/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './predicate';
2+
export * from './utils/getPredicateRoot';
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { getBytesCopy } from 'ethers';
2+
3+
import { getPredicateRoot } from './getPredicateRoot';
4+
5+
describe('getPredicateRoot', () => {
6+
it('should return the correct predicate root', () => {
7+
const predicateBytes = getBytesCopy(
8+
'0x740000034700000000000000000000805dfcc00110fff3001aec5000910000207144000361491200764800026141120c74000007724c0002134924c05a492001764800026141124a74000001240000005c450000504900085c43f0001341044076400001740000055d43f005104103007244002028ed0440a1412ee0244000000a0000000000000038966262edb5997574be45f94c665aedb41a1663f5b0528e765f355086eebf960000000000000088'
9+
);
10+
11+
const predicateRoot = getPredicateRoot(predicateBytes);
12+
13+
const expectedPredicateRoot =
14+
'0xd8fe10a7e398a8af7235e0a7d43388179d89c59d521dcf314e7ee407af8cddce';
15+
16+
expect(predicateRoot).toEqual(expectedPredicateRoot);
17+
});
18+
});

scripts/postbuild.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import { join } from 'path';
88
*/
99
try {
1010
if (existsSync(join(process.cwd(), 'tsconfig.dts.json'))) {
11-
execSync('tsc --emitDeclarationOnly -p tsconfig.dts.json');
11+
execSync('tsc --emitDeclarationOnly -p tsconfig.dts.json', { stdio: 'inherit' });
1212
} else if (existsSync(join(process.cwd(), 'tsconfig.json'))) {
13-
execSync('tsc --emitDeclarationOnly -p tsconfig.json');
13+
execSync('tsc --emitDeclarationOnly -p tsconfig.json', { stdio: 'inherit' });
1414
}
1515
} catch (err) {
1616
error(err.toString());

0 commit comments

Comments
 (0)