From 7926972b30b8c6aede9f239cafac60bb1e2a73a3 Mon Sep 17 00:00:00 2001 From: Johann Date: Sun, 3 Apr 2022 12:39:21 -0600 Subject: [PATCH 1/2] Capitalize GQL Dec --- fuel-client/assets/schema.sdl | 12 ++++++------ fuel-core/src/schema/block.rs | 8 ++++---- fuel-core/src/schema/coin.rs | 10 +++++----- fuel-core/src/schema/tx.rs | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/fuel-client/assets/schema.sdl b/fuel-client/assets/schema.sdl index 0fadbacf12d..377665bb62c 100644 --- a/fuel-client/assets/schema.sdl +++ b/fuel-client/assets/schema.sdl @@ -77,11 +77,11 @@ type CoinEdge { } input CoinFilterInput { """ - address of the owner + Address of the owner """ owner: Address! """ - asset ID of the coins + Asset ID of the coins """ assetId: AssetId } @@ -144,11 +144,11 @@ type Mutation { reset(id: ID!): Boolean! execute(id: ID!, op: String!): Boolean! """ - dry-run the transaction using a fork of current state, no changes are committed. + Execute a dry-run of the transaction using a fork of current state, no changes are committed. """ dryRun(tx: HexString!): [Receipt!]! """ - Submits transaction to the pool + Submits transaction to the txpool """ submit(tx: HexString!): Transaction! } @@ -243,11 +243,11 @@ enum ReturnType { scalar Salt input SpendQueryElementInput { """ - asset ID of the coins + Asset ID of the coins """ assetId: AssetId! """ - address of the owner + Address of the owner """ amount: U64! } diff --git a/fuel-core/src/schema/block.rs b/fuel-core/src/schema/block.rs index 61a50389683..064525ff654 100644 --- a/fuel-core/src/schema/block.rs +++ b/fuel-core/src/schema/block.rs @@ -64,8 +64,8 @@ impl BlockQuery { async fn block( &self, ctx: &Context<'_>, - #[graphql(desc = "id of the block")] id: Option, - #[graphql(desc = "height of the block")] height: Option, + #[graphql(desc = "Id of the block")] id: Option, + #[graphql(desc = "Height of the block")] height: Option, ) -> async_graphql::Result> { let db = ctx.data_unchecked::(); let id = match (id, height) { @@ -83,10 +83,10 @@ impl BlockQuery { )); } else { db.get_block_id(height.try_into()?)? - .ok_or("block height non-existent")? + .ok_or("Block height non-existent")? } } - (None, None) => return Err(async_graphql::Error::new("missing either id or height")), + (None, None) => return Err(async_graphql::Error::new("Missing either id or height")), }; let block = Storage::::get(db, &id)? diff --git a/fuel-core/src/schema/coin.rs b/fuel-core/src/schema/coin.rs index 6d810c2a08c..d7d93aec199 100644 --- a/fuel-core/src/schema/coin.rs +++ b/fuel-core/src/schema/coin.rs @@ -47,17 +47,17 @@ impl Coin { #[derive(InputObject)] struct CoinFilterInput { - /// address of the owner + /// Address of the owner owner: Address, - /// asset ID of the coins + /// Asset ID of the coins asset_id: Option, } #[derive(InputObject)] struct SpendQueryElementInput { - /// asset ID of the coins + /// Asset ID of the coins asset_id: AssetId, - /// address of the owner + /// Address of the owner amount: U64, } @@ -69,7 +69,7 @@ impl CoinQuery { async fn coin( &self, ctx: &Context<'_>, - #[graphql(desc = "utxo_id of the coin")] utxo_id: UtxoId, + #[graphql(desc = "The utxo_id of the coin")] utxo_id: UtxoId, ) -> async_graphql::Result> { let utxo_id = utxo_id.0; let db = ctx.data_unchecked::().clone(); diff --git a/fuel-core/src/schema/tx.rs b/fuel-core/src/schema/tx.rs index 72a9f9a2dad..a624b4a0915 100644 --- a/fuel-core/src/schema/tx.rs +++ b/fuel-core/src/schema/tx.rs @@ -37,7 +37,7 @@ impl TxQuery { async fn transaction( &self, ctx: &Context<'_>, - #[graphql(desc = "id of the transaction")] id: TransactionId, + #[graphql(desc = "The id of the transaction")] id: TransactionId, ) -> async_graphql::Result> { let db = ctx.data_unchecked::(); let key = id.0; @@ -244,7 +244,7 @@ pub struct TxMutation; #[Object] impl TxMutation { - /// dry-run the transaction using a fork of current state, no changes are committed. + /// Execute a dry-run of the transaction using a fork of current state, no changes are committed. async fn dry_run( &self, ctx: &Context<'_>, @@ -259,7 +259,7 @@ impl TxMutation { Ok(receipts.into_iter().map(Into::into).collect()) } - /// Submits transaction to the pool + /// Submits transaction to the txpool async fn submit(&self, ctx: &Context<'_>, tx: HexString) -> async_graphql::Result { let tx_pool = ctx.data::>().unwrap(); let tx = FuelTx::from_bytes(&tx.0)?; From e5f8221e3c74660bb59afc2e41fa437d3c50f245 Mon Sep 17 00:00:00 2001 From: Johann Date: Sun, 3 Apr 2022 19:20:00 -0600 Subject: [PATCH 2/2] ID fixes --- fuel-core/src/schema/block.rs | 2 +- fuel-core/src/schema/coin.rs | 2 +- fuel-core/src/schema/tx.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fuel-core/src/schema/block.rs b/fuel-core/src/schema/block.rs index 064525ff654..ec1b80d54cd 100644 --- a/fuel-core/src/schema/block.rs +++ b/fuel-core/src/schema/block.rs @@ -64,7 +64,7 @@ impl BlockQuery { async fn block( &self, ctx: &Context<'_>, - #[graphql(desc = "Id of the block")] id: Option, + #[graphql(desc = "ID of the block")] id: Option, #[graphql(desc = "Height of the block")] height: Option, ) -> async_graphql::Result> { let db = ctx.data_unchecked::(); diff --git a/fuel-core/src/schema/coin.rs b/fuel-core/src/schema/coin.rs index d7d93aec199..fa4b91f1b35 100644 --- a/fuel-core/src/schema/coin.rs +++ b/fuel-core/src/schema/coin.rs @@ -69,7 +69,7 @@ impl CoinQuery { async fn coin( &self, ctx: &Context<'_>, - #[graphql(desc = "The utxo_id of the coin")] utxo_id: UtxoId, + #[graphql(desc = "The ID of the coin")] utxo_id: UtxoId, ) -> async_graphql::Result> { let utxo_id = utxo_id.0; let db = ctx.data_unchecked::().clone(); diff --git a/fuel-core/src/schema/tx.rs b/fuel-core/src/schema/tx.rs index a624b4a0915..c78fa657172 100644 --- a/fuel-core/src/schema/tx.rs +++ b/fuel-core/src/schema/tx.rs @@ -37,7 +37,7 @@ impl TxQuery { async fn transaction( &self, ctx: &Context<'_>, - #[graphql(desc = "The id of the transaction")] id: TransactionId, + #[graphql(desc = "The ID of the transaction")] id: TransactionId, ) -> async_graphql::Result> { let db = ctx.data_unchecked::(); let key = id.0;