Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: gql schema file missing #1544

Merged
merged 8 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,15 @@ jobs:
if: ${{ matrix.command == 'test_wasm' }}
uses: actions/setup-node@v3
with:
node-version: 18

- name: Test WASM
if: ${{ matrix.command == 'test_wasm' }}
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
cd wasm-tests
wasm-pack test --node
node-version: 22.8.0

# Until we fix the "missing env error"
# - name: Test WASM
# if: ${{ matrix.command == 'test_wasm' }}
# run: |
# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# cd wasm-tests
# wasm-pack test --node

- name: Check that fuel_core version.rs file is up to date
if: ${{ matrix.command == 'check_fuel_core_version' }}
Expand Down
2 changes: 2 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[files]
extend-exclude = ["packages/fuels-accounts/src/schema/schema.sdl"]
6 changes: 4 additions & 2 deletions e2e/tests/providers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use fuels::{
prelude::*,
tx::Receipt,
types::{
block::Block,
coin_type::CoinType,
message::Message,
transaction_builders::{BuildableTransaction, ScriptTransactionBuilder},
Expand Down Expand Up @@ -218,6 +217,9 @@ async fn can_increase_block_height() -> Result<()> {
Ok(())
}

// debug builds are slower (20x for `fuel-core-lib`, 4x for a release-fuel-core-binary), makes for
// flaky tests
#[cfg(not(feature = "fuel-core-lib"))]
#[tokio::test]
async fn can_set_custom_block_time() -> Result<()> {
// ANCHOR: use_produce_blocks_custom_time
Expand Down Expand Up @@ -255,7 +257,7 @@ async fn can_set_custom_block_time() -> Result<()> {
results: 10,
direction: PageDirection::Forward,
};
let blocks: Vec<Block> = provider.get_blocks(req).await?.results;
let blocks: Vec<fuels::types::block::Block> = provider.get_blocks(req).await?.results;

assert_eq!(blocks[1].header.time.unwrap().timestamp(), 20);
assert_eq!(blocks[2].header.time.unwrap().timestamp(), 40);
Expand Down
4 changes: 0 additions & 4 deletions packages/fuels-accounts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ fuel-tx = { workspace = true, features = ["test-helpers", "random"] }
tempfile = { workspace = true }
tokio = { workspace = true, features = ["test-util"] }

[build-dependencies]
cynic = { workspace = true, features = ["default"], optional = true }
fuel-core-client = { workspace = true, optional = true }

[features]
default = ["std"]
coin-cache = ["tokio?/time"]
Expand Down
15 changes: 0 additions & 15 deletions packages/fuels-accounts/build.rs

This file was deleted.

12 changes: 12 additions & 0 deletions packages/fuels-accounts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,15 @@ pub use account::*;
mod coin_cache;

pub mod predicate;

#[cfg(test)]
mod test {
#[test]
fn sdl_is_the_same_as_from_fuel() {
let file_sdl = include_str!("./schema/schema.sdl");

let core_sdl = String::from_utf8(fuel_core_client::SCHEMA_SDL.to_vec()).unwrap();

assert_eq!(file_sdl, &core_sdl);
}
}
4 changes: 2 additions & 2 deletions packages/fuels-accounts/src/provider/retryable_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ mod custom_queries {
#[cynic(
graphql_type = "Query",
variables = "IsUserAccountVariables",
schema_path = "./target/fuel-core-client-schema.sdl"
schema_path = "./src/schema/schema.sdl"
)]
pub struct IsUserAccountQuery {
#[arguments(id: $blob_id)]
Expand All @@ -379,7 +379,7 @@ mod custom_queries {

#[derive(cynic::QueryFragment, Clone, Debug)]
#[cynic(
schema_path = "./target/fuel-core-client-schema.sdl",
schema_path = "./src/schema/schema.sdl",
graphql_type = "Query",
variables = "ContractByIdArgs"
)]
Expand Down
Loading
Loading