Skip to content

Commit

Permalink
Merge branch 'master' into oleksii/dynamic-supported-core-version
Browse files Browse the repository at this point in the history
  • Loading branch information
Br1ght0ne committed Mar 19, 2024
2 parents d43109f + df7ba2d commit 0ccc474
Show file tree
Hide file tree
Showing 122 changed files with 5,487 additions and 3,776 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ env:
CARGO_TERM_COLOR: always
DASEL_VERSION: https://github.com/TomWright/dasel/releases/download/v2.3.6/dasel_linux_amd64
RUSTFLAGS: "-D warnings"
FUEL_CORE_VERSION: 0.22.0
FUEL_CORE_VERSION: 0.23.0
FUEL_CORE_PATCH_BRANCH:
RUST_VERSION: 1.74.0
FORC_VERSION: 0.50.0
FORC_VERSION: 0.51.1
FORC_PATCH_BRANCH: ""
FORC_PATCH_REVISION: ""

Expand Down
44 changes: 22 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ readme = "README.md"
license = "Apache-2.0"
repository = "https://github.com/FuelLabs/fuels-rs"
rust-version = "1.74.0"
version = "0.55.0"
version = "0.56.0"

[workspace.dependencies]
Inflector = "0.11.4"
Expand Down Expand Up @@ -68,31 +68,31 @@ tokio = { version = "1.34.0", default-features = false }
tracing = "0.1.40"
trybuild = "1.0.85"
uint = { version = "0.9.5", default-features = false }
which = { version = "5.0.0", default-features = false }
which = { version = "6.0.0", default-features = false }
zeroize = "1.7.0"

# Dependencies from the `fuel-core` repository:
fuel-core = { version = "0.22.0", default-features = false }
fuel-core-chain-config = { version = "0.22.0", default-features = false }
fuel-core-client = { version = "0.22.0", default-features = false }
fuel-core-poa = { version = "0.22.0", default-features = false }
fuel-core-services = { version = "0.22.0", default-features = false }
fuel-core-types = { version = "0.22.0", default-features = false }
fuel-core = { version = "0.23.0", default-features = false }
fuel-core-chain-config = { version = "0.23.0", default-features = false }
fuel-core-client = { version = "0.23.0", default-features = false }
fuel-core-poa = { version = "0.23.0", default-features = false }
fuel-core-services = { version = "0.23.0", default-features = false }
fuel-core-types = { version = "0.23.0", default-features = false }

# Dependencies from the `fuel-vm` repository:
fuel-asm = { version = "0.43.1" }
fuel-crypto = { version = "0.43.1" }
fuel-merkle = { version = "0.43.1" }
fuel-storage = { version = "0.43.1" }
fuel-tx = { version = "0.43.1" }
fuel-types = { version = "0.43.1" }
fuel-vm = { version = "0.43.1" }
fuel-asm = { version = "0.47.1" }
fuel-crypto = { version = "0.47.1" }
fuel-merkle = { version = "0.47.1" }
fuel-storage = { version = "0.47.1" }
fuel-tx = { version = "0.47.1" }
fuel-types = { version = "0.47.1" }
fuel-vm = { version = "0.47.1" }

# Workspace projects
fuels = { version = "0.55.0", path = "./packages/fuels" }
fuels-accounts = { version = "0.55.0", path = "./packages/fuels-accounts", default-features = false }
fuels-code-gen = { version = "0.55.0", path = "./packages/fuels-code-gen", default-features = false }
fuels-core = { version = "0.55.0", path = "./packages/fuels-core", default-features = false }
fuels-macros = { version = "0.55.0", path = "./packages/fuels-macros", default-features = false }
fuels-programs = { version = "0.55.0", path = "./packages/fuels-programs", default-features = false }
fuels-test-helpers = { version = "0.55.0", path = "./packages/fuels-test-helpers", default-features = false }
fuels = { version = "0.56.0", path = "./packages/fuels" }
fuels-accounts = { version = "0.56.0", path = "./packages/fuels-accounts", default-features = false }
fuels-code-gen = { version = "0.56.0", path = "./packages/fuels-code-gen", default-features = false }
fuels-core = { version = "0.56.0", path = "./packages/fuels-core", default-features = false }
fuels-macros = { version = "0.56.0", path = "./packages/fuels-macros", default-features = false }
fuels-programs = { version = "0.56.0", path = "./packages/fuels-programs", default-features = false }
fuels-test-helpers = { version = "0.56.0", path = "./packages/fuels-test-helpers", default-features = false }
2 changes: 1 addition & 1 deletion docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
- [`Address`](./types/address.md)
- [`ContractId`](./types/contract-id.md)
- [`AssetId`](./types/asset-id.md)
- [Converting native types](./types/conversion.md)
- [`Bech32`](./types/bech32.md)
- [Structs and enums](./types/custom_types.md)
- [`String`](./types/string.md)
Expand All @@ -60,6 +59,7 @@
- [`B512`](./types/B512.md)
- [`EvmAddress`](./types/evm_address.md)
- [Vectors](./types/vectors.md)
- [Converting types](./types/conversion.md)
- [Codec](./codec/index.md)
- [Encoding](./codec/encoding.md)
- [Decoding](./codec/decoding.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/calling-contracts/call-params.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Then, in Rust, after setting up and deploying the above contract, you can config
<!-- payable:example:start -->
`call_params` returns a result to ensure you don't forward assets to a contract method that isn't payable.
<!-- payable:example:end -->
In the following example, we try to forward an amount of 100 of the base asset to `non_payable`. As its name suggests, `non_payable` isn't annotated with `#[payable]` in the contract code. Passing `CallParameters` with an amount other than 0 leads to an `InvalidCallParameters` error:
In the following example, we try to forward an amount of `100` of the base asset to `non_payable`. As its name suggests, `non_payable` isn't annotated with `#[payable]` in the contract code. Passing `CallParameters` with an amount other than `0` leads to an error:

```rust,ignore
{{#include ../../../packages/fuels/tests/contracts.rs:non_payable_params}}
Expand Down
13 changes: 4 additions & 9 deletions docs/src/calling-contracts/cost-estimation.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
# Estimating contract call cost

With the function `estimate_transaction_cost(tolerance: Option<f64>)` provided by `ContractCallHandler` and `ContractMultiCallHandler`, you can get a cost estimation for a specific call. The return type, `TransactionCost`, is a struct that contains relevant information for the estimation:
With the function `estimate_transaction_cost(tolerance: Option<f64>, block_horizon: Option<u32>)` provided by `ContractCallHandler` and `ContractMultiCallHandler`, you can get a cost estimation for a specific call. The return type, `TransactionCost`, is a struct that contains relevant information for the estimation:

```rust,ignore
TransactionCost {
min_gas_price: u64,
min_byte_price: u64,
gas_price: u64,
gas_used: u64,
metered_bytes_size: u64,
total_fee: f64, // where total_fee is the sum of the gas and byte fees
}
{{#include ../../../packages/fuels-accounts/src/provider.rs:transaction_cost}}
```

Below are examples that show how to get the estimated transaction cost from single and multi call transactions.
Expand All @@ -24,3 +17,5 @@ Below are examples that show how to get the estimated transaction cost from sing
```

The transaction cost estimation can be used to set the gas limit for an actual call, or to show the user the estimated cost.

> **Note** The same estimation interface is available for scripts.
2 changes: 1 addition & 1 deletion docs/src/calling-contracts/logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ You can use the `decode_logs()` function to retrieve a `LogResult` struct contai

Due to possible performance hits, it is not recommended to use `decode_logs()` outside of a debugging scenario.

> **Note:** String slices can not be logged directly. Use the `__to_str_array()` function to convert it to a `str[N]` first.
> **Note:** String slices cannot be logged directly. Use the `__to_str_array()` function to convert it to a `str[N]` first.
2 changes: 2 additions & 0 deletions docs/src/calling-contracts/low-level-calls.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ you would construct the function selector and the calldata as such, and provide
```rust,ignore
{{#include ../../../examples/contracts/src/lib.rs:low_level_call}}
```

> Note: the `calldata!` macro uses the default `EncoderConfig` configuration under the hood.
4 changes: 2 additions & 2 deletions docs/src/calling-contracts/tx-policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Transaction policies are defined as follows:

Where:

1. **Gas Price** - Maximum gas price for transaction.
1. **Tip** - amount to pay the block producer to prioritize the transaction.
2. **Witness Limit** - The maximum amount of witness data allowed for the transaction.
3. **Maturity** - Block until which the transaction cannot be included.
4. **Max Fee** - The maximum fee payable by this transaction.
5. **Script Gas Limit** - The maximum amount of gas the transaction may consume for executing its script code.

When the **Script Gas Limit** is not set, the Rust SDK will estimate the consumed gas in the background and set it as the limit. Similarly, if no **Gas Price** is defined, the Rust SDK defaults to the network's minimum gas price.
When the **Script Gas Limit** is not set, the Rust SDK will estimate the consumed gas in the background and set it as the limit.

If the **Witness Limit** is not set, the SDK will set it to the size of all witnesses and signatures defined in the transaction builder.

Expand Down
24 changes: 24 additions & 0 deletions docs/src/codec/encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,27 @@ There is also a shortcut-macro that can encode multiple types which implement [`

> Note:
> The above example will call `.resolve(0)`. Don't use it if you're encoding heap types.
## Configuring the encoder

The encoder can be configured to limit its resource expenditure:

```rust,ignore
{{#include ../../../examples/codec/src/lib.rs:configuring_the_encoder}}
```

The default values for the `EncoderConfig` are:

```rust,ignore
{{#include ../../../packages/fuels-core/src/codec/abi_encoder.rs:default_encoder_config}}
```

## Configuring the encoder for contract/script calls

You can also configure the encoder used to encode the arguments of the contract method:

```rust,ignore
{{#include ../../../examples/contracts/src/lib.rs:contract_encoder_config}}
```

The same method is available for script calls.
4 changes: 2 additions & 2 deletions docs/src/connecting/short-lived.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ let wallet = launch_provider_and_get_wallet().await?;
The `fuel-core-lib` feature allows us to run a `fuel-core` node without installing the `fuel-core` binary on the local machine. Using the `fuel-core-lib` feature flag entails downloading all the dependencies needed to run the fuel-core node.

```rust,ignore
fuels = { version = "0.55.0", features = ["fuel-core-lib"] }
fuels = { version = "0.56.0", features = ["fuel-core-lib"] }
```

### RocksDB

The `rocksdb` is an additional feature that, when combined with `fuel-core-lib`, provides persistent storage capabilities while using `fuel-core` as a library.

```rust,ignore
fuels = { version = "0.55.0", features = ["rocksdb"] }
fuels = { version = "0.56.0", features = ["rocksdb"] }
```
Loading

0 comments on commit 0ccc474

Please sign in to comment.