feat: add AccountBalanceChange proto message (#137)

This commit is contained in:
Louise Poole
2025-01-23 11:00:12 +02:00
committed by GitHub
parent 53f764972d
commit 28dd2fc858
3 changed files with 102 additions and 79 deletions

View File

@@ -55,7 +55,6 @@ enum FinancialType{
PSM = 3; PSM = 3;
} }
enum ImplementationType { enum ImplementationType {
VM = 0; VM = 0;
CUSTOM = 1; CUSTOM = 1;
@@ -128,6 +127,14 @@ message ContractSlot {
bytes value = 3; bytes value = 3;
} }
// A struct for following the token balance changes for a contract.
message AccountBalanceChange {
// The address of the ERC20 token whose balance changed.
bytes token = 1;
// The new balance of the token. Note: it must be a big endian encoded int.
bytes balance = 2;
}
// Changes made to a single contract's state. // Changes made to a single contract's state.
message ContractChange { message ContractChange {
// The contract's address // The contract's address
@@ -140,6 +147,8 @@ message ContractChange {
repeated ContractSlot slots = 4; repeated ContractSlot slots = 4;
// Whether this is an update, a creation or a deletion. // Whether this is an update, a creation or a deletion.
ChangeType change = 5; ChangeType change = 5;
// The new ERC20 balances of the contract.
repeated AccountBalanceChange token_balances = 6;
} }
// Aggregate entities // Aggregate entities

View File

@@ -467,6 +467,7 @@ pub struct InterimContractChange {
code: Vec<u8>, code: Vec<u8>,
slots: HashMap<Vec<u8>, SlotValue>, slots: HashMap<Vec<u8>, SlotValue>,
change: ChangeType, change: ChangeType,
token_balances: HashMap<Vec<u8>, Vec<u8>>,
} }
impl InterimContractChange { impl InterimContractChange {
@@ -477,6 +478,7 @@ impl InterimContractChange {
code: vec![], code: vec![],
slots: Default::default(), slots: Default::default(),
change: if creation { ChangeType::Creation } else { ChangeType::Update }, change: if creation { ChangeType::Creation } else { ChangeType::Update },
token_balances: Default::default(),
} }
} }
@@ -530,6 +532,11 @@ impl From<InterimContractChange> for Option<ContractChange> {
.map(|(slot, value)| ContractSlot { slot, value: value.new_value }) .map(|(slot, value)| ContractSlot { slot, value: value.new_value })
.collect(), .collect(),
change: value.change.into(), change: value.change.into(),
token_balances: value
.token_balances
.into_iter()
.map(|(k, v)| AccountBalanceChange { token: k, balance: v })
.collect(),
}; };
if contract_change.is_empty() { if contract_change.is_empty() {
None None

View File

@@ -6,16 +6,16 @@
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct Block { pub struct Block {
/// The blocks hash. /// The blocks hash.
#[prost(bytes = "vec", tag = "1")] #[prost(bytes="vec", tag="1")]
pub hash: ::prost::alloc::vec::Vec<u8>, pub hash: ::prost::alloc::vec::Vec<u8>,
/// The parent blocks hash. /// The parent blocks hash.
#[prost(bytes = "vec", tag = "2")] #[prost(bytes="vec", tag="2")]
pub parent_hash: ::prost::alloc::vec::Vec<u8>, pub parent_hash: ::prost::alloc::vec::Vec<u8>,
/// The block number. /// The block number.
#[prost(uint64, tag = "3")] #[prost(uint64, tag="3")]
pub number: u64, pub number: u64,
/// The block timestamp. /// The block timestamp.
#[prost(uint64, tag = "4")] #[prost(uint64, tag="4")]
pub ts: u64, pub ts: u64,
} }
/// A struct describing a transaction. /// A struct describing a transaction.
@@ -24,102 +24,96 @@ pub struct Block {
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct Transaction { pub struct Transaction {
/// The transaction hash. /// The transaction hash.
#[prost(bytes = "vec", tag = "1")] #[prost(bytes="vec", tag="1")]
pub hash: ::prost::alloc::vec::Vec<u8>, pub hash: ::prost::alloc::vec::Vec<u8>,
/// The sender of the transaction. /// The sender of the transaction.
#[prost(bytes = "vec", tag = "2")] #[prost(bytes="vec", tag="2")]
pub from: ::prost::alloc::vec::Vec<u8>, pub from: ::prost::alloc::vec::Vec<u8>,
/// The receiver of the transaction. /// The receiver of the transaction.
#[prost(bytes = "vec", tag = "3")] #[prost(bytes="vec", tag="3")]
pub to: ::prost::alloc::vec::Vec<u8>, pub to: ::prost::alloc::vec::Vec<u8>,
/// The transactions index within the block. /// The transactions index within the block.
/// TODO: should this be uint32? to match the type from the native substream type? /// TODO: should this be uint32? to match the type from the native substream type?
#[prost(uint64, tag = "4")] #[prost(uint64, tag="4")]
pub index: u64, pub index: u64,
} }
/// A custom struct representing an arbitrary attribute of a protocol component. /// A custom struct representing an arbitrary attribute of a protocol component.
/// This is mainly used by the native integration to track the necessary information about the /// This is mainly used by the native integration to track the necessary information about the protocol.
/// protocol.
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct Attribute { pub struct Attribute {
/// The name of the attribute. /// The name of the attribute.
#[prost(string, tag = "1")] #[prost(string, tag="1")]
pub name: ::prost::alloc::string::String, pub name: ::prost::alloc::string::String,
/// The value of the attribute. /// The value of the attribute.
#[prost(bytes = "vec", tag = "2")] #[prost(bytes="vec", tag="2")]
pub value: ::prost::alloc::vec::Vec<u8>, pub value: ::prost::alloc::vec::Vec<u8>,
/// The type of change the attribute underwent. /// The type of change the attribute underwent.
#[prost(enumeration = "ChangeType", tag = "3")] #[prost(enumeration="ChangeType", tag="3")]
pub change: i32, pub change: i32,
} }
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProtocolType { pub struct ProtocolType {
#[prost(string, tag = "1")] #[prost(string, tag="1")]
pub name: ::prost::alloc::string::String, pub name: ::prost::alloc::string::String,
#[prost(enumeration = "FinancialType", tag = "2")] #[prost(enumeration="FinancialType", tag="2")]
pub financial_type: i32, pub financial_type: i32,
#[prost(message, repeated, tag = "3")] #[prost(message, repeated, tag="3")]
pub attribute_schema: ::prost::alloc::vec::Vec<Attribute>, pub attribute_schema: ::prost::alloc::vec::Vec<Attribute>,
#[prost(enumeration = "ImplementationType", tag = "4")] #[prost(enumeration="ImplementationType", tag="4")]
pub implementation_type: i32, pub implementation_type: i32,
} }
/// A struct describing a part of the protocol. /// A struct describing a part of the protocol.
/// /// Note: For example this can be a UniswapV2 pair, that tracks the two ERC20 tokens used by the pair,
/// Note: For example this can be a UniswapV2 pair, that tracks the two ERC20 tokens used by the /// the component would represent a single contract. In case of VM integration, such component would
/// pair, the component would represent a single contract. In case of VM integration, such component /// not need any attributes, because all the relevant info would be tracked via storage slots and balance changes.
/// would not need any attributes, because all the relevant info would be tracked via storage slots /// It can also be a wrapping contract, like WETH, that has a constant price, but it allows swapping tokens.
/// and balance changes. It can also be a wrapping contract, like WETH, that has a constant price, /// This is why the name ProtocolComponent is used instead of "Pool" or "Pair".
/// but it allows swapping tokens. This is why the name ProtocolComponent is used instead of "Pool"
/// or "Pair".
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProtocolComponent { pub struct ProtocolComponent {
/// A unique identifier for the component within the protocol. /// A unique identifier for the component within the protocol.
/// Can be e.g. a stringified address or a string describing the trading pair. /// Can be e.g. a stringified address or a string describing the trading pair.
#[prost(string, tag = "1")] #[prost(string, tag="1")]
pub id: ::prost::alloc::string::String, pub id: ::prost::alloc::string::String,
/// Addresses of the ERC20 tokens used by the component. /// Addresses of the ERC20 tokens used by the component.
#[prost(bytes = "vec", repeated, tag = "2")] #[prost(bytes="vec", repeated, tag="2")]
pub tokens: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>, pub tokens: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
/// Addresses of the contracts used by the component. /// Addresses of the contracts used by the component.
/// Usually it is a single contract, but some protocols use multiple contracts. /// Usually it is a single contract, but some protocols use multiple contracts.
#[prost(bytes = "vec", repeated, tag = "3")] #[prost(bytes="vec", repeated, tag="3")]
pub contracts: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>, pub contracts: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
/// Static attributes of the component. /// Static attributes of the component.
/// These attributes MUST be immutable. If it can ever change, it should be given as an EntityChanges for this component id. /// These attributes MUST be immutable. If it can ever change, it should be given as an EntityChanges for this component id.
/// The inner ChangeType of the attribute has to match the ChangeType of the ProtocolComponent. /// The inner ChangeType of the attribute has to match the ChangeType of the ProtocolComponent.
#[prost(message, repeated, tag = "4")] #[prost(message, repeated, tag="4")]
pub static_att: ::prost::alloc::vec::Vec<Attribute>, pub static_att: ::prost::alloc::vec::Vec<Attribute>,
/// Type of change the component underwent. /// Type of change the component underwent.
#[prost(enumeration = "ChangeType", tag = "5")] #[prost(enumeration="ChangeType", tag="5")]
pub change: i32, pub change: i32,
/// / Represents the functionality of the component. /// / Represents the functionality of the component.
#[prost(message, optional, tag = "6")] #[prost(message, optional, tag="6")]
pub protocol_type: ::core::option::Option<ProtocolType>, pub protocol_type: ::core::option::Option<ProtocolType>,
/// Transaction where this component was created /// Transaction where this component was created
#[prost(message, optional, tag = "7")] #[prost(message, optional, tag = "7")]
pub tx: ::core::option::Option<Transaction>, pub tx: ::core::option::Option<Transaction>,
} }
/// A struct for following the changes of Total Value Locked (TVL) of a protocol component. /// A struct for following the changes of Total Value Locked (TVL) of a protocol component.
/// /// Note that if a ProtocolComponent contains multiple contracts, the TVL is tracked for the component as a whole.
/// Note that if a ProtocolComponent contains multiple contracts, the TVL is tracked for the /// E.g. for UniswapV2 pair WETH/USDC, this tracks the USDC and WETH balance of the pair contract.
/// component as a whole. E.g. for UniswapV2 pair WETH/USDC, this tracks the USDC and WETH balance
/// of the pair contract.
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct BalanceChange { pub struct BalanceChange {
/// The address of the ERC20 token whose balance changed. /// The address of the ERC20 token whose balance changed.
#[prost(bytes = "vec", tag = "1")] #[prost(bytes="vec", tag="1")]
pub token: ::prost::alloc::vec::Vec<u8>, pub token: ::prost::alloc::vec::Vec<u8>,
/// The new balance of the token. Note: it must be a big endian encoded int. /// The new balance of the token. Note: it must be a big endian encoded int.
#[prost(bytes = "vec", tag = "2")] #[prost(bytes="vec", tag="2")]
pub balance: ::prost::alloc::vec::Vec<u8>, pub balance: ::prost::alloc::vec::Vec<u8>,
/// The id of the component whose TVL is tracked. Note: This MUST be utf8 encoded. /// The id of the component whose TVL is tracked. Note: This MUST be utf8 encoded.
/// If the protocol component includes multiple contracts, the balance change must be /// If the protocol component includes multiple contracts, the balance change must be aggregated to reflect how much tokens can be traded.
/// aggregated to reflect how much tokens can be traded. #[prost(bytes="vec", tag="3")]
#[prost(bytes = "vec", tag = "3")]
pub component_id: ::prost::alloc::vec::Vec<u8>, pub component_id: ::prost::alloc::vec::Vec<u8>,
} }
// Native entities // Native entities
@@ -129,10 +123,10 @@ pub struct BalanceChange {
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct EntityChanges { pub struct EntityChanges {
/// A unique identifier of the entity within the protocol. /// A unique identifier of the entity within the protocol.
#[prost(string, tag = "1")] #[prost(string, tag="1")]
pub component_id: ::prost::alloc::string::String, pub component_id: ::prost::alloc::string::String,
/// The set of attributes that are associated with the entity. /// The set of attributes that are associated with the entity.
#[prost(message, repeated, tag = "2")] #[prost(message, repeated, tag="2")]
pub attributes: ::prost::alloc::vec::Vec<Attribute>, pub attributes: ::prost::alloc::vec::Vec<Attribute>,
} }
// VM entities // VM entities
@@ -142,31 +136,45 @@ pub struct EntityChanges {
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContractSlot { pub struct ContractSlot {
/// A contract's storage slot. /// A contract's storage slot.
#[prost(bytes = "vec", tag = "2")] #[prost(bytes="vec", tag="2")]
pub slot: ::prost::alloc::vec::Vec<u8>, pub slot: ::prost::alloc::vec::Vec<u8>,
/// The new value for this storage slot. /// The new value for this storage slot.
#[prost(bytes = "vec", tag = "3")] #[prost(bytes="vec", tag="3")]
pub value: ::prost::alloc::vec::Vec<u8>, pub value: ::prost::alloc::vec::Vec<u8>,
} }
/// A struct for following the token balance changes for a contract.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountBalanceChange {
/// The address of the ERC20 token whose balance changed.
#[prost(bytes="vec", tag="1")]
pub token: ::prost::alloc::vec::Vec<u8>,
/// The new balance of the token. Note: it must be a big endian encoded int.
#[prost(bytes="vec", tag="2")]
pub balance: ::prost::alloc::vec::Vec<u8>,
}
/// Changes made to a single contract's state. /// Changes made to a single contract's state.
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContractChange { pub struct ContractChange {
/// The contract's address /// The contract's address
#[prost(bytes = "vec", tag = "1")] #[prost(bytes="vec", tag="1")]
pub address: ::prost::alloc::vec::Vec<u8>, pub address: ::prost::alloc::vec::Vec<u8>,
/// The new balance of the contract, empty bytes indicates no change. /// The new balance of the contract, empty bytes indicates no change.
#[prost(bytes = "vec", tag = "2")] #[prost(bytes="vec", tag="2")]
pub balance: ::prost::alloc::vec::Vec<u8>, pub balance: ::prost::alloc::vec::Vec<u8>,
/// The new code of the contract, empty bytes indicates no change. /// The new code of the contract, empty bytes indicates no change.
#[prost(bytes = "vec", tag = "3")] #[prost(bytes="vec", tag="3")]
pub code: ::prost::alloc::vec::Vec<u8>, pub code: ::prost::alloc::vec::Vec<u8>,
/// The changes to this contract's slots, empty sequence indicates no change. /// The changes to this contract's slots, empty sequence indicates no change.
#[prost(message, repeated, tag = "4")] #[prost(message, repeated, tag="4")]
pub slots: ::prost::alloc::vec::Vec<ContractSlot>, pub slots: ::prost::alloc::vec::Vec<ContractSlot>,
/// Whether this is an update, a creation or a deletion. /// Whether this is an update, a creation or a deletion.
#[prost(enumeration = "ChangeType", tag = "5")] #[prost(enumeration="ChangeType", tag="5")]
pub change: i32, pub change: i32,
/// The new ERC20 balances of the contract.
#[prost(message, repeated, tag="6")]
pub token_balances: ::prost::alloc::vec::Vec<AccountBalanceChange>,
} }
// Aggregate entities // Aggregate entities
@@ -175,22 +183,21 @@ pub struct ContractChange {
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionChanges { pub struct TransactionChanges {
/// The transaction instance that results in the changes. /// The transaction instance that results in the changes.
#[prost(message, optional, tag = "1")] #[prost(message, optional, tag="1")]
pub tx: ::core::option::Option<Transaction>, pub tx: ::core::option::Option<Transaction>,
/// Contains the changes induced by the above transaction, aggregated on a per-contract basis. /// Contains the changes induced by the above transaction, aggregated on a per-contract basis.
/// Contains the contract changes induced by the above transaction, usually for tracking VM /// Contains the contract changes induced by the above transaction, usually for tracking VM components.
/// components. #[prost(message, repeated, tag="2")]
#[prost(message, repeated, tag = "2")]
pub contract_changes: ::prost::alloc::vec::Vec<ContractChange>, pub contract_changes: ::prost::alloc::vec::Vec<ContractChange>,
/// Contains the entity changes induced by the above transaction. /// Contains the entity changes induced by the above transaction.
/// Usually for tracking native components or used for VM extensions (plugins). /// Usually for tracking native components or used for VM extensions (plugins).
#[prost(message, repeated, tag = "3")] #[prost(message, repeated, tag="3")]
pub entity_changes: ::prost::alloc::vec::Vec<EntityChanges>, pub entity_changes: ::prost::alloc::vec::Vec<EntityChanges>,
/// An array of newly added components. /// An array of newly added components.
#[prost(message, repeated, tag = "4")] #[prost(message, repeated, tag="4")]
pub component_changes: ::prost::alloc::vec::Vec<ProtocolComponent>, pub component_changes: ::prost::alloc::vec::Vec<ProtocolComponent>,
/// An array of balance changes to components. /// An array of balance changes to components.
#[prost(message, repeated, tag = "5")] #[prost(message, repeated, tag="5")]
pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>, pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
} }
/// A set of transaction changes within a single block. /// A set of transaction changes within a single block.
@@ -199,10 +206,10 @@ pub struct TransactionChanges {
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockChanges { pub struct BlockChanges {
/// The block for which these changes are collectively computed. /// The block for which these changes are collectively computed.
#[prost(message, optional, tag = "1")] #[prost(message, optional, tag="1")]
pub block: ::core::option::Option<Block>, pub block: ::core::option::Option<Block>,
/// The set of transaction changes observed in the specified block. /// The set of transaction changes observed in the specified block.
#[prost(message, repeated, tag = "2")] #[prost(message, repeated, tag="2")]
pub changes: ::prost::alloc::vec::Vec<TransactionChanges>, pub changes: ::prost::alloc::vec::Vec<TransactionChanges>,
} }
/// Enum to specify the type of a change. /// Enum to specify the type of a change.
@@ -302,15 +309,15 @@ impl ImplementationType {
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionEntityChanges { pub struct TransactionEntityChanges {
#[prost(message, optional, tag = "1")] #[prost(message, optional, tag="1")]
pub tx: ::core::option::Option<Transaction>, pub tx: ::core::option::Option<Transaction>,
#[prost(message, repeated, tag = "2")] #[prost(message, repeated, tag="2")]
pub entity_changes: ::prost::alloc::vec::Vec<EntityChanges>, pub entity_changes: ::prost::alloc::vec::Vec<EntityChanges>,
/// An array of newly added components. /// An array of newly added components.
#[prost(message, repeated, tag = "3")] #[prost(message, repeated, tag="3")]
pub component_changes: ::prost::alloc::vec::Vec<ProtocolComponent>, pub component_changes: ::prost::alloc::vec::Vec<ProtocolComponent>,
/// An array of balance changes to components. /// An array of balance changes to components.
#[prost(message, repeated, tag = "4")] #[prost(message, repeated, tag="4")]
pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>, pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
} }
/// A set of transaction changes within a single block. /// A set of transaction changes within a single block.
@@ -318,10 +325,10 @@ pub struct TransactionEntityChanges {
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockEntityChanges { pub struct BlockEntityChanges {
/// The block for which these changes are collectively computed. /// The block for which these changes are collectively computed.
#[prost(message, optional, tag = "1")] #[prost(message, optional, tag="1")]
pub block: ::core::option::Option<Block>, pub block: ::core::option::Option<Block>,
/// The set of transaction changes observed in the specified block. /// The set of transaction changes observed in the specified block.
#[prost(message, repeated, tag = "2")] #[prost(message, repeated, tag="2")]
pub changes: ::prost::alloc::vec::Vec<TransactionEntityChanges>, pub changes: ::prost::alloc::vec::Vec<TransactionEntityChanges>,
} }
/// A message containing relative balance changes. /// A message containing relative balance changes.
@@ -333,44 +340,44 @@ pub struct BlockEntityChanges {
pub struct BalanceDelta { pub struct BalanceDelta {
/// The ordinal of the balance change. Must be unique & deterministic over all balances /// The ordinal of the balance change. Must be unique & deterministic over all balances
/// changes within a block. /// changes within a block.
#[prost(uint64, tag = "1")] #[prost(uint64, tag="1")]
pub ord: u64, pub ord: u64,
/// The tx hash of the transaction that caused the balance change. /// The tx hash of the transaction that caused the balance change.
#[prost(message, optional, tag = "2")] #[prost(message, optional, tag="2")]
pub tx: ::core::option::Option<Transaction>, pub tx: ::core::option::Option<Transaction>,
/// The address of the ERC20 token whose balance changed. /// The address of the ERC20 token whose balance changed.
#[prost(bytes = "vec", tag = "3")] #[prost(bytes="vec", tag="3")]
pub token: ::prost::alloc::vec::Vec<u8>, pub token: ::prost::alloc::vec::Vec<u8>,
/// The delta balance of the token. /// The delta balance of the token.
#[prost(bytes = "vec", tag = "4")] #[prost(bytes="vec", tag="4")]
pub delta: ::prost::alloc::vec::Vec<u8>, pub delta: ::prost::alloc::vec::Vec<u8>,
/// The id of the component whose TVL is tracked. /// The id of the component whose TVL is tracked.
/// If the protocol component includes multiple contracts, the balance change must be /// If the protocol component includes multiple contracts, the balance change must be
/// aggregated to reflect how much tokens can be traded. /// aggregated to reflect how much tokens can be traded.
#[prost(bytes = "vec", tag = "5")] #[prost(bytes="vec", tag="5")]
pub component_id: ::prost::alloc::vec::Vec<u8>, pub component_id: ::prost::alloc::vec::Vec<u8>,
} }
/// A set of balances deltas, usually a group of changes within a single block. /// A set of balances deltas, usually a group of changes within a single block.
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockBalanceDeltas { pub struct BlockBalanceDeltas {
#[prost(message, repeated, tag = "1")] #[prost(message, repeated, tag="1")]
pub balance_deltas: ::prost::alloc::vec::Vec<BalanceDelta>, pub balance_deltas: ::prost::alloc::vec::Vec<BalanceDelta>,
} }
/// A message containing protocol components that were created by a single tx. /// A message containing protocol components that were created by a single tx.
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionProtocolComponents { pub struct TransactionProtocolComponents {
#[prost(message, optional, tag = "1")] #[prost(message, optional, tag="1")]
pub tx: ::core::option::Option<Transaction>, pub tx: ::core::option::Option<Transaction>,
#[prost(message, repeated, tag = "2")] #[prost(message, repeated, tag="2")]
pub components: ::prost::alloc::vec::Vec<ProtocolComponent>, pub components: ::prost::alloc::vec::Vec<ProtocolComponent>,
} }
/// All protocol components that were created within a block with their corresponding tx. /// All protocol components that were created within a block with their corresponding tx.
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockTransactionProtocolComponents { pub struct BlockTransactionProtocolComponents {
#[prost(message, repeated, tag = "1")] #[prost(message, repeated, tag="1")]
pub tx_components: ::prost::alloc::vec::Vec<TransactionProtocolComponents>, pub tx_components: ::prost::alloc::vec::Vec<TransactionProtocolComponents>,
} }
// WARNING: DEPRECATED. Please use common.proto's TransactionChanges and BlockChanges instead. // WARNING: DEPRECATED. Please use common.proto's TransactionChanges and BlockChanges instead.
@@ -381,16 +388,16 @@ pub struct BlockTransactionProtocolComponents {
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionContractChanges { pub struct TransactionContractChanges {
/// The transaction instance that results in the changes. /// The transaction instance that results in the changes.
#[prost(message, optional, tag = "1")] #[prost(message, optional, tag="1")]
pub tx: ::core::option::Option<Transaction>, pub tx: ::core::option::Option<Transaction>,
/// Contains the changes induced by the above transaction, aggregated on a per-contract basis. /// Contains the changes induced by the above transaction, aggregated on a per-contract basis.
#[prost(message, repeated, tag = "2")] #[prost(message, repeated, tag="2")]
pub contract_changes: ::prost::alloc::vec::Vec<ContractChange>, pub contract_changes: ::prost::alloc::vec::Vec<ContractChange>,
/// An array of newly added components. /// An array of newly added components.
#[prost(message, repeated, tag = "3")] #[prost(message, repeated, tag="3")]
pub component_changes: ::prost::alloc::vec::Vec<ProtocolComponent>, pub component_changes: ::prost::alloc::vec::Vec<ProtocolComponent>,
/// An array of balance changes to components. /// An array of balance changes to components.
#[prost(message, repeated, tag = "4")] #[prost(message, repeated, tag="4")]
pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>, pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
} }
/// A set of transaction changes within a single block. /// A set of transaction changes within a single block.
@@ -398,10 +405,10 @@ pub struct TransactionContractChanges {
#[derive(Clone, PartialEq, ::prost::Message)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockContractChanges { pub struct BlockContractChanges {
/// The block for which these changes are collectively computed. /// The block for which these changes are collectively computed.
#[prost(message, optional, tag = "1")] #[prost(message, optional, tag="1")]
pub block: ::core::option::Option<Block>, pub block: ::core::option::Option<Block>,
/// The set of transaction changes observed in the specified block. /// The set of transaction changes observed in the specified block.
#[prost(message, repeated, tag = "2")] #[prost(message, repeated, tag="2")]
pub changes: ::prost::alloc::vec::Vec<TransactionContractChanges>, pub changes: ::prost::alloc::vec::Vec<TransactionContractChanges>,
} }
// @@protoc_insertion_point(module) // @@protoc_insertion_point(module)