linera_faucet/
lib.rs

1// Copyright (c) Zefchain Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4/*!
5Common definitions for the Linera faucet.
6*/
7
8use linera_base::{
9    crypto::CryptoHash,
10    identifiers::{ChainId, MessageId},
11};
12
13/// The result of a successful `claim` mutation.
14#[cfg_attr(feature = "async-graphql", derive(async_graphql::SimpleObject))]
15#[serde_with::serde_as]
16#[derive(serde::Deserialize)]
17#[serde(rename_all = "camelCase")]
18pub struct ClaimOutcome {
19    /// The ID of the message that created the new chain.
20    #[serde_as(as = "serde_with::DisplayFromStr")]
21    pub message_id: MessageId,
22    /// The ID of the new chain.
23    #[serde_as(as = "serde_with::DisplayFromStr")]
24    pub chain_id: ChainId,
25    /// The hash of the parent chain's certificate containing the `OpenChain` operation.
26    pub certificate_hash: CryptoHash,
27}