-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add
.blob
query in fuel-core-client and use it in the test
- Loading branch information
Showing
6 changed files
with
79 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use crate::client::schema::{ | ||
schema, | ||
BlobId, | ||
HexString, | ||
}; | ||
|
||
#[derive(cynic::QueryVariables, Debug)] | ||
pub struct BlobByIdArgs { | ||
pub id: BlobId, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Clone, Debug)] | ||
#[cynic( | ||
schema_path = "./assets/schema.sdl", | ||
graphql_type = "Query", | ||
variables = "BlobByIdArgs" | ||
)] | ||
pub struct BlobByIdQuery { | ||
#[arguments(id: $id)] | ||
pub blob: Option<Blob>, | ||
} | ||
|
||
#[derive(cynic::QueryFragment, Clone, Debug)] | ||
#[cynic(schema_path = "./assets/schema.sdl")] | ||
pub struct Blob { | ||
pub id: BlobId, | ||
pub bytecode: HexString, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use crate::client::{ | ||
schema, | ||
types::primitives::{ | ||
BlobId, | ||
Bytes, | ||
}, | ||
}; | ||
|
||
#[derive(Debug, Clone, PartialEq)] | ||
pub struct Blob { | ||
pub id: BlobId, | ||
pub bytecode: Bytes, | ||
} | ||
|
||
// GraphQL Translation | ||
|
||
impl From<schema::blob::Blob> for Blob { | ||
fn from(value: schema::blob::Blob) -> Self { | ||
Self { | ||
id: value.id.into(), | ||
bytecode: value.bytecode.into(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters