Skip to content

Commit

Permalink
fix: adjust typegen required members (#1009)
Browse files Browse the repository at this point in the history
  • Loading branch information
arboleya authored May 22, 2023
1 parent 8c42ba2 commit 28c1cda
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .changeset/poor-dodos-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 1 addition & 1 deletion packages/abi-typegen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ The table below describes how Sway types are converted from/to Typescript.
| **structs** | `MyStruct` { a: u8, b: u16 } | `MyStruct` | `MyStruct` |
| **vectors** | Vec<`MyType`> | `MyType`[] | `MyType`[] |
| **options** | Option<`MyType`> | `Option<MyType>` | `Option<MyType>` |
| **raw untyped ptr** | `123` | `BigNumberish` | `number` |
| **raw untyped ptr** | `123` | `BigNumberish` | `BN` |

> For more info on Sway types, click [here](https://fuellabs.github.io/sway/latest/basics/index.html)
Expand Down
2 changes: 1 addition & 1 deletion packages/abi-typegen/src/abi/types/ArrayType.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('ArrayType.ts', () => {
test('should properly parse type attributes: simple', () => {
const parseTypeArguments = jest.spyOn(parseTypeArgumentsMod, 'parseTypeArguments');

const project = getProjectResources(ForcProjectsEnum.STRUCT_WITHARRAY);
const project = getProjectResources(ForcProjectsEnum.STRUCT_WITH_ARRAY);

const rawTypes = project.abiContents.types;
const types = rawTypes.map((rawAbiType: IRawAbiTypeRoot) => makeType({ rawAbiType }));
Expand Down
1 change: 0 additions & 1 deletion packages/abi-typegen/src/templates/contract/dts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export function renderDtsTemplate(params: { abi: Abi }) {
'Contract',
'BytesLike',
'InvokeFunction',
'BN',
],
});

Expand Down
2 changes: 1 addition & 1 deletion packages/abi-typegen/test/fixtures/forc-projects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export enum ForcProjectsEnum {
SCRIPT = 'script',
STRUCT_NESTED = 'struct-nested',
STRUCT_SIMPLE = 'struct-simple',
STRUCT_WITHARRAY = 'struct-with-array',
STRUCT_WITH_ARRAY = 'struct-with-array',
TUPLE_SIMPLE = 'tuple-simple',
VECTOR_SIMPLE = 'vector-simple',
}
Expand Down

0 comments on commit 28c1cda

Please sign in to comment.