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
// Copyright (c) Zefchain Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

/*!
Common definitions for the Linera faucet.
*/

use linera_base::{
    crypto::CryptoHash,
    identifiers::{ChainId, MessageId},
};

/// The result of a successful `claim` mutation.
#[cfg_attr(feature = "async-graphql", derive(async_graphql::SimpleObject))]
#[serde_with::serde_as]
#[derive(serde::Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ClaimOutcome {
    /// The ID of the message that created the new chain.
    #[serde_as(as = "serde_with::DisplayFromStr")]
    pub message_id: MessageId,
    /// The ID of the new chain.
    #[serde_as(as = "serde_with::DisplayFromStr")]
    pub chain_id: ChainId,
    /// The hash of the parent chain's certificate containing the `OpenChain` operation.
    pub certificate_hash: CryptoHash,
}