Skip to content

Commit

Permalink
PARTIAL: custom BlockHeight for tx info requests
Browse files Browse the repository at this point in the history
  • Loading branch information
conorsch committed Aug 18, 2023
1 parent 78bd2c3 commit 7a9c6a7
Show file tree
Hide file tree
Showing 11 changed files with 1,300 additions and 553 deletions.
62 changes: 52 additions & 10 deletions crates/proto/src/gen/penumbra.view.v1alpha1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,18 +578,28 @@ pub struct TransactionInfoByHashRequest {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionInfoRequest {
/// If present, return only transactions after this height.
#[prost(uint64, tag = "1")]
pub start_height: u64,
#[prost(message, optional, tag = "1")]
pub start_height: ::core::option::Option<transaction_info_request::BlockHeight>,
/// If present, return only transactions before this height.
#[prost(uint64, tag = "2")]
pub end_height: u64,
#[prost(message, optional, tag = "2")]
pub end_height: ::core::option::Option<transaction_info_request::BlockHeight>,
}
/// Nested message and enum types in `TransactionInfoRequest`.
pub mod transaction_info_request {
/// Submessage to represent optionality for specifying heights.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockHeight {
#[prost(uint64, tag = "1")]
pub height: u64,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionInfo {
/// The height the transaction was included in a block, if known.
#[prost(uint64, tag = "1")]
pub height: u64,
#[prost(message, optional, tag = "1")]
pub height: ::core::option::Option<transaction_info::BlockHeight>,
/// The hash of the transaction.
#[prost(message, optional, tag = "2")]
pub id: ::core::option::Option<super::super::core::transaction::v1alpha1::Id>,
Expand All @@ -609,6 +619,16 @@ pub struct TransactionInfo {
super::super::core::transaction::v1alpha1::TransactionView,
>,
}
/// Nested message and enum types in `TransactionInfo`.
pub mod transaction_info {
/// Submessage to represent optionality for block height.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockHeight {
#[prost(uint64, tag = "1")]
pub height: u64,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionInfoResponse {
Expand Down Expand Up @@ -663,15 +683,26 @@ pub struct SpendableNoteRecord {
#[prost(uint64, tag = "5")]
pub height_created: u64,
/// Records whether the note was spent (and if so, at what height).
#[prost(uint64, tag = "6")]
pub height_spent: u64,
/// Present if the note was spent, otherwise absent.
#[prost(message, optional, tag = "6")]
pub height_spent: ::core::option::Option<spendable_note_record::BlockHeight>,
/// The note position.
#[prost(uint64, tag = "7")]
pub position: u64,
/// The source of the note (a tx hash or otherwise)
#[prost(message, optional, tag = "8")]
pub source: ::core::option::Option<super::super::core::chain::v1alpha1::NoteSource>,
}
/// Nested message and enum types in `SpendableNoteRecord`.
pub mod spendable_note_record {
/// A submessage to represent optionality for height at which a note was spent.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockHeight {
#[prost(uint64, tag = "1")]
pub height: u64,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapRecord {
Expand All @@ -691,11 +722,22 @@ pub struct SwapRecord {
pub output_data: ::core::option::Option<
super::super::core::dex::v1alpha1::BatchSwapOutputData,
>,
#[prost(uint64, tag = "6")]
pub height_claimed: u64,
/// If present, height at which Swap was claimed.
#[prost(message, optional, tag = "6")]
pub height_claimed: ::core::option::Option<swap_record::BlockHeight>,
#[prost(message, optional, tag = "7")]
pub source: ::core::option::Option<super::super::core::chain::v1alpha1::NoteSource>,
}
/// Nested message and enum types in `SwapRecord`.
pub mod swap_record {
/// Submessage to represent optionality for block height.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockHeight {
#[prost(uint64, tag = "1")]
pub height: u64,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnedPositionIdsRequest {
Expand Down
Loading

0 comments on commit 7a9c6a7

Please sign in to comment.