Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: ABI Gen #3249

Merged
merged 206 commits into from
Jan 22, 2025
Merged
Changes from 1 commit
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
72fc6d6
parser scaffolding
nedsalk Sep 3, 2024
451b1db
lint fix
nedsalk Sep 4, 2024
6c1eed5
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Sep 4, 2024
cfb3499
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Sep 4, 2024
36c9866
Merge branch 'np/feat/abi-refactor' of github.com:FuelLabs/fuels-ts i…
petertonysmith94 Sep 10, 2024
4c9743a
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Sep 12, 2024
e7c55d5
chore: ABI parser - API alterations (#3164)
petertonysmith94 Sep 13, 2024
96785b3
Merge remote-tracking branch 'origin/np/feat/abi-refactor' into ns/fe…
nedsalk Sep 25, 2024
b304bf6
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Sep 28, 2024
51f7857
Add `AbiTypeMetadata` and fix bug
nedsalk Oct 3, 2024
582f609
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Oct 3, 2024
23aec29
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Oct 11, 2024
54b5dd2
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Oct 11, 2024
3318c80
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Oct 15, 2024
916bb90
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Oct 23, 2024
3e88a37
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Oct 24, 2024
9ee2e74
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
petertonysmith94 Nov 18, 2024
0215397
Merge branch 'np/feat/abi-refactor' of github.com:FuelLabs/fuels-ts i…
petertonysmith94 Nov 25, 2024
8fc8e08
chore: adjust attributes to match spec
petertonysmith94 Nov 25, 2024
e73a7ab
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Nov 27, 2024
8e5781e
chore: added `FuelError`
petertonysmith94 Nov 27, 2024
f67b4a8
chore: fixed test for matchers
petertonysmith94 Nov 27, 2024
beeebea
Merge branch 'np/feat/abi-refactor' of github.com:FuelLabs/fuels-ts i…
petertonysmith94 Nov 27, 2024
c35de21
Merge branch 'np/feat/abi-refactor' of github.com:FuelLabs/fuels-ts i…
petertonysmith94 Nov 27, 2024
b0a4f02
fix generic type resolution edge case
nedsalk Nov 27, 2024
d1d0929
changeset
nedsalk Nov 28, 2024
65d4ed9
refactoring, commenting
nedsalk Nov 28, 2024
e160e74
Merge branch 'np/feat/abi-refactor' of github.com:FuelLabs/fuels-ts i…
petertonysmith94 Nov 29, 2024
be228d8
chore: favour `concreteTypeId`
petertonysmith94 Dec 2, 2024
ed43cd6
chore: fix up errors for the parser specification
petertonysmith94 Dec 2, 2024
52e22b3
docs: added error code
petertonysmith94 Dec 2, 2024
ef1484e
chore: nit
petertonysmith94 Dec 2, 2024
9b38b48
chore: attribute arguments always defined
petertonysmith94 Dec 2, 2024
bee8f28
chore: fix incorrect inline attribute arguments
petertonysmith94 Dec 2, 2024
06e70c1
Merge branch 'np/feat/abi-refactor' of github.com:FuelLabs/fuels-ts i…
petertonysmith94 Dec 2, 2024
b2d6bdc
chore: re-adjusted `mapAttribute`
petertonysmith94 Dec 3, 2024
2235308
chore: added helper functions for finding concreteTypes and metadataT…
petertonysmith94 Dec 3, 2024
f25c90b
chore: removed static methods + further `findConcreteType` + `findMet…
petertonysmith94 Dec 3, 2024
af93e03
Merge branch 'np/feat/abi-refactor' of github.com:FuelLabs/fuels-ts i…
petertonysmith94 Dec 3, 2024
fe56f53
chore: more verbose variable names
petertonysmith94 Dec 3, 2024
c3806b4
chore: constructor as first public method
petertonysmith94 Dec 5, 2024
400a93a
chore: rename `type` for `swayType`
petertonysmith94 Dec 5, 2024
a07a3b5
chore: removed `specVersion`
petertonysmith94 Dec 5, 2024
583fcc3
add comments
nedsalk Dec 6, 2024
da6384b
chore: added name to typeArguments
petertonysmith94 Dec 6, 2024
37d5567
Merge branch 'ns/feat/abi-parser' of github.com:FuelLabs/fuels-ts int…
nedsalk Dec 6, 2024
4c64f49
comments
nedsalk Dec 6, 2024
ca57c86
fix?
nedsalk Dec 6, 2024
a2118e2
fix?
nedsalk Dec 6, 2024
4d7a528
Merge branch 'master' of github.com:FuelLabs/fuels-ts into ns/feat/ab…
petertonysmith94 Dec 8, 2024
c2af71e
Merge branch 'master' of github.com:FuelLabs/fuels-ts into ns/feat/ab…
petertonysmith94 Dec 10, 2024
3fbb2d6
Merge branch 'np/feat/abi-refactor' of github.com:FuelLabs/fuels-ts i…
petertonysmith94 Dec 11, 2024
16c340e
chore: rollback to working state
petertonysmith94 Dec 11, 2024
2904381
refactoring
nedsalk Dec 12, 2024
c6a4a38
add test group
nedsalk Dec 12, 2024
a2fae3a
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Dec 12, 2024
cacbacf
revert changes
nedsalk Dec 12, 2024
799dce8
format projects
nedsalk Dec 12, 2024
d1ec960
export parser from fuels
nedsalk Dec 12, 2024
43ca2d0
cleanup
nedsalk Dec 12, 2024
55a88c7
renamings
nedsalk Dec 12, 2024
e4dfa53
renamings
nedsalk Dec 12, 2024
167e43d
add comments to `Abi`
nedsalk Dec 12, 2024
3a2cc1c
add docs
nedsalk Dec 12, 2024
c2bb0c6
update docs
nedsalk Dec 12, 2024
88b2224
rename test
nedsalk Dec 12, 2024
0dc80e4
rename to
nedsalk Dec 12, 2024
d658f80
formatting
nedsalk Dec 12, 2024
a8886b9
more explanations
nedsalk Dec 12, 2024
244f02c
cleaner
nedsalk Dec 12, 2024
238b4ad
formatting
nedsalk Dec 12, 2024
64ccd8d
comments
nedsalk Dec 12, 2024
9e33353
add double generic case
nedsalk Dec 12, 2024
4fddeca
fix test
nedsalk Dec 12, 2024
0434ecd
update changeset
nedsalk Dec 12, 2024
18e659f
revert
nedsalk Dec 12, 2024
dbf83c6
fix changeset
nedsalk Dec 12, 2024
e973ec7
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Dec 12, 2024
eff1232
not breaking
nedsalk Dec 12, 2024
7b6da13
fix test
nedsalk Dec 12, 2024
5ad1fdb
add import check
nedsalk Dec 12, 2024
733b559
fix linting
nedsalk Dec 12, 2024
7756375
fix lint
nedsalk Dec 12, 2024
2390cca
add comments to abi interface
nedsalk Dec 12, 2024
6287f87
Update .changeset/tender-tigers-fry.md
nedsalk Dec 12, 2024
dcd468a
fix changeset
nedsalk Dec 12, 2024
c9ffae1
add implicit generic edge case
nedsalk Dec 12, 2024
1d84672
feat: ABI Gen
nedsalk Dec 12, 2024
378e67e
fix storage slots and imports in tests
nedsalk Dec 13, 2024
b904bdf
fix linting
nedsalk Dec 13, 2024
0b01607
fix linting
nedsalk Dec 13, 2024
2feadf1
Update .changeset/poor-years-hang.md
nedsalk Dec 13, 2024
b446299
improve type arguments representation
nedsalk Dec 13, 2024
dea838d
Merge branch 'ns/feat/abi-parser' into ns/feat/abi-typegen
nedsalk Dec 13, 2024
e330aba
fix type arguments
nedsalk Dec 13, 2024
f526b04
explanatory comment
nedsalk Dec 13, 2024
1068197
move types to separate file
nedsalk Dec 13, 2024
972721b
move fixtures into folders
nedsalk Dec 13, 2024
b4a9fd5
move `mapComponents` and add explanations
nedsalk Dec 13, 2024
9aac5cb
move logic to shared folder
nedsalk Dec 13, 2024
55b481b
add type docs explaining functions
nedsalk Dec 13, 2024
09a9e97
add doc blocks for `AbiGen` and related types
nedsalk Dec 13, 2024
1703d8f
remove unnecessary flags
nedsalk Dec 13, 2024
30aaa43
remove todo
nedsalk Dec 13, 2024
e6ea6fa
input/output
nedsalk Dec 13, 2024
a27c7bd
feat: ABI parser
nedsalk Dec 13, 2024
0c5f839
remove casts
nedsalk Dec 13, 2024
1b59dda
remove unnecessary throw
nedsalk Dec 13, 2024
3671f0d
Merge branch 'ns/feat/abi-parser' into ns/feat/abi-typegen
nedsalk Dec 13, 2024
d5df0f1
centralize abi cleanup logic
nedsalk Dec 15, 2024
ab04c07
Merge branch 'ns/feat/abi-parser' into ns/feat/abi-typegen
nedsalk Dec 15, 2024
2fc0a2f
remove rawUntypedPtr from swayTypeMatchers
nedsalk Dec 15, 2024
0225502
Merge branch 'ns/feat/abi-parser' into ns/feat/abi-typegen
nedsalk Dec 15, 2024
1445925
remove rawUntypedPtr
nedsalk Dec 15, 2024
ff16608
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Dec 16, 2024
23b1f03
Merge branch 'ns/feat/abi-parser' into ns/feat/abi-typegen
nedsalk Dec 16, 2024
9e7a266
made `abi` and `storage-slots` ts files
nedsalk Dec 16, 2024
cf65fbf
move from linting to cast
nedsalk Dec 16, 2024
7a0ae00
remove usage of `fuels-typegen`
nedsalk Dec 16, 2024
6b25941
change to `FuelError`
nedsalk Dec 16, 2024
3f06b38
simplify inputs/output types for script and predicate
nedsalk Dec 16, 2024
032b736
improve index file rendering
nedsalk Dec 16, 2024
ae86e26
export types from base program file (and thus index)
nedsalk Dec 16, 2024
6f79a26
cleanup type rendering
nedsalk Dec 16, 2024
67c5e38
simplified program rendering
nedsalk Dec 16, 2024
d4a7bf3
fix recipes
nedsalk Dec 16, 2024
c0f01f7
reorder deps
nedsalk Dec 16, 2024
3bf2df2
refactor render-index-files
nedsalk Dec 16, 2024
988c7ec
remove file
nedsalk Dec 16, 2024
e18240a
update changeset
nedsalk Dec 16, 2024
0b03ce5
fix changeset
nedsalk Dec 16, 2024
e03ae55
fix recipes build
nedsalk Dec 16, 2024
ab83ccc
fix test
nedsalk Dec 16, 2024
69dfcb7
cleanup
nedsalk Dec 16, 2024
ad36793
fix knip
nedsalk Dec 16, 2024
c280227
fix lint
nedsalk Dec 16, 2024
05a613a
export inputs, outputs and configurables
nedsalk Dec 16, 2024
48d2a8b
rename method
nedsalk Dec 16, 2024
0c6b359
Update cleanup-abi.ts
nedsalk Dec 16, 2024
b4d6766
Update cleanup-abi.ts
nedsalk Dec 16, 2024
c4ed9d8
refactor abi type mappers
nedsalk Dec 17, 2024
3de5f80
refactor into using maps for types
nedsalk Dec 17, 2024
e354ddc
Merge branch 'ns/feat/abi-parser' into ns/feat/abi-typegen
nedsalk Dec 17, 2024
a307df1
refactor from array of tuples into `Map`
nedsalk Dec 17, 2024
804feb1
rename variables
nedsalk Dec 17, 2024
1c7f6a1
Merge branch 'ns/feat/abi-parser' into ns/feat/abi-typegen
nedsalk Dec 17, 2024
b6c5936
refactorings, comments
nedsalk Dec 17, 2024
92bae57
Merge branch 'ns/feat/abi-parser' into ns/feat/abi-typegen
nedsalk Dec 17, 2024
a2f0004
split test up into multiple tests
nedsalk Dec 17, 2024
569e356
remove already included --silent flag
nedsalk Dec 23, 2024
e23571c
Merge branch 'ns/feat/abi-parser' into ns/feat/abi-typegen
nedsalk Dec 23, 2024
5446c30
added non-happy paths testing
nedsalk Dec 24, 2024
fe159f6
mvoed cli into abi package
nedsalk Dec 26, 2024
403e2ca
cleanup
nedsalk Dec 26, 2024
143f356
export types from contract/predicate/script
nedsalk Dec 26, 2024
aa6b0af
improve upon index exports now that types are also re-exported
nedsalk Dec 26, 2024
ff6cbac
fix pnpm-lock.yaml
nedsalk Dec 26, 2024
632a46c
rename
nedsalk Dec 26, 2024
57902f3
fix recipes
nedsalk Dec 26, 2024
4feb731
log instead of throwing
nedsalk Dec 27, 2024
62323df
fix lint
nedsalk Dec 27, 2024
6a00878
add `forc` and `fuel-core` to path
nedsalk Dec 27, 2024
ab574c3
try again
nedsalk Dec 27, 2024
cddae24
try again
nedsalk Dec 27, 2024
a3a969d
fix lint
nedsalk Dec 27, 2024
ff22e94
Increase timeout
nedsalk Dec 27, 2024
c3a2b9a
cleanup
nedsalk Dec 30, 2024
a96bfa0
revert timeout
nedsalk Dec 30, 2024
7d58e16
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Dec 31, 2024
9f3986d
Merge remote-tracking branch 'origin/ns/feat/abi-parser' into ns/feat…
nedsalk Dec 31, 2024
d4ccfe8
chore: use playwright in browser tests
nedsalk Jan 1, 2025
be77143
revert isolate flag for safety
nedsalk Jan 1, 2025
c1fefe4
Merge branch 'ns/chore/browser-tests-playwright' into ns/feat/abi-typ…
nedsalk Jan 1, 2025
83cd67f
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Jan 2, 2025
f5768e9
Merge branch 'ns/feat/abi-parser' into ns/feat/abi-typegen
nedsalk Jan 2, 2025
423834c
revert some changes
nedsalk Jan 2, 2025
7643979
update docs
nedsalk Jan 2, 2025
1e51d6b
update imports
nedsalk Jan 2, 2025
81d61b9
revert file
nedsalk Jan 2, 2025
f8d45b7
revert input
nedsalk Jan 2, 2025
32e18a5
fix import
nedsalk Jan 2, 2025
72e0d58
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Jan 8, 2025
a2de75d
Merge branch 'ns/feat/abi-parser' into ns/feat/abi-typegen
nedsalk Jan 8, 2025
7b4de2a
update
nedsalk Jan 8, 2025
a71f9e4
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Jan 8, 2025
336c48c
Merge branch 'ns/feat/abi-parser' into ns/feat/abi-typegen
nedsalk Jan 8, 2025
231813f
revert file
nedsalk Jan 8, 2025
e5460b8
remove flags
nedsalk Jan 8, 2025
b9fff0e
fix lint
nedsalk Jan 9, 2025
4b40474
lock file fix
nedsalk Jan 9, 2025
f463546
Merge branch 'master' of github.com:FuelLabs/fuels-ts into ns/feat/ab…
petertonysmith94 Jan 13, 2025
358af56
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Jan 13, 2025
b90365a
Merge branch 'ns/feat/abi-parser' into ns/feat/abi-typegen
nedsalk Jan 13, 2025
493ae32
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Jan 13, 2025
c96493c
Merge branch 'ns/feat/abi-parser' into ns/feat/abi-typegen
nedsalk Jan 13, 2025
d93a90d
Merge branch 'np/feat/abi-refactor' into ns/feat/abi-parser
nedsalk Jan 14, 2025
a0fde5b
Merge branch 'ns/feat/abi-parser' into ns/feat/abi-typegen
nedsalk Jan 14, 2025
1abc856
fix tests
nedsalk Jan 14, 2025
69e3dd2
fix lint
nedsalk Jan 14, 2025
45b3a80
fix lint 2
nedsalk Jan 14, 2025
735a92b
fix lock file
nedsalk Jan 14, 2025
e7f5e30
Merge branch 'np/feat/abi-refactor' of github.com:FuelLabs/fuels-ts i…
petertonysmith94 Jan 22, 2025
c8ebd85
Merge branch 'ns/feat/abi-parser' of github.com:FuelLabs/fuels-ts int…
petertonysmith94 Jan 22, 2025
f79cb7b
Merge branch 'np/feat/abi-refactor' of github.com:FuelLabs/fuels-ts i…
petertonysmith94 Jan 22, 2025
c13bb22
chore: sync build
petertonysmith94 Jan 22, 2025
259a804
chore: removed `Vec`
petertonysmith94 Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: adjust attributes to match spec
petertonysmith94 committed Nov 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 8fc8e0885f5d8c6c9baad8cd8c0e67aaf10fe773
4 changes: 3 additions & 1 deletion packages/abi/package.json
Original file line number Diff line number Diff line change
@@ -25,6 +25,8 @@
"build": "tsup",
"postbuild": "tsx ../../scripts/postbuild.ts"
},
"dependencies": {},
"dependencies": {
"@fuel-ts/utils": "workspace:*"
},
"devDependencies": {}
}
11 changes: 3 additions & 8 deletions packages/abi/src/parser/abi.ts
Original file line number Diff line number Diff line change
@@ -60,13 +60,12 @@ export interface AbiConfigurable {
type: AbiType;
}

type AbiFunctionAttribute =
export type AbiFunctionAttribute =
| StorageAttr
| PayableAttr
| TestAttr
| InlineAttr
| DocCommentAttr
| DocAttr;
| DocCommentAttr;

export interface PayableAttr {
readonly name: 'payable';
@@ -87,9 +86,5 @@ export interface InlineAttr {

export interface DocCommentAttr {
readonly name: 'doc-comment';
readonly arguments: string[];
}

export interface DocAttr {
readonly name: 'doc';
readonly arguments: readonly string[];
}
34 changes: 34 additions & 0 deletions packages/abi/src/parser/specifications/v1/map-attribute.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { assertUnreachable } from '@fuel-ts/utils';

import type { AbiFunctionAttribute } from '../../abi';

import type { AbiFunctionAttributeV1 } from './specification';

export const mapAttribute = (attribute: AbiFunctionAttributeV1): AbiFunctionAttribute => {
switch (attribute.name) {
case 'inline':
return {
name: attribute.name,
arguments: attribute.arguments[0] === 'never' ? 'never' : 'always',
};

case 'storage':
return {
name: attribute.name,
arguments: attribute.arguments,
};

case 'doc-comment':
return {
name: attribute.name,
arguments: attribute.arguments,
};

case 'payable':
case 'test':
return { name: attribute.name };

default:
return assertUnreachable(attribute);
}
};
3 changes: 2 additions & 1 deletion packages/abi/src/parser/specifications/v1/parser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Abi } from '../../abi';

import { makeResolvedType } from './make-resolved-type';
import { mapAttribute } from './map-attribute';
import { ResolvableType } from './resolvable-type';
import type {
AbiConfigurableV1,
@@ -38,7 +39,7 @@ export class AbiParserV1 {
encodingVersion: abi.encodingVersion,
programType: abi.programType,
functions: abi.functions.map((fn: AbiFunctionV1) => ({
attributes: fn.attributes ?? undefined,
attributes: fn.attributes?.map(mapAttribute) ?? undefined,
name: fn.name,
output: getType(fn.output),
inputs: fn.inputs.map((input: AbiFunctionInputV1) => ({
9 changes: 3 additions & 6 deletions packages/abi/src/parser/specifications/v1/specification.ts
Original file line number Diff line number Diff line change
@@ -70,11 +70,11 @@ export type AbiFunctionAttributeV1 =
| PayableAttrV1
| TestAttrV1
| InlineAttrV1
| DocCommentAttrV1
| DocAttrV1;
| DocCommentAttrV1;

export interface PayableAttrV1 {
readonly name: 'payable';
readonly arguments?: readonly [];
}

export interface StorageAttrV1 {
@@ -84,6 +84,7 @@ export interface StorageAttrV1 {

export interface TestAttrV1 {
readonly name: 'test';
readonly arguments?: readonly [];
}

export interface InlineAttrV1 {
@@ -95,7 +96,3 @@ export interface DocCommentAttrV1 {
readonly name: 'doc-comment';
readonly arguments: string[];
}

export interface DocAttrV1 {
readonly name: 'doc';
}
6 changes: 5 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.