Commit graph

502 commits

Author SHA1 Message Date
Daniel Frederico Lins Leite
a81e481a8f
fix predicate entry fn (#5723)
## Description

This PR fix predicate entry function decoding arguments.

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
2024-03-14 12:12:06 +11:00
César D. Rodas
c1c25014f9
Implement Pid file locking (#5676)
## Description

Fixes #5633

Added functionality to create and manage a lock file containing the
process ID (pid) of the running instance of the software. This mechanism
prevents multiple instances of the software from running simultaneously
by checking the existence and content of the lock file. If the lock file
exists and contains a valid pid, the struct will error gracefully to
avoid conflicts. If the lock file is missing or contains an invalid pid,
the struct will proceed by removing the file. This ensures that only one
instance of the software can run at a time and it avoids stale locking
to prevent future instances


## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2024-03-06 23:59:59 +00:00
Daniel Frederico Lins Leite
c24d7319ab
New encoding for contract calls (#5427)
## Description

This PR implements the new encoding for contracts/scripts/predicates.
https://github.com/FuelLabs/sway/issues/5512 and
https://github.com/FuelLabs/sway/issues/5513

### Contract Calls

When the new encoding is turned on using `--experimental-new-encoding`,
contract calls like the example below will be "desugarized" differently
now.

```sway
let base_asset_id = BASE_ASSET_ID;
let other_contract_id = ContractId::from(0xa38576787f8900d66e6620548b6da8142b8bb4d129b2338609acd121ca126c10);

let test_contract = abi(ContextTesting, other_contract_id.into());
let returned_contract_id = test_contract.get_id { gas: gas, coins: 0, asset_id: BASE_ASSET_ID.value}(1, 2, 3);
```

and will be transformed to

```sway
let base_asset_id = BASE_ASSET_ID;
let other_contract_id = ContractId::from(0xa38576787f8900d66e6620548b6da8142b8bb4d129b2338609acd121ca126c10);

let test_contract = abi(ContextTesting, other_contract_id.into());
let returned_contract_id = contract_call::<ContractId, _>(other_contract_id.into(), "get_id", (1, 2, 3), coins, asset_id, gas);
```

And the important part is the `contract_call` function in the std
library. This function does all the encoding as necessary and delegates
the actual call to an intrinsic function `__contract_call`. Allowing the
protocol to evolve entirely in Sway.

```sway
pub fn contract_call<T, TArgs>(contract_id: b256, method_name: str, args: TArgs, coins: u64, asset_id: b256, gas: u64) -> T
where
    TArgs: AbiEncode
{
    let first_parameter = encode(method_name);
    let second_parameter = encode(args);
    let params = encode(
        (
            contract_id,
            asm(a: first_parameter.ptr()) { a: u64 },
            asm(a: second_parameter.ptr()) { a: u64 },
        )
    );
    __contract_call::<T>(params.ptr(), coins, asset_id, gas)
}
```

### Contracts

On the other side, when the flag `--expiremental-new-encoding` is turned
on, the contract specification like the one below is being transformed
into all the decoding and encoding necessary.

The mains points are:

- The compiler generates a function called `__entry` that decodes the
method name and its arguments. The method is selected with a bunch of
`if`s at the moment, because we don´t have `match` for string slices.
Then we `decode` the arguments using the correct type, which is a tuple
with all the function arguments, and expand this tuple calling the
function;
- All the contract functions are converted to global functions prefixed
with `__contract_method`;
- Results are encoded and returned using the intrinsic call `__retd`.

Example:

```sway
abi SomeContract {
    fn some_function(a: u64) -> u64;
}

impl SomeContract for Contract {
    fn some_function(a: u64) -> u64 {
        1
    }
}
```

will be transformed into 

```sway
fn __entry() {
    let method_name = decode_first_parameter();
    if method_name == "some_function" {
        let args = decode_second_parameter::<(u64,)>();
        let result = __contract_method_some_function(args.0);
        __retd(encode(result));
    }
    __revert(0);
}
```

### Scripts and Predicates

The protocol to call scripts and predicates will also change and will be
very similar to contracts. See more above. Now when the flag is turned
on, the `main` function will not be entry point anymore. The compiler
will actually generate an `__entry` function that will decode arguments
and encode the result, like contracts.

For example:

```sway
fn main(a: u64) -> u64 {
    1
}
```

will be transformed into

```sway
fn __entry() {
    let args = decode_script_data::<(u64,)();
    let result = main(args.0);
    __retd(encode(result));
}

fn main(a: u64) -> u64 {
    1
}
```

## Tests

To facilitate testing this PR introduces three changes to our test
harness:

1 - A new parameter can be called to update test output files (abi and
storage json). This facilitates when we only want to copy and paste
these output files to their respective oracles. Brings the framework
closer to a snapshot one.

``` 
> cargo r -p test --release -- --update-output-files
```

2 - Depending on the configuration at `test.toml` multiple executions of
the same test will be scheduled. At the moment, tests that depend on the
encoding will run with the `--experimental-new-encoding` flag
automatically. For example:

```
Testing should_pass/language/main_args/main_args_copy_copy ... ok
Testing should_pass/language/main_args/main_args_copy_copy (New Encoding) ... ok
```

3 - A new `script_data_new_encoding` was created because we want to
support and run tests with the two encoding for a time. This is also
what flags tests to run with the flag on automatically.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2024-03-06 21:33:35 +00:00
Sophie Dankel
c393984e4d
Add --version to forc-debug (#5687)
## Description

Implements `--version` for forc-debug, so that fuelup can show the
version.

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
2024-03-06 06:54:12 +00:00
Sophie Dankel
cd04e737b9
Add docs about forc debug (#5683)
## Description


## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
2024-03-05 13:19:24 -07:00
IGI-111
d1e8f019c1
Revert to cc 1.0.83 and bump to 0.51.1 (#5649)
cc version 1.0.86 has a bug that blocks our cross compilation pipeline
https://github.com/rust-lang/cc-rs/issues/964
2024-02-23 08:59:26 +03:00
IGI-111
694457da6a
Bump to v0.51.0 (#5647) 2024-02-22 19:12:42 +00:00
Sophie Dankel
68191dd734
Refactor with generic manifest trait (#5625)
Follow up to https://github.com/FuelLabs/sway/pull/5477

https://github.com/FuelLabs/sway/pull/5477#discussion_r1491737110

---------

Co-authored-by: Vaivaswatha Nagaraj <vaivaswatha.nagaraj@fuel.sh>
Co-authored-by: Vaivaswatha N <vaivaswatha@users.noreply.github.com>
Co-authored-by: IGI-111 <igi-111@protonmail.com>
Co-authored-by: João Matos <joao@tritao.eu>
Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
Co-authored-by: Igor Rončević <ironcev@hotmail.com>
Co-authored-by: Sudhakar Verma <10460978+sudhackar@users.noreply.github.com>
Co-authored-by: Marcos Henrich <marcoshenrich@gmail.com>
Co-authored-by: jjcnn <38888011+jjcnn@users.noreply.github.com>
2024-02-21 20:55:27 +00:00
Sophie Dankel
60922103ea
Re-enable test_server_launch_mode (#5638)
## Description

Closes https://github.com/FuelLabs/sway/issues/5637

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
2024-02-20 19:56:16 +00:00
Sophie Dankel
109acee32f
Temporarily disable test_server_launch_mode (#5635)
## Description

This test is failing on PRs. Disabling for now while I investigate the
root cause.

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
2024-02-20 10:03:19 -08:00
Sophie Dankel
4cf3398cea
Adds a DAP server with support for debugging sway unit tests (#5477)
## Description

Related https://github.com/FuelLabs/sway-vscode-plugin/pull/166

Adds a [DAP](https://microsoft.github.io/debug-adapter-protocol//)
server as a new forc plugin, `forc-debug`. This enables a UI debugging
experience in IDEs such as VSCode.

For now, only debugging forc tests is supported. Users can:
- set breakpoints inside of forc tests
- step through the test, one VM instruction at a time, or continue to
the next breakpoint
- debug through multiple tests sequentially
- see the VM register values in the IDE while debugging
- see the current VM opcode, its inputs, and/or immediate value when
when the VM is stopped

### Screenshots


24e2016c-d96c-4ef6-931f-8a4ce4f1386b


5f0fed49-b278-4074-a1a1-d37de00776f8

![Feb-01-2024
21-46-40](23ade516-0068-4f7c-b7bf-b4142137f72c)


### Local testing

1. Install `forc-debug`
2. Copy this sample launch.json in the VSCode workspace with sway code
to debug:

```json
{
    "version": "0.2.0",
    "configurations": [
        {
        "type": "sway",
        "request": "launch",
        "name": "Debug Sway",
        "program": "${file}"
    }]
}
```

3. Follow [the
steps](https://github.com/FuelLabs/sway-vscode-plugin/blob/master/docs/testing.md)
for testing the VSCode extension

### Limitations

- Breakpoints only work inside of the project/workspace being debugged
- Stack trace support is limited
- Not every line has source maps. Once debugging, "verified" breakpoints
will show red and "unverified" (no source maps) will be greyed out.
- Watch/repl expressions are not yet supported
- Step into/out of is not supported
- If you click "step over" many times in rapid succession, the server
takes a while to catch up.

Closes https://github.com/FuelLabs/sway/issues/5394 

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: Vaivaswatha Nagaraj <vaivaswatha.nagaraj@fuel.sh>
Co-authored-by: Vaivaswatha N <vaivaswatha@users.noreply.github.com>
Co-authored-by: IGI-111 <igi-111@protonmail.com>
Co-authored-by: João Matos <joao@tritao.eu>
Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
Co-authored-by: Igor Rončević <ironcev@hotmail.com>
Co-authored-by: Sudhakar Verma <10460978+sudhackar@users.noreply.github.com>
Co-authored-by: Marcos Henrich <marcoshenrich@gmail.com>
Co-authored-by: jjcnn <38888011+jjcnn@users.noreply.github.com>
2024-02-20 03:24:13 +00:00
Marcos Henrich
b32d0e0ae4
Implements the Never ! types as a TypeInfo bottom type. (#5602)
## Description

We now parse the `!` as a TypeInfo::Never, and remove the usage of empty
enums as Never type in our code.

This commit removes completely the DeterministicallyAborts and
TypeCheckUnificationContext.

The DeterministicallyAborts can be removed because the Never TypeInfo is
now propagated using the type checker. Code blocks that return, break,
continue, or call an expression that returns Never, are marked as Never.

Partially fixes #5562.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2024-02-20 05:44:38 +04:00
Sophie Dankel
f8b743130e
Make forc-deploy create release builds by default (#5609)
## Description

Closes https://github.com/FuelLabs/sway/issues/5607

Solves part [1] of https://github.com/FuelLabs/sway/issues/5607 by
making "release" the default build plan for forc-deploy. It can still be
overridden, i.e. for the test harness.

Other changes:

- removed the `--release` and `--error-on-warnings` options from
forc-deploy, since those aren't needed.
- refactored `BuildProfile` into its own file and added a test, since I
noticed some of the options weren't deserializing

## Checklist

- [x] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
2024-02-16 17:45:55 -08:00
César D. Rodas
7bcac37d98
Improve cli_examples macro (#5589)
## Description

Add macro to test argument parsing rather than testing the external
command through building and spawning a separated process. This is an
improved version of #5519

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2024-02-10 14:54:51 +11:00
IGI-111
11231184a0
Bump to v0.50.0 (#5564) 2024-02-07 18:19:09 +04:00
Joshua Batty
f702c41a17
Disable DCA and writing diagnostics on did_change events (#5555)
## Description
This PR does 3 optimizations. The timings below are measured against the
LSP benchmarking project.

1. Disable running DCA & control flow analysis, for did_change events
`39.544ms`
2. Disable running collect_types_metadata for did_change events
`3.522ms`
3. Only write the diagnostics res to self.diagnostics.write() on
did_open & did_save `21.135ms`

I also had to increase the frequency that we are calling GC to every 3rd
keystroke as during stress tests I was occasionally getting stack
overflows otherwise.

related to #5445

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
2024-02-07 10:47:12 +11:00
João Matos
c4e3f13f06
Refactor parsed declaration storage (#5443)
## Description

This PR introduces a new `ParsedDeclEngine` which acts as the storage
place for parsed declarations. This is basically a clone of `DeclEngine`
but only used for untyped parsed declarations.

Declarations stored in this new engine are referenced by a
`ParsedDeclId` which again is analogous to our existing `DeclId`.

The rationale for introducing this is to be able to reference parsed
declarations during a multi-stage semantic analysis / type-checking
process. A cross-referencing mechanism between untyped/typed AST
declarations will still need to be implemented.

Just to note, `rustc` provides a similar architecture with their
`NodeId` / `DefId`, which provide a similar role to our `ParsedDeclId` /
`DeclId`, except we only support storing top-level AST entities, whereas
the system in Rust from what I understand can also be used to reference
individual expressions.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2024-01-29 15:07:14 +00:00
Daniel Frederico Lins Leite
27a792400f
Fixes for auto impl of AbiEncode; encoding version and better tests (#5481)
## Description

This PR is a continuation of https://github.com/FuelLabs/sway/pull/5306.

- I am fixing some code reviews issues that were raised in the other PR;
- I am incorporating the encoding version inside the JSON ABI as:

```json
          {
            "configurables": [],
             "encoding": "1",  <- look here
            "functions": [
              {
                "attributes": null,
                "inputs": [],
                "name": "main",
                "output": {
                  "name": "",
                  "type": 13,
                  "typeArguments": null
                }
              }
            ],
```

This field is a string to allow any kind of versioning we choose.

- This PR has also improved testing and making more explicit how each
type is being encoded.
## Dependencies

- [x] https://github.com/FuelLabs/fuel-abi-types/pull/17

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2024-01-26 22:28:00 +00:00
César D. Rodas
a8d76e3379
Add support recover key (#5419)
## Description

Add recover-public-key to forc-crypto

This function is ported from
https://github.com/FuelLabs/forc-wallet/pull/152

This PR depends on #5388

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2024-01-23 13:14:29 +11:00
Kaya Gökalp
2ac7030570
chore: bump version to 0.49.1 (#5495)
## Description
Bumps version to 0.49.1.
2024-01-19 21:29:31 +03:00
César D. Rodas
81bee2a387
Use filter_map instead of filter() and map() (#5493)
Fixes #5436

## Description

Replace chained `filter` and then `map` calls for a single `filter_map`
calls and other minor optimizations

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2024-01-19 04:25:07 +00:00
Kaya Gökalp
a17fbf3e7d
chore: bump to v0.49.0 (#5452)
## Description
Bumps repo to 0.49.0, made this a major one after some thought as we
longer support beta-4 as tooling with this release.
Also ran `cargo update` as this is a breaking change

---------

Co-authored-by: Sophie Dankel <47993817+sdankel@users.noreply.github.com>
Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
2024-01-18 04:42:23 +03:00
Kaya Gökalp
63aa90096d
fix: depend on std via path for forc-doc, forc-fmt and forc-tx cli tests (#5483)
## Description
related to #5463 

Fixes std dependency on released std for forc-doc, forc-fmt and forc-tx
test projects used in cli tests which breaks release structure.
2024-01-17 12:18:34 -08:00
Daniel Frederico Lins Leite
cab2db3c37
__log outputting encoded values (#5306)
## Description

This PR changes the output of `__log` to encoded values (see
https://github.com/FuelLabs/sway/issues/4769). A quick example of what
that means is

```sway
struct S {
    a: u64,
    b: u32,
    c: u16,
    d: u8,
    e: Vec<u64>,
    f: str,
    g: u256
}

let mut e = Vec::new();
e.push(1);
e.push(2);
e.push(3);

__log(S{
    a: 1,
    b: 2,
    c: 3,
    d: 4,
    e,
    f: "sway",
    g: u256::max()
});
```

will output

```
 [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 4,    115,   119,    97,   121, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]
  ^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^  ^^^^  ^  ^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^     ^^^    ^^^     ^^    ^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     s.a         s.b   s.c s.d              s.e.len()                  s.e[0]                  s.e[1]                  s.e[2]               s.f.len()  s.f[0] s.f[1] s.f[2] s.f[3]  s.g
```

This works in two steps:

1 - `__log(s)` is desugared into `__log(encode(s))`;
2 - call `encode`. Its impl can be found at
https://github.com/FuelLabs/sway/pull/5306/files#diff-ee5cebc963e841e8af05f3986de17dd266ee6e9b49dbe089a5eb64764f3b802eR307

It simply creates an append-only buffer and call `abi_encode` from a
special trait named `AbiEncode`.

To be encodable, a type must implement `AbiEncode`. In the example
above, `S` is auto-implemented by the compiler because all its fields
are `AbiEncode`. But we can also have custom impl like `Vec` here:
https://github.com/FuelLabs/sway/pull/5306/files#diff-b5d9688741fea479477f26ca44cd1d1ecbd2f003f3875292abb23df7fad85c58

All this is behind a compiler flag:

```
> forc build -h
Compile the current or target project

USAGE:
    forc build [OPTIONS]

OPTIONS:
...
        --experimental-new-encoding
            Experimental flags for the "new encoding" feature
```

The same flag is available for the `e2e` tests:

```
> cargo r -p test --release -- should_pass/language/logging --verbose --experimental-new-encoding
```

## Limitations

1 - Now that __log demands a `fn` called `encode`, when something is
compiled with `implicit-std: false`, the intrinsic function `__log` does
not work out-of-box anymore. A function called `encode` must "visible"
and the worst part is that it needs to be functional to log anything.

2 - Arrays, string arrays and tuples will have limited implementations.
Currently up to five items.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
2024-01-15 11:26:01 +00:00
Halimao
e678a3fed2
refactor: improve the flow of forc deploy when selecting an account that doesn't exist (#5447)
## Description

Close #5310

Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
2024-01-14 23:18:34 +00:00
Kaya Gökalp
9fbb523719
feat: add beta-5 network to supported networks (#5460)
## Description
closes #5458. 
Adds beta-5 as a possible target for forc-client.

---------

Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
2024-01-14 22:56:21 +00:00
Kaya Gökalp
5ee8877716
fix: point std to local version for forc-client cli tests (#5457)
## Description

It seems like we accidentally depend on released version of std in
forc-client deployment cli tests (more specifically the test folder
https://github.com/FuelLabs/sway/tree/master/forc-plugins/forc-client/tests).
This PR fixes it to point local version of std so that release PRs such
as #5452 won't get blocked.
2024-01-12 15:59:30 -03:00
Halimao
e7a592bcef
refactor: update error message for forc deploy when password is mismatch (#5446)
Close #5309
2024-01-10 21:33:31 +03:00
César D. Rodas
fb06a8f038
Add examples to cli --help (#5388)
## Description

Fixes #5398, #5374

Add examples to our `--help` cli. The examples are defined through the a
macro `forc::cli_examples { }` and each of these examples is part of the
the test suite of the crate. This is done to ensure the documentation is
always up to date or updated whenever the tests are not passing.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: Braqzen <103777923+Braqzen@users.noreply.github.com>
2024-01-10 16:47:40 +11:00
Joshua Batty
a164fe1769
Implement a more responsive compilation thread in the the language server. (#5429) 2024-01-09 10:53:38 +11:00
Kaya Gökalp
3fcb76cfb2
chore: use sdk v0.54.0 to enable forc-client deployments to beta5 (#5433)
## Description

closes #5432 

Bumps used forc-wallet version to 0.4.1 and used sdk versions to 0.54.0
so that we can actually start deploying to beta-5. As we need to be
using forc-client 0.22 which requires us to go to 0.54.0 of sdk. To do
so we need the wallet to use it as well.

---------

Co-authored-by: Cesar Rodas <cesar@rodasm.com.py>
2024-01-08 22:25:03 +00:00
Sarah Schwartz
fe65ca46dd
docs: configure spell check, minor improvements (#5369)
This PR configures the spell-check added to the docs workflow in the
github-actions repo: https://github.com/FuelLabs/github-actions/pull/23

The files checked are configured in `.spellcheck.yml`. This is also
where you can configure what types of elements are ignored.

Right now it ignores:
- All code blocks that have a language (and will check code blocks that
do not have a language)
- Anything in between backticks
- Words in `spell-check-custom-words.txt` (case sensitive, only exact
match)
- Numbers, even if they are attached to a word
- Links in markdown link format

#### Handling errors:

If the test fails:
- look up the word in the question to verify it is a real word and is
correctly spelled
- If it is a file name or is code, use backticks to ignore the word.
- If it is a real word that is spelled correctly, or an acronym that is
either common or is defined already, add it to
`spell-check-custom-words.txt`.
- If needed, rewrite the sentence. Ex: DON'T use "`lock`ing" and add
"ing" to the custom words list. Instead, rewrite the sentence as
"locking with the `lock` method".
- If it otherwise should be ignored, you can configure the pipeline in
`.spellcheck.yml`.

---------

Co-authored-by: Sophie Dankel <47993817+sdankel@users.noreply.github.com>
2023-12-19 15:10:26 -08:00
Sophie Dankel
0d0dd8f7ec
Add fuel-debugger as a forc plugin (#5390)
## Description

Closes https://github.com/FuelLabs/fuel-debugger/issues/15

Moves https://github.com/FuelLabs/fuel-debugger into a forc plugin.

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: Hannes Karppila <hannes.karppila@gmail.com>
2023-12-14 15:03:25 -08:00
Joshua Batty
764ed7c4b7
Use Jemalloc in forc-lsp and LSP benchmarks for greater performance. (#5373)
## Description

closes #5372

Thanks for the idea @Voxelot , we seem to be getting nice performance
wins across all our benchmarks with this change!

| Benchmark | Avg Duration Before (ms or s) | Avg Duration After (ms or
s) | Speed Increase (%) |

|--------------------------|-------------------------------|------------------------------|--------------------|
| compile | 5.53213 s | 4.64997 s | 15.931 |
| traverse | 170.646 ms | 162.067 ms | 5.0397 |
| did_change_with_caching | 15.332 s | 15.4923 s | -1.04545 |
| semantic_tokens | 20.766 ms | 15.981 ms | 23.053 |
| document_symbol | 7.9145 ms | 5.99825 ms | 24.2205 |
| completion | 49.685 ms | 48.5775 ms | 2.22975 |
| hover | 7.42155 ms | 6.23545 ms | 15.952 |
| highlight | 113.75 ms | 108.503 ms | 4.6195 |
| goto_definition | 7.99853 ms | 6.53863 ms | 18.3765 |
| inlay_hints | 10.6885 ms | 8.99667 ms | 15.814 |
| prepare_rename | 7.9312 ms | 6.38533 ms | 19.4985 |
| rename | 119.68 ms | 113.803 ms | 4.9071 |
| code_action | 60.1105 ms | 55.44 ms | 7.7762 |
| code_lens | 0.365733 ms | 0.2341 ms | 35.989 |
| on_enter | 0.604733 ms | 0.3105 ms | 48.676 |
| format | 51.57 ms | 44.6735 ms | 13.3765 |
| tokens_for_file | 10.3933 ms | 8.85676 ms | 14.723 |
| idents_at_position | 3.81803 ms | 3.1588 ms | 17.261 |
| tokens_at_position | 42.2257 ms | 40.9237 ms | 3.0873 |
| token_at_position | 7.67043 ms | 6.2267 ms | 18.811 |
| parent_decl_at_position | 42.87 ms | 40.8167 ms | 4.7931 |
2023-12-07 04:03:43 +01:00
IGI-111
6886ef050c
Fix release Dockerfile and bump to v0.48.1 (#5370) 2023-12-06 10:37:39 +00:00
Joshua Batty
e451140ce0
Bump to v0.48.0 (#5275)
Co-authored-by: Kaya Gokalp <kayagokalp123@gmail.com>
2023-12-06 17:48:58 +11:00
hal3e
fc17c39e83
feat!: add transaction policies support (#5281)
## Description
co-developed with: @IGI-111 and @xgreenx

This PR adds support for transaction policies. 

What was done:
- bump `fuel-vm` to `0.43.1`
- bump `fuels-rs` to `0.53.0`
- update the `std-lib` to handle new `GTF` codes and the transaction
policies
- update all test

BREAKING CHANGE:
- removed `TxParameters` in favor of `TxPolicies`
- changed `gtf` opcodes 
- removed `Mint` from `forc-tx` and cli

## Checklist
- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: green <xgreenx9999@gmail.com>
Co-authored-by: Elvis <elvisdedic@outlook.com>
Co-authored-by: IGI-111 <igi-111@protonmail.com>
Co-authored-by: xunilrj <xunilrj@hotmail.com>
Co-authored-by: Vaivaswatha Nagaraj <vaivaswatha.nagaraj@fuel.sh>
Co-authored-by: Kaya Gökalp <kaya.gokalp@fuel.sh>
Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
Co-authored-by: Sophie Dankel <47993817+sdankel@users.noreply.github.com>
2023-12-06 03:19:54 +04:00
Marcos Henrich
1e12d5d13f
Changes ConcurrentSlab to no longer clone values (#5313)
## Description

`ConcurrentSlab` now stores and returns an Arc, and on `get` it only
clones an Arc which is much cheaper than cloning the whole values.

The type engine is still cloning every TypeInfo we should be able to
also avoid that and get further improvements in speed.

With these changes core + std-lib compilation improved from around 3
secs to 1.5 secs.
`cargo run --bin test --release` is running in around 8min versus 16min
in master.

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2023-12-02 14:08:32 -05:00
Sophie Dankel
cd096e0bdd
Allow user to override initial storage slots in forc-deploy (#5311)
## Description

Closes https://github.com/FuelLabs/sway/issues/2010

Notes: 
- I couldn't use `from_reader` to deserialize the file contents due to
this issue: https://github.com/FuelLabs/fuel-vm/pull/643

## Checklist

- [x] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
2023-11-28 16:44:18 -08:00
Sophie Dankel
d07a84bbd7
Search bar for forc-doc (#5269)
## Description

Closes https://github.com/FuelLabs/sway/issues/3480

A simple search bar for forc-doc. It uses a case-insensitive search of
item names, across the library and all of its dependencies. Names in the
search results are highlighted similar to docs.rs.

![Nov-14-2023
22-21-07](0a8f5bea-eace-405c-a26e-e8c17b9756c1)

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: Chris O'Brien <obrchr96@gmail.com>
Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
2023-11-15 21:47:08 +03:00
IGI-111
34265301c6
Bump to v0.47.0 (#5257) 2023-11-06 11:04:34 +04:00
Cesar
d1bc49d7f5
Fix hash.sw, replaced #![foo] for #[foo] (#5248)
## Description

Fixes #5059 

While doing this I also updated `forc-fmt` to have a better error
message being printed to the stdout

Before:

```bash
error: Formatting skipped due to error.
error: Failed to compile /Users/cr-fuel/projects/fuel/sway/sway-lib-std/src/hash.sw
```

Now:

```bash
error: Formatting skipped due to error.
error: Failed to compile /Users/cr-fuel/projects/fuel/sway/sway-lib-std/src/hash.sw
Cannot format raw hashbang attribute,
If this is intended to be a doc comment try using the `//!` syntax instead
```

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2023-11-01 23:39:44 +00:00
Cesar
6d345f6e0e
#4318 forc-crypto plugin exposing a CLI for common-use cryptographic operations (#5153)
## Description

Fixes #4318

Supported algorithms:
* [x] keccak256
* [x] sha256
* [ ] ~ecrecover~ (this will be added later)
* [x] bech32-to-hex
* [x] hex-to-bech32
* [x] new-key / parse-secret (from
https://github.com/FuelLabs/fuel-core/blob/master/bin/keygen/src/keygen.rs)

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2023-10-28 11:54:58 -03:00
Joshua Batty
b69ea4f790
refactor: Move dir helpers from forc-util to sway-utils (#5224)
## Description
This PR just moves the dir helpers that were in `forc-util` to
`sway-utils`. I need access to these methods in an upcoming PR and
having them in `forc-util` introduces a mind field of circular
dependencies.
2023-10-25 02:38:50 +00:00
Chris-san
8e6a60cc68
Add go-to definition for dependency types: ImplTraits (#5205)
Ref #4705 

What this does:
- Adds go-to definition functionality for external traits implemented
for some local type, eg `impl Foo for Bar` where `Foo` is a dependency
type
- Adds `no_deps` to `RenderPlan`, when this flag is passed dependencies
aren't built, so we also shouldn't produce links to docs that won't be
there
- Adds a test harness that uses the Sway -> HTML compiler 

First part of the video shows the output when built with `--no-deps`
which does not build dependency docs (in this instance `core`), and thus
produces no links to those dependencies. Second shows without the flag.

[Screencast from 2023-10-20
01-54-57.webm](fb3a1275-19fa-47ad-a4d3-551211383226)

---------

Co-authored-by: Chris O'Brien <obrchr96@gmail.com>
2023-10-25 01:03:58 +00:00
Marcos Henrich
ae8a39c4b9
Implements qualified paths for associated types. (#5160)
## Description

Adds support for checking if using fully qualified call paths is
necessary on associated types disambiguation.

Adds support for specifying fully qualified paths of associated types
used in type ascriptions.

Adds support for specifying fully qualified path when calling methods of
associated types and when using associated consts of associated types.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2023-10-13 10:15:31 +00:00
Anton Trunov
4636a936d7
Replace TypeInfo::SelfType with a generic type parameter (#4962)
## Description

Fixes #4877

## Tasks

- [x] Make a simple example with a trait and an impl for it compile
- [x] Fix typechecking for empty enums
- [x] Fix typechecking for trait impl methods
- [x] Fix typechecking for impl self blocks
- [x] Fix the case of non-implemented supertraits
- [x] Fix typechecking of generic traits
- [x] Fix typechecking of generic impl self blocks
- [x] Resolve ambiguity between term/path-level `Self` and the
type-level `Self` type parameter (related PR #4459):
       - [x] enums
       - [x] structs (deferred as issue #5164)
- [x] Fix `Self` for type constraints
- [x] Fix looping during insertion of trait constraints for generic
tuples (inserted `occurs_check` to prevent unification of a generic `A`
with a tuple `(A, A)`;
- [x] Fix exponential growth of the traits map (around 30 tests out of
more than 680 are failing now); related PR: #5004
- [x] Fix `Self` type for blanket implementations
- [x] Fix `Self` for associated consts
- [x] Fix name resolution issues for some tests with traits (like
`should_pass/language/eq_intrinsic`); blocking issues:
       - #5018 
       - #5036
- [x] Fix `should_fail/generic_traits` test
- [x] Fix `should_pass/language/where_clause_impls` test
- [x] Fix `should_pass/language/name_resolution_inside_intrinsics` test
- [x] Remove some commented out code in `impl_trait.rs`
- [x] Comment new code
- [x] **Disable** `should_pass/language/associated_type_container` test
- [x] **Disable** `should_pass/language/associated_type_method` test
- [x] **Disable**
`should_pass/language/associated_type_and_associated_const` test
- [x] **Disable** `should_pass/language/associated_type_iterator` test

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
Co-authored-by: IGI-111 <igi-111@protonmail.com>
2023-10-03 15:59:19 +04:00
Kaya Gökalp
512a3386f8
Bump to v0.46.1 (#5149)
## Description
Bumps version to 0.46.1.
2023-09-28 23:42:04 +03:00
Chris-san
503c192b02
Adds a README to forc-doc (#5126)
Adds a `README` to forc-doc, as well as some general clean up and documentation.
2023-09-21 11:37:18 -05:00
Marcos Henrich
d61fc362c4
Implements associated types (#5048)
## Description

Implements associated types parsing.

Adds associated types to trait map.

Modifies resolve_symbol to handle associated types.

Support was added for type ascription, methods parameters, method return
types, and function parameters.

It is still missing fully qualified paths, and checking associated types
name conflicts.

It is also missing updating the documentation.

Closes #4487
Closes #610

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: IGI-111 <igi-111@protonmail.com>
2023-09-19 19:14:41 +01:00