fuel_core_client/client/schema/
relayed_tx.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use crate::client::schema::{
    schema,
    RelayedTransactionId,
    U32,
};

#[derive(cynic::QueryFragment, Clone, Debug)]
#[cynic(
    schema_path = "./assets/schema.sdl",
    graphql_type = "Query",
    variables = "RelayedTransactionStatusArgs"
)]
pub struct RelayedTransactionStatusQuery {
    #[arguments(id: $id)]
    pub relayed_transaction_status: Option<RelayedTransactionStatus>,
}

#[derive(cynic::QueryVariables, Debug)]
pub struct RelayedTransactionStatusArgs {
    /// Transaction id that contains the output message.
    pub id: RelayedTransactionId,
}

#[allow(clippy::enum_variant_names)]
#[derive(cynic::InlineFragments, Clone, Debug)]
#[cynic(schema_path = "./assets/schema.sdl")]
pub enum RelayedTransactionStatus {
    /// Transaction was included in a block, but the execution was reverted
    Failed(RelayedTransactionFailed),
    #[cynic(fallback)]
    Unknown,
}

#[derive(cynic::QueryFragment, Clone, Debug, PartialEq, Eq)]
#[cynic(schema_path = "./assets/schema.sdl")]
pub struct RelayedTransactionFailed {
    pub block_height: U32,
    pub failure: String,
}