Skip to content

Commit

Permalink
Apply comment regarding complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
xgreenx committed Oct 5, 2024
1 parent c62f291 commit 5ea7289
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
4 changes: 1 addition & 3 deletions crates/fuel-core/src/graphql_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ pub struct Costs {
pub submit: usize,
pub submit_and_await: usize,
pub status_change: usize,
pub raw_payload: usize,
pub storage_read: usize,
pub tx_get: usize,
pub tx_status_read: usize,
Expand All @@ -65,8 +64,7 @@ pub const QUERY_COSTS: Costs = Costs {
submit: 40001,
submit_and_await: 40001,
status_change: 40001,
raw_payload: 10,
storage_read: 10,
storage_read: 40,
tx_get: 50,
tx_status_read: 50,
tx_raw_payload: 150,
Expand Down
1 change: 1 addition & 0 deletions crates/fuel-core/src/schema/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pub struct BlobQuery;

#[Object]
impl BlobQuery {
#[graphql(complexity = "QUERY_COSTS.storage_read + child_complexity")]
async fn blob(
&self,
ctx: &Context<'_>,
Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/schema/tx/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ impl Transaction {
}
}

#[graphql(complexity = "QUERY_COSTS.raw_payload")]
#[graphql(complexity = "QUERY_COSTS.tx_raw_payload")]
/// Return the transaction bytes using canonical encoding
async fn raw_payload(&self) -> HexString {
HexString(self.0.clone().to_bytes())
Expand Down
4 changes: 1 addition & 3 deletions tests/tests/dos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ const FULL_BLOCK_QUERY: &str = r#"
}
... on SuccessStatus {
transactionId
block {
height
}
blockHeight
time
programState {
returnType
Expand Down

0 comments on commit 5ea7289

Please sign in to comment.