Skip to content

Commit 4875fbb

Browse files
committed
Merge remote-tracking branch 'origin/master' into upgrade/fuel-core-master
2 parents df6f403 + d8704e1 commit 4875fbb

File tree

60 files changed

+641
-664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+641
-664
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ env:
1919
FUEL_CORE_VERSION: 0.20.6
2020
RUST_VERSION: 1.72.1
2121
FORC_VERSION: 0.46.0
22-
FORC_PATCH_BRANCH: ""
22+
FORC_PATCH_BRANCH: "xunilrj/fix-implicit-std-env-vars"
2323
FORC_PATCH_REVISION: ""
24+
FORC_IMPLICIT_STD_GIT_BRANCH: "xunilrj/fix-implicit-std-env-vars"
2425

2526
jobs:
2627
setup-test-projects:

.github/workflows/scripts/verify_tag.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fi
2525

2626
# strip preceeding 'v' if it exists on tag
2727
REF=${REF/#v}
28-
TOML_VERSION=$(cat $MANIFEST | dasel -r toml 'workspace.package.version')
28+
TOML_VERSION=$(cat $MANIFEST | dasel -r toml -w plain 'workspace.package.version')
2929

3030
if [ "$TOML_VERSION" != "$REF" ]; then
3131
err "Crate version $TOML_VERSION, doesn't match tag version $REF"

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ readme = "README.md"
3636
license = "Apache-2.0"
3737
repository = "https://github.com/FuelLabs/fuels-rs"
3838
rust-version = "1.72.1"
39-
version = "0.49.0"
39+
version = "0.50.1"
4040

4141
[workspace.dependencies]
4242
Inflector = "0.11.4"
@@ -87,13 +87,13 @@ fuel-types = { version = "0.35.4", default-features = false }
8787
fuel-vm = "0.35.4"
8888

8989
# Workspace projects
90-
fuels = { version = "0.49.0", path = "./packages/fuels" }
91-
fuels-accounts = { version = "0.49.0", path = "./packages/fuels-accounts", default-features = false }
92-
fuels-code-gen = { version = "0.49.0", path = "./packages/fuels-code-gen", default-features = false }
93-
fuels-core = { version = "0.49.0", path = "./packages/fuels-core", default-features = false }
94-
fuels-macros = { version = "0.49.0", path = "./packages/fuels-macros", default-features = false }
95-
fuels-programs = { version = "0.49.0", path = "./packages/fuels-programs", default-features = false }
96-
fuels-test-helpers = { version = "0.49.0", path = "./packages/fuels-test-helpers", default-features = false }
90+
fuels = { version = "0.50.1", path = "./packages/fuels" }
91+
fuels-accounts = { version = "0.50.1", path = "./packages/fuels-accounts", default-features = false }
92+
fuels-code-gen = { version = "0.50.1", path = "./packages/fuels-code-gen", default-features = false }
93+
fuels-core = { version = "0.50.1", path = "./packages/fuels-core", default-features = false }
94+
fuels-macros = { version = "0.50.1", path = "./packages/fuels-macros", default-features = false }
95+
fuels-programs = { version = "0.50.1", path = "./packages/fuels-programs", default-features = false }
96+
fuels-test-helpers = { version = "0.50.1", path = "./packages/fuels-test-helpers", default-features = false }
9797

9898
[patch.crates-io]
9999
fuel-core = { git = "https://github.com/FuelLabs/fuel-core", branch = "master" }

docs/src/connecting/short-lived.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ let wallet = launch_provider_and_get_wallet().await?;
2727
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.
2828

2929
```rust,ignore
30-
fuels = { version = "0.49.0", features = ["fuel-core-lib"] }
30+
fuels = { version = "0.50.1", features = ["fuel-core-lib"] }
3131
```
3232

3333
### RocksDb
3434

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

3737
```rust,ignore
38-
fuels = { version = "0.49.0", features = ["rocksdb"] }
38+
fuels = { version = "0.50.1", features = ["rocksdb"] }
3939
```

examples/contracts/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ mod tests {
103103
.await?;
104104
// ANCHOR_END: contract_call_cost_estimation
105105

106-
assert_eq!(transaction_cost.gas_used, 397);
106+
assert_eq!(transaction_cost.gas_used, 470);
107107

108108
Ok(())
109109
}
@@ -649,7 +649,7 @@ mod tests {
649649
.await?;
650650
// ANCHOR_END: multi_call_cost_estimation
651651

652-
assert_eq!(transaction_cost.gas_used, 618);
652+
assert_eq!(transaction_cost.gas_used, 693);
653653

654654
Ok(())
655655
}

packages/fuels-accounts/src/accounts_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use fuels_core::{
44
constants::BASE_ASSET_ID,
55
types::{
66
bech32::Bech32Address,
7-
errors::{error, Error, Result},
7+
errors::{error, Result},
88
input::Input,
99
transaction_builders::TransactionBuilder,
1010
},

packages/fuels-accounts/src/provider.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ impl Provider {
307307
TxStatus::Revert {
308308
receipts,
309309
reason,
310-
id: revert_id,
310+
revert_id,
311311
}
312312
}
313313
TransactionStatus::Submitted { .. } => TxStatus::Submitted,
@@ -384,7 +384,7 @@ impl Provider {
384384
Some(reason) => TxStatus::Revert {
385385
receipts,
386386
reason,
387-
id: 0,
387+
revert_id: 0,
388388
},
389389
None => TxStatus::Success { receipts },
390390
}

packages/fuels-accounts/src/provider/retry_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{fmt::Debug, future::Future, num::NonZeroU32, time::Duration};
22

3-
use fuels_core::types::errors::{error, Error, Result as SdkResult};
3+
use fuels_core::types::errors::{error, Result as SdkResult};
44

55
/// A set of strategies to control retry intervals between attempts.
66
///

packages/fuels-accounts/src/provider/retryable_client.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ use fuel_core_client::client::{
88
};
99
use fuel_tx::{Receipt, Transaction, TxId, UtxoId};
1010
use fuel_types::{Address, AssetId, BlockHeight, ContractId, MessageId, Nonce};
11-
use fuels_core::{
12-
error,
13-
types::errors::{Error, Result},
14-
};
11+
use fuels_core::{error, types::errors::Result};
1512

1613
use crate::provider::{retry_util, RetryConfig};
1714

packages/fuels-core/src/codec/abi_decoder.rs

Lines changed: 29 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,19 @@ impl ABIDecoder {
5252
///
5353
/// let decoder = ABIDecoder::default();
5454
///
55-
/// let token = decoder.decode(&ParamType::U8, &[0, 0, 0, 0, 0, 0, 0, 7]).unwrap();
55+
/// let token = decoder.decode(&ParamType::U64, &[0, 0, 0, 0, 0, 0, 0, 7]).unwrap();
5656
///
57-
/// assert_eq!(u8::from_token(token).unwrap(), 7u8);
57+
/// assert_eq!(u64::from_token(token).unwrap(), 7u64);
5858
/// ```
5959
pub fn decode(&self, param_type: &ParamType, bytes: &[u8]) -> Result<Token> {
6060
BoundedDecoder::new(self.config).decode(param_type, bytes)
6161
}
6262

63+
/// Decode data from one of the receipt returns.
64+
pub fn decode_receipt_return(&self, param_type: &ParamType, bytes: &[u8]) -> Result<Token> {
65+
BoundedDecoder::new(self.config).decode(param_type, bytes)
66+
}
67+
6368
/// Same as `decode` but decodes multiple `ParamType`s in one go.
6469
/// # Examples
6570
/// ```
@@ -68,7 +73,7 @@ impl ABIDecoder {
6873
/// use fuels_core::types::Token;
6974
///
7075
/// let decoder = ABIDecoder::default();
71-
/// let data: &[u8] = &[0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 8];
76+
/// let data: &[u8] = &[7, 8];
7277
///
7378
/// let tokens = decoder.decode_multiple(&[ParamType::U8, ParamType::U8], &data).unwrap();
7479
///
@@ -114,7 +119,7 @@ mod tests {
114119
];
115120
let data = [
116121
0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, // u32
117-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, // u8
122+
0xff, // u8
118123
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, // u16
119124
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // u64
120125
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
@@ -141,9 +146,7 @@ mod tests {
141146
#[test]
142147
fn decode_bool() -> Result<()> {
143148
let types = vec![ParamType::Bool, ParamType::Bool];
144-
let data = [
145-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x00,
146-
];
149+
let data = [0x01, 0x0];
147150

148151
let decoded = ABIDecoder::default().decode_multiple(&types, &data)?;
149152

@@ -215,9 +218,7 @@ mod tests {
215218
fn decode_array() -> Result<()> {
216219
// Create a parameter type for u8[2].
217220
let types = vec![ParamType::Array(Box::new(ParamType::U8), 2)];
218-
let data = [
219-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2a,
220-
];
221+
let data = [0xff, 0x2a];
221222

222223
let decoded = ABIDecoder::default().decode_multiple(&types, &data)?;
223224

@@ -234,7 +235,7 @@ mod tests {
234235
// }
235236

236237
let data = [
237-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1,
238+
0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
238239
];
239240
let param_type = ParamType::Struct {
240241
fields: vec![ParamType::U8, ParamType::Bool],
@@ -366,8 +367,8 @@ mod tests {
366367
};
367368

368369
let data = [
369-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0,
370-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2,
370+
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1,
371+
0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
371372
];
372373

373374
let decoded = ABIDecoder::default().decode(&nested_struct, &data)?;
@@ -416,26 +417,23 @@ mod tests {
416417

417418
let u8_arr = ParamType::Array(Box::new(ParamType::U8), 2);
418419
let b256 = ParamType::B256;
419-
let s = ParamType::StringArray(3);
420-
let ss = ParamType::StringSlice;
421420

422-
let types = [nested_struct, u8_arr, b256, s, ss];
421+
let types = [nested_struct, u8_arr, b256];
423422

424423
let bytes = [
425-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, // foo.x == 10u16
426-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, // foo.y.a == true
427-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, // foo.b.0 == 1u8
428-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, // foo.b.1 == 2u8
429-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, // u8[2].0 == 1u8
430-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, // u8[2].0 == 2u8
431-
0xd5, 0x57, 0x9c, 0x46, 0xdf, 0xcc, 0x7f, 0x18, // b256
432-
0x20, 0x70, 0x13, 0xe6, 0x5b, 0x44, 0xe4, 0xcb, // b256
433-
0x4e, 0x2c, 0x22, 0x98, 0xf4, 0xac, 0x45, 0x7b, // b256
434-
0xa8, 0xf8, 0x27, 0x43, 0xf3, 0x1e, 0x93, 0xb, // b256
435-
0x66, 0x6f, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, // str[3]
436-
0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, // str data
437-
0x61, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x20, 0x73, // str data
438-
0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, // str data
424+
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, // u16
425+
0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, // bool
426+
0x1, 0x2, // array[u8]
427+
0x1, 0x2, // array[u8]
428+
0xd5, 0x57, 0x9c, 0x46, 0xdf, 0xcc, 0x7f, 0x18, // b256 start
429+
0x20, 0x70, 0x13, 0xe6, 0x5b, 0x44, 0xe4, 0xcb, //
430+
0x4e, 0x2c, 0x22, 0x98, 0xf4, 0xac, 0x45, 0x7b, //
431+
0xa8, 0xf8, 0x27, 0x43, 0xf3, 0x1e, 0x93,
432+
0xb, // b256 end
433+
// 0x66, 0x6f, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, // "foo"
434+
// 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, //
435+
// 0x61, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x20, 0x73, //
436+
// 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, //
439437
];
440438

441439
let decoded = ABIDecoder::default().decode_multiple(&types, &bytes)?;
@@ -457,14 +455,7 @@ mod tests {
457455
0xf3, 0x1e, 0x93, 0xb,
458456
]);
459457

460-
let ss = Token::StringSlice(StaticStringToken::new(
461-
"This is a full sentence".into(),
462-
None,
463-
));
464-
465-
let s = Token::StringArray(StaticStringToken::new("foo".into(), Some(3)));
466-
467-
let expected: Vec<Token> = vec![foo, u8_arr, b256, s, ss];
458+
let expected: Vec<Token> = vec![foo, u8_arr, b256];
468459

469460
assert_eq!(decoded, expected);
470461
Ok(())
@@ -555,13 +546,6 @@ mod tests {
555546
assert!(matches!(result, Err(Error::InvalidType(_))));
556547
}
557548

558-
#[test]
559-
pub fn multiply_overflow_vector() {
560-
let param_type = Vec::<[(); usize::MAX]>::param_type();
561-
let result = ABIDecoder::default().decode(&param_type, &[]);
562-
assert!(matches!(result, Err(Error::InvalidData(_))));
563-
}
564-
565549
#[test]
566550
pub fn multiply_overflow_arith() {
567551
let mut param_type: ParamType = U16;

0 commit comments

Comments
 (0)