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

Expose the schema.sdl file #1729

Merged
merged 2 commits into from
Mar 5, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

Description of the upcoming release here.

### Added

- [#1729](https://github.com/FuelLabs/fuel-core/pull/1729): Exposed the `schema.sdl` file from `fuel-core-client`. The user can create his own queries by using this file.

## [Version 0.22.1]

### Fixed
Expand Down
1 change: 1 addition & 0 deletions crates/client/src/client/pagination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub struct PaginationRequest<T> {
pub direction: PageDirection,
}

#[derive(Clone, Debug)]
pub struct PaginatedResult<T, C> {
pub cursor: Option<C>,
pub results: Vec<T>,
Expand Down
1 change: 1 addition & 0 deletions crates/client/src/client/types/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::client::{
PaginatedResult,
};

#[derive(Copy, Clone, Debug)]
pub struct Balance {
pub owner: Address,
pub amount: u64,
Expand Down
10 changes: 5 additions & 5 deletions crates/client/src/client/types/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::client::{
};
use tai64::Tai64;

#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct Block {
pub id: BlockId,
pub header: Header,
Expand All @@ -27,7 +27,7 @@ impl Block {
}
}

#[derive(Debug)]
#[derive(Copy, Clone, Debug)]
pub struct Header {
pub id: BlockId,
pub da_height: u64,
Expand All @@ -41,22 +41,22 @@ pub struct Header {
pub application_hash: Hash,
}

#[derive(Debug)]
#[derive(Copy, Clone, Debug)]
pub enum Consensus {
Genesis(Genesis),
PoAConsensus(PoAConsensus),
Unknown,
}

#[derive(Debug)]
#[derive(Copy, Clone, Debug)]
pub struct Genesis {
pub chain_config_hash: Hash,
pub coins_root: MerkleRoot,
pub contracts_root: MerkleRoot,
pub messages_root: MerkleRoot,
}

#[derive(Debug)]
#[derive(Copy, Clone, Debug)]
pub struct PoAConsensus {
pub signature: Signature,
}
Expand Down
1 change: 1 addition & 0 deletions crates/client/src/client/types/chain_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use fuel_core_types::{
fuel_tx::ConsensusParameters,
};

#[derive(Clone, Debug)]
pub struct ChainInfo {
pub da_height: u64,
pub name: String,
Expand Down
6 changes: 3 additions & 3 deletions crates/client/src/client/types/coins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::client::{
PaginatedResult,
};

#[derive(Debug)]
#[derive(Copy, Clone, Debug)]
pub enum CoinType {
Coin(Coin),
MessageCoin(MessageCoin),
Expand All @@ -26,7 +26,7 @@ impl CoinType {
}
}

#[derive(Debug, PartialEq)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct Coin {
pub amount: u64,
pub block_created: u32,
Expand All @@ -36,7 +36,7 @@ pub struct Coin {
pub owner: Address,
}

#[derive(Debug, PartialEq)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct MessageCoin {
pub amount: u64,
pub sender: Address,
Expand Down
3 changes: 2 additions & 1 deletion crates/client/src/client/types/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ use crate::client::{
PaginatedResult,
};

#[derive(Clone, Debug)]
pub struct Contract {
pub id: ContractId,
pub bytecode: Bytes,
pub salt: Salt,
}

#[derive(Debug)]
#[derive(Copy, Clone, Debug)]
pub struct ContractBalance {
pub contract: ContractId,
pub amount: u64,
Expand Down
4 changes: 2 additions & 2 deletions crates/client/src/client/types/gas_costs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ macro_rules! include_from_impls {
}

include_from_impls! {
#[derive(Clone, Debug)]
#[derive(Copy, Clone, Debug)]
pub struct GasCosts {
pub add: u64,
pub addi: u64,
Expand Down Expand Up @@ -148,7 +148,7 @@ include_from_impls! {
}
}

#[derive(Clone, Debug)]
#[derive(Copy, Clone, Debug)]
pub enum DependentCost {
LightOperation { base: u64, units_per_gas: u64 },
HeavyOperation { base: u64, gas_per_unit: u64 },
Expand Down
2 changes: 1 addition & 1 deletion crates/client/src/client/types/merkle_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::client::{
types::primitives::MerkleRoot,
};

#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct MerkleProof {
/// The proof set of the message proof.
pub proof_set: Vec<MerkleRoot>,
Expand Down
4 changes: 2 additions & 2 deletions crates/client/src/client/types/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::client::{
PaginatedResult,
};

#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct Message {
pub amount: u64,
pub sender: Address,
Expand All @@ -22,7 +22,7 @@ pub struct Message {
pub da_height: u64,
}

#[derive(Debug)]
#[derive(Clone, Debug)]
pub struct MessageProof {
/// Proof that message is contained within the provided block header.
pub message_proof: MerkleProof,
Expand Down
1 change: 1 addition & 0 deletions crates/client/src/client/types/node_info.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::client::schema;

#[derive(Clone, Debug)]
pub struct NodeInfo {
pub utxo_validation: bool,
pub vm_backtrace: bool,
Expand Down
3 changes: 3 additions & 0 deletions crates/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
#![deny(warnings)]
pub mod client;
pub mod schema;

/// The GraphQL schema used by the library.
pub const SCHEMA_SDL: &[u8] = include_bytes!("../assets/schema.sdl");