Skip to content

Commit

Permalink
chore: bump dasel and deps versions (#1160)
Browse files Browse the repository at this point in the history
Bump `dasel` and dependencies versions. Fixed a `clippy` nightly warning
that we should not have functions after a test mod.

### Checklist
- [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: Oleksii Filonenko <[email protected]>
  • Loading branch information
hal3e and Br1ght0ne authored Oct 12, 2023
1 parent b3a4aa8 commit 746dcf7
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 95 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ concurrency:

env:
CARGO_TERM_COLOR: always
DASEL_VERSION: https://github.com/TomWright/dasel/releases/download/v1.24.3/dasel_linux_amd64
DASEL_VERSION: https://github.com/TomWright/dasel/releases/download/v2.3.6/dasel_linux_amd64
RUSTFLAGS: "-D warnings"
FUEL_CORE_VERSION: 0.20.4
RUST_VERSION: 1.72.0
FUEL_CORE_VERSION: 0.20.6
RUST_VERSION: 1.72.1
FORC_VERSION: 0.46.0
FORC_PATCH_BRANCH: ""
FORC_PATCH_REVISION: ""
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
- run: |
curl -sSLf "$DASEL_VERSION" -L -o dasel && chmod +x dasel
mv ./dasel /usr/local/bin/dasel
MIN_VERSION=$(cat Cargo.toml | dasel -r toml 'workspace.package.rust-version')
MIN_VERSION=$(cat Cargo.toml | dasel -r toml 'workspace.package.rust-version' -w plain)
RUST_VERSION="${{ env.RUST_VERSION }}"
echo "Comparing minimum supported toolchain ($MIN_VERSION) with ci toolchain (RUST_VERSION)"
test "$MIN_VERSION" == "$RUST_VERSION"
Expand Down
60 changes: 29 additions & 31 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,56 +35,54 @@ homepage = "https://fuel.network/"
readme = "README.md"
license = "Apache-2.0"
repository = "https://github.com/FuelLabs/fuels-rs"
rust-version = "1.72.0"
rust-version = "1.72.1"
version = "0.49.0"

[workspace.dependencies]
Inflector = "0.11.4"
async-trait = { version = "0.1.73", default-features = false }
bech32 = "0.9.1"
bytes = { version = "1.4.0", default-features = false }
chrono = "0.4.27"
elliptic-curve = { version = "0.13.5", default-features = false }
bytes = { version = "1.5.0", default-features = false }
chrono = "0.4.31"
elliptic-curve = { version = "0.13.6", default-features = false }
eth-keystore = "0.5.0"
fuel-abi-types = "0.3.0"
futures = "0.3.28"
hex = { version = "0.4.3", default-features = false }
itertools = "0.11.0"
portpicker = "0.1.1"
proc-macro2 = "1.0.66"
quote = "1.0.32"
rand = { version = "0.8.5", default-features = false, features = [
"std_rng",
"getrandom",
] }
regex = "1.9.3"
serde = { version = "1.0.183", default-features = false }
serde_json = "1.0.104"
serde_with = { version = "3.2.0", default-features = false }
sha2 = { version = "0.10.7", default-features = false }
syn = "2.0.28"
quote = "1.0.33"
rand = { version = "0.8.5", default-features = false, features = ["std_rng", "getrandom"] }
regex = "1.10.0"
serde = { version = "1.0.188", default-features = false }
serde_json = "1.0.107"
serde_with = { version = "3.3.0", default-features = false }
sha2 = { version = "0.10.8", default-features = false }
syn = "2.0.38"
tai64 = { version = "4.0.0", default-features = false }
tempfile = { version = "3.7.1", default-features = false }
thiserror = { version = "1.0.47", default-features = false }
tokio = { version = "1.31.0", default-features = false }
trybuild = "1.0.82"
which = { version = "4.4.0", default-features = false }
tempfile = { version = "3.8.0", default-features = false }
thiserror = { version = "1.0.49", default-features = false }
tokio = { version = "1.33.0", default-features = false }
trybuild = "1.0.85"
uint = { version = "0.9.5", default-features = false }
which = { version = "4.4.2", default-features = false }
zeroize = "1.6.0"

# Dependencies from the `fuel-core` repository:
fuel-core = { version = "0.20.4", default-features = false }
fuel-core-chain-config = { version = "0.20.4", default-features = false }
fuel-core-client = { version = "0.20.4", default-features = false }
fuel-core-types = { version = "0.20.4", default-features = false }
fuel-core = { version = "0.20.6", default-features = false }
fuel-core-chain-config = { version = "0.20.6", default-features = false }
fuel-core-client = { version = "0.20.6", default-features = false }
fuel-core-types = { version = "0.20.6", default-features = false }

# Dependencies from the `fuel-vm` repository:
fuel-asm = "0.35.3"
fuel-crypto = "0.35.3"
fuel-merkle = "0.35.3"
fuel-storage = "0.35.3"
fuel-tx = "0.35.3"
fuel-types = { version = "0.35.3", default-features = false }
fuel-vm = "0.35.3"
fuel-asm = "0.35.4"
fuel-crypto = "0.35.4"
fuel-merkle = "0.35.4"
fuel-storage = "0.35.4"
fuel-tx = "0.35.4"
fuel-types = { version = "0.35.4", default-features = false }
fuel-vm = "0.35.4"

# Workspace projects
fuels = { version = "0.49.0", path = "./packages/fuels" }
Expand Down
104 changes: 52 additions & 52 deletions packages/fuels-code-gen/src/program_bindings/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,58 @@ pub(crate) fn tokenize_generics(generics: &[Ident]) -> (TokenStream, TokenStream
)
}

pub(crate) fn sdk_provided_custom_types_lookup() -> HashMap<TypePath, TypePath> {
[
("std::address::Address", "::fuels::types::Address"),
("std::contract_id::AssetId", "::fuels::types::AssetId"),
("std::b512::B512", "::fuels::types::B512"),
("std::bytes::Bytes", "::fuels::types::Bytes"),
("std::contract_id::ContractId", "::fuels::types::ContractId"),
("std::identity::Identity", "::fuels::types::Identity"),
("std::option::Option", "::core::option::Option"),
("std::result::Result", "::core::result::Result"),
("std::string::String", "::std::string::String"),
("std::u256::U256", "::fuels::types::U256"),
("std::vec::Vec", "::std::vec::Vec"),
(
"std::vm::evm::evm_address::EvmAddress",
"::fuels::types::EvmAddress",
),
]
.into_iter()
.map(|(original_type_path, provided_type_path)| {
let msg = "known at compile time to be correctly formed";
(
TypePath::new(original_type_path).expect(msg),
TypePath::new(provided_type_path).expect(msg),
)
})
.flat_map(|(original_type_path, provided_type_path)| {
// TODO: To be removed once https://github.com/FuelLabs/fuels-rs/issues/881 is unblocked.
let backward_compat_mapping = original_type_path
.ident()
.expect("The original type path must have at least one part")
.into();
[
(backward_compat_mapping, provided_type_path.clone()),
(original_type_path, provided_type_path),
]
})
.collect()
}

pub(crate) fn get_equivalent_bech32_type(ttype: &ResolvedType) -> Option<TokenStream> {
let ResolvedType::StructOrEnum { path, .. } = ttype else {
return None;
};

match path.to_string().as_str() {
"::fuels::types::Address" => Some(quote! {::fuels::types::bech32::Bech32Address}),
"::fuels::types::ContractId" => Some(quote! {::fuels::types::bech32::Bech32ContractId}),
_ => None,
}
}

#[cfg(test)]
mod tests {
use fuel_abi_types::abi::full_program::FullTypeDeclaration;
Expand Down Expand Up @@ -192,55 +244,3 @@ mod tests {
}
}
}

pub(crate) fn sdk_provided_custom_types_lookup() -> HashMap<TypePath, TypePath> {
[
("std::address::Address", "::fuels::types::Address"),
("std::contract_id::AssetId", "::fuels::types::AssetId"),
("std::b512::B512", "::fuels::types::B512"),
("std::bytes::Bytes", "::fuels::types::Bytes"),
("std::contract_id::ContractId", "::fuels::types::ContractId"),
("std::identity::Identity", "::fuels::types::Identity"),
("std::option::Option", "::core::option::Option"),
("std::result::Result", "::core::result::Result"),
("std::string::String", "::std::string::String"),
("std::u256::U256", "::fuels::types::U256"),
("std::vec::Vec", "::std::vec::Vec"),
(
"std::vm::evm::evm_address::EvmAddress",
"::fuels::types::EvmAddress",
),
]
.into_iter()
.map(|(original_type_path, provided_type_path)| {
let msg = "known at compile time to be correctly formed";
(
TypePath::new(original_type_path).expect(msg),
TypePath::new(provided_type_path).expect(msg),
)
})
.flat_map(|(original_type_path, provided_type_path)| {
// TODO: To be removed once https://github.com/FuelLabs/fuels-rs/issues/881 is unblocked.
let backward_compat_mapping = original_type_path
.ident()
.expect("The original type path must have at least one part")
.into();
[
(backward_compat_mapping, provided_type_path.clone()),
(original_type_path, provided_type_path),
]
})
.collect()
}

pub(crate) fn get_equivalent_bech32_type(ttype: &ResolvedType) -> Option<TokenStream> {
let ResolvedType::StructOrEnum { path, .. } = ttype else {
return None;
};

match path.to_string().as_str() {
"::fuels::types::Address" => Some(quote! {::fuels::types::bech32::Bech32Address}),
"::fuels::types::ContractId" => Some(quote! {::fuels::types::bech32::Bech32ContractId}),
_ => None,
}
}
2 changes: 1 addition & 1 deletion packages/fuels-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true, default-features = true }
sha2 = { workspace = true }
thiserror = { workspace = true, default-features = false }
uint = { version = "0.9.5", default-features = false }
uint = { workspace = true, default-features = false }
zeroize = { workspace = true, features = ["derive"] }

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions packages/wasm-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ crate-type = ['cdylib']
# that our examples don't inherit `fuels` with disabled features).
# Cargo wouldn't respect any attempts here to disable them again.
fuels = { path = "../fuels", default-features = false }
getrandom = { version = "0.2", features = ["js"] }
wasm-bindgen-test = "0.3.34"
getrandom = { version = "0.2.10", features = ["js"] }
wasm-bindgen-test = "0.3.37"
6 changes: 3 additions & 3 deletions scripts/check-docs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ edition = { workspace = true }
publish = false

[dependencies]
anyhow = "1.0.62"
itertools = "0.10.3"
regex = "1.6.0"
anyhow = "1.0.75"
itertools = { workspace = true }
regex = { workspace = true }
4 changes: 2 additions & 2 deletions scripts/versions-replacer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ version.workspace = true

[dependencies]
argh = "0.1.12"
cargo_metadata = "0.17.0"
cargo_metadata = "0.18.0"
color-eyre = "0.6.2"
once_cell = "1.18.0"
regex = { workspace = true }
serde = { workspace = true, features = ["derive"] }
walkdir = "2.3.3"
walkdir = "2.4.0"

0 comments on commit 746dcf7

Please sign in to comment.