fix(build): add elasticsearch feature to block serialize (#6709)
* add elasticsearch feature to block serialize * fix for elastic feature * add zebra-chain elasticsearch dep to zebrad
This commit is contained in:
parent
fe859bd6a1
commit
17bd7884ea
|
@ -29,6 +29,9 @@ getblocktemplate-rpcs = [
|
||||||
"zcash_address",
|
"zcash_address",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Experimental elasticsearch support
|
||||||
|
elasticsearch = []
|
||||||
|
|
||||||
# Test-only features
|
# Test-only features
|
||||||
|
|
||||||
proptest-impl = [
|
proptest-impl = [
|
||||||
|
|
|
@ -43,7 +43,10 @@ pub use arbitrary::LedgerState;
|
||||||
|
|
||||||
/// A Zcash block, containing a header and a list of transactions.
|
/// A Zcash block, containing a header and a list of transactions.
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||||
#[cfg_attr(any(test, feature = "proptest-impl"), derive(Serialize))]
|
#[cfg_attr(
|
||||||
|
any(test, feature = "proptest-impl", feature = "elasticsearch"),
|
||||||
|
derive(Serialize)
|
||||||
|
)]
|
||||||
pub struct Block {
|
pub struct Block {
|
||||||
/// The block header, containing block metadata.
|
/// The block header, containing block metadata.
|
||||||
pub header: Arc<Header>,
|
pub header: Arc<Header>,
|
||||||
|
|
|
@ -63,7 +63,10 @@ use crate::{
|
||||||
/// internally by different enum variants. Because we checkpoint on Canopy
|
/// internally by different enum variants. Because we checkpoint on Canopy
|
||||||
/// activation, we do not validate any pre-Sapling transaction types.
|
/// activation, we do not validate any pre-Sapling transaction types.
|
||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
#[cfg_attr(any(test, feature = "proptest-impl"), derive(Serialize))]
|
#[cfg_attr(
|
||||||
|
any(test, feature = "proptest-impl", feature = "elasticsearch"),
|
||||||
|
derive(Serialize)
|
||||||
|
)]
|
||||||
pub enum Transaction {
|
pub enum Transaction {
|
||||||
/// A fully transparent transaction (`version = 1`).
|
/// A fully transparent transaction (`version = 1`).
|
||||||
V1 {
|
V1 {
|
||||||
|
|
|
@ -66,7 +66,10 @@ pub const EXTRA_ZEBRA_COINBASE_DATA: &str = "z\u{1F993}";
|
||||||
//
|
//
|
||||||
// TODO: rename to ExtraCoinbaseData, because height is also part of the coinbase data?
|
// TODO: rename to ExtraCoinbaseData, because height is also part of the coinbase data?
|
||||||
#[derive(Clone, Eq, PartialEq)]
|
#[derive(Clone, Eq, PartialEq)]
|
||||||
#[cfg_attr(any(test, feature = "proptest-impl"), derive(Serialize))]
|
#[cfg_attr(
|
||||||
|
any(test, feature = "proptest-impl", feature = "elasticsearch"),
|
||||||
|
derive(Serialize)
|
||||||
|
)]
|
||||||
pub struct CoinbaseData(
|
pub struct CoinbaseData(
|
||||||
/// Invariant: this vec, together with the coinbase height, must be less than
|
/// Invariant: this vec, together with the coinbase height, must be less than
|
||||||
/// 100 bytes. We enforce this by only constructing CoinbaseData fields by
|
/// 100 bytes. We enforce this by only constructing CoinbaseData fields by
|
||||||
|
@ -110,7 +113,11 @@ impl std::fmt::Debug for CoinbaseData {
|
||||||
///
|
///
|
||||||
/// A particular transaction output reference.
|
/// A particular transaction output reference.
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
|
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
|
||||||
#[cfg_attr(any(test, feature = "proptest-impl"), derive(Arbitrary, Serialize))]
|
#[cfg_attr(any(test, feature = "proptest-impl"), derive(Arbitrary))]
|
||||||
|
#[cfg_attr(
|
||||||
|
any(test, feature = "proptest-impl", feature = "elasticsearch"),
|
||||||
|
derive(Serialize)
|
||||||
|
)]
|
||||||
pub struct OutPoint {
|
pub struct OutPoint {
|
||||||
/// References the transaction that contains the UTXO being spent.
|
/// References the transaction that contains the UTXO being spent.
|
||||||
///
|
///
|
||||||
|
@ -145,7 +152,10 @@ impl OutPoint {
|
||||||
|
|
||||||
/// A transparent input to a transaction.
|
/// A transparent input to a transaction.
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||||
#[cfg_attr(any(test, feature = "proptest-impl"), derive(Serialize))]
|
#[cfg_attr(
|
||||||
|
any(test, feature = "proptest-impl", feature = "elasticsearch"),
|
||||||
|
derive(Serialize)
|
||||||
|
)]
|
||||||
pub enum Input {
|
pub enum Input {
|
||||||
/// A reference to an output of a previous transaction.
|
/// A reference to an output of a previous transaction.
|
||||||
PrevOut {
|
PrevOut {
|
||||||
|
@ -383,9 +393,10 @@ impl Input {
|
||||||
/// that spends my UTXO and sends 1 ZEC to you and 1 ZEC back to me
|
/// that spends my UTXO and sends 1 ZEC to you and 1 ZEC back to me
|
||||||
/// (just like receiving change).
|
/// (just like receiving change).
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
|
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
|
||||||
|
#[cfg_attr(any(test, feature = "proptest-impl"), derive(Arbitrary, Deserialize))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
any(test, feature = "proptest-impl"),
|
any(test, feature = "proptest-impl", feature = "elasticsearch"),
|
||||||
derive(Arbitrary, Serialize, Deserialize)
|
derive(Serialize)
|
||||||
)]
|
)]
|
||||||
pub struct Output {
|
pub struct Output {
|
||||||
/// Transaction value.
|
/// Transaction value.
|
||||||
|
|
|
@ -39,6 +39,7 @@ proptest-impl = [
|
||||||
elasticsearch = [
|
elasticsearch = [
|
||||||
"dep:elasticsearch",
|
"dep:elasticsearch",
|
||||||
"dep:serde_json",
|
"dep:serde_json",
|
||||||
|
"zebra-chain/elasticsearch",
|
||||||
]
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
@ -44,6 +44,7 @@ getblocktemplate-rpcs = [
|
||||||
|
|
||||||
elasticsearch = [
|
elasticsearch = [
|
||||||
"zebra-state/elasticsearch",
|
"zebra-state/elasticsearch",
|
||||||
|
"zebra-chain/elasticsearch",
|
||||||
]
|
]
|
||||||
|
|
||||||
sentry = ["dep:sentry"]
|
sentry = ["dep:sentry"]
|
||||||
|
|
Loading…
Reference in New Issue