Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions node/native/src/graphql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,64 +199,6 @@ enum SyncStatus {
CATCHUP,
}

#[derive(Clone, Debug)]
struct ProtocolState {
consensus_state: ConsensusState,
blockchain_state: BlockchainState,
}

#[juniper::graphql_object(context = Context)]
impl ProtocolState {
fn consensus_state(&self) -> &ConsensusState {
&self.consensus_state
}

fn blockchain_state(&self) -> &BlockchainState {
&self.blockchain_state
}
}

#[derive(Clone, Debug)]
struct ConsensusState {
block_height: i32,
}

#[juniper::graphql_object(context = Context)]
impl ConsensusState {
fn block_height(&self) -> i32 {
self.block_height
}
}

#[derive(Clone, Debug)]
struct BlockchainState {
snarked_ledger_hash: String,
}

#[juniper::graphql_object(context = Context)]
impl BlockchainState {
fn snarked_ledger_hash(&self) -> &str {
&self.snarked_ledger_hash
}
}

#[derive(Clone, Debug)]
struct BestChain {
state_hash: String,
protocol_state: ProtocolState,
}

#[juniper::graphql_object(context = Context)]
impl BestChain {
fn state_hash(&self) -> &str {
&self.state_hash
}

fn protocol_state(&self) -> &ProtocolState {
&self.protocol_state
}
}

#[derive(Clone, Copy, Debug)]
pub struct Query;

Expand Down
Loading