diff --git a/applications/tari_indexer/src/event_scanner.rs b/applications/tari_indexer/src/event_scanner.rs index 20da8e6e9..26556435e 100644 --- a/applications/tari_indexer/src/event_scanner.rs +++ b/applications/tari_indexer/src/event_scanner.rs @@ -26,11 +26,11 @@ use futures::StreamExt; use log::*; use tari_bor::decode; use tari_common::configuration::Network; -use tari_crypto::tari_utilities::message_format::MessageFormat; +use tari_crypto::{ristretto::RistrettoPublicKey, tari_utilities::message_format::MessageFormat}; use tari_dan_app_utilities::consensus_constants::ConsensusConstants; use tari_dan_common_types::{committee::Committee, Epoch, NumPreshards, PeerAddress, ShardGroup}; use tari_dan_p2p::proto::rpc::{GetTransactionResultRequest, PayloadResultStatus, SyncBlocksRequest}; -use tari_dan_storage::consensus_models::{Block, BlockId, Decision, TransactionRecord}; +use tari_dan_storage::consensus_models::{Block, BlockError, BlockId, Decision, TransactionRecord}; use tari_engine_types::{ commit_result::{ExecuteResult, TransactionResult}, events::Event, @@ -96,6 +96,7 @@ struct TransactionMetadata { pub struct EventScanner { network: Network, + sidechain_id: Option, epoch_manager: Box>, client_factory: TariValidatorNodeRpcClientFactory, substate_store: SqliteSubstateStore, @@ -105,6 +106,7 @@ pub struct EventScanner { impl EventScanner { pub fn new( network: Network, + sidechain_id: Option, epoch_manager: Box>, client_factory: TariValidatorNodeRpcClientFactory, substate_store: SqliteSubstateStore, @@ -112,6 +114,7 @@ impl EventScanner { ) -> Self { Self { network, + sidechain_id, epoch_manager, client_factory, substate_store, @@ -447,10 +450,10 @@ impl EventScanner { .collect() } - fn build_genesis_block_id(&self, num_preshards: NumPreshards) -> BlockId { + fn build_genesis_block_id(&self, num_preshards: NumPreshards) -> Result { // TODO: this should return the actual genesis for the shard group and epoch - let start_block = Block::zero_block(self.network, num_preshards); - *start_block.id() + let start_block = Block::zero_block(self.network, num_preshards, self.sidechain_id.clone())?; + Ok(*start_block.id()) } async fn get_oldest_scanned_epoch(&self) -> Result, anyhow::Error> { @@ -470,10 +473,14 @@ impl EventScanner { let start_block_id = self .substate_store .with_read_tx(|tx| tx.get_last_scanned_block_id(epoch, shard_group))?; - let start_block_id = start_block_id.unwrap_or_else(|| { - let consensus_constants = ConsensusConstants::from(self.network); - self.build_genesis_block_id(consensus_constants.num_preshards) - }); + + let start_block_id = match start_block_id { + Some(block_id) => block_id, + None => { + let consensus_constants = ConsensusConstants::from(self.network); + self.build_genesis_block_id(consensus_constants.num_preshards)? + }, + }; committee.shuffle(); let mut last_block_id = start_block_id; diff --git a/applications/tari_indexer/src/lib.rs b/applications/tari_indexer/src/lib.rs index d45c1a020..6b3aab818 100644 --- a/applications/tari_indexer/src/lib.rs +++ b/applications/tari_indexer/src/lib.rs @@ -181,6 +181,7 @@ pub async fn run_indexer(config: ApplicationConfig, mut shutdown_signal: Shutdow .map_err(|e| ExitError::new(ExitCode::ConfigError, format!("Invalid event filters: {}", e)))?; let event_scanner = Arc::new(EventScanner::new( config.network, + config.indexer.sidechain_id, Box::new(services.epoch_manager.clone()), services.validator_node_client_factory.clone(), services.substate_store.clone(), diff --git a/applications/tari_validator_node/src/bootstrap.rs b/applications/tari_validator_node/src/bootstrap.rs index 5e0ad8ffc..63d95cbfa 100644 --- a/applications/tari_validator_node/src/bootstrap.rs +++ b/applications/tari_validator_node/src/bootstrap.rs @@ -38,7 +38,7 @@ use tari_common::{ #[cfg(not(feature = "metrics"))] use tari_consensus::traits::hooks::NoopHooks; use tari_core::transactions::transaction_components::ValidatorNodeSignature; -use tari_crypto::tari_utilities::ByteArray; +use tari_crypto::{ristretto::RistrettoPublicKey, tari_utilities::ByteArray}; use tari_dan_app_utilities::{ base_layer_scanner, consensus_constants::ConsensusConstants, @@ -191,7 +191,15 @@ pub async fn spawn_services( // Connect to shard db let state_store = SqliteStateStore::connect(&format!("sqlite://{}", config.validator_node.state_db_path().display()))?; - state_store.with_write_tx(|tx| bootstrap_state(tx, config.network, consensus_constants.num_preshards))?; + let sidechain_id = config.validator_node.validator_node_sidechain_id.clone(); + state_store.with_write_tx(|tx| { + bootstrap_state( + tx, + config.network, + consensus_constants.num_preshards, + sidechain_id.clone(), + ) + })?; info!(target: LOG_TARGET, "Epoch manager initializing"); let epoch_manager_config = EpochManagerConfig { @@ -265,6 +273,7 @@ pub async fn spawn_services( let signing_service = consensus::TariSignatureService::new(keypair.clone()); let (consensus_join_handle, consensus_handle) = consensus::spawn( config.network, + sidechain_id, state_store.clone(), local_address, signing_service, @@ -450,7 +459,12 @@ async fn spawn_p2p_rpc( Ok(()) } -fn bootstrap_state(tx: &mut TTx, network: Network, num_preshards: NumPreshards) -> Result<(), StorageError> +fn bootstrap_state( + tx: &mut TTx, + network: Network, + num_preshards: NumPreshards, + sidechain_id: Option, +) -> Result<(), StorageError> where TTx: StateStoreWriteTransaction + Deref, TTx::Target: StateStoreReadTransaction, @@ -473,7 +487,14 @@ where None, None, ); - create_substate(tx, network, num_preshards, PUBLIC_IDENTITY_RESOURCE_ADDRESS, value)?; + create_substate( + tx, + network, + num_preshards, + &sidechain_id, + PUBLIC_IDENTITY_RESOURCE_ADDRESS, + value, + )?; let mut xtr_resource = Resource::new( ResourceType::Confidential, @@ -498,7 +519,14 @@ where state: cbor!({"vault" => XTR_FAUCET_VAULT_ADDRESS}).unwrap(), }, }; - create_substate(tx, network, num_preshards, XTR_FAUCET_COMPONENT_ADDRESS, value)?; + create_substate( + tx, + network, + num_preshards, + &sidechain_id, + XTR_FAUCET_COMPONENT_ADDRESS, + value, + )?; xtr_resource.increase_total_supply(Amount::MAX); let value = Vault::new(ResourceContainer::Confidential { @@ -509,13 +537,21 @@ where locked_revealed_amount: Default::default(), }); - create_substate(tx, network, num_preshards, XTR_FAUCET_VAULT_ADDRESS, value)?; + create_substate( + tx, + network, + num_preshards, + &sidechain_id, + XTR_FAUCET_VAULT_ADDRESS, + value, + )?; } create_substate( tx, network, num_preshards, + &sidechain_id, CONFIDENTIAL_TARI_RESOURCE_ADDRESS, xtr_resource, )?; @@ -527,6 +563,7 @@ fn create_substate( tx: &mut TTx, network: Network, num_preshards: NumPreshards, + sidechain_id: &Option, substate_id: TId, value: TVal, ) -> Result<(), StorageError> @@ -537,7 +574,12 @@ where TId: Into, TVal: Into, { - let genesis_block = Block::genesis(network, Epoch(0), ShardGroup::all_shards(num_preshards)); + let genesis_block = Block::genesis( + network, + Epoch(0), + ShardGroup::all_shards(num_preshards), + sidechain_id.clone(), + )?; let substate_id = substate_id.into(); let id = VersionedSubstateId::new(substate_id, 0); SubstateRecord { diff --git a/applications/tari_validator_node/src/consensus/mod.rs b/applications/tari_validator_node/src/consensus/mod.rs index 0576672af..84733ff78 100644 --- a/applications/tari_validator_node/src/consensus/mod.rs +++ b/applications/tari_validator_node/src/consensus/mod.rs @@ -7,6 +7,7 @@ use tari_consensus::{ hotstuff::{ConsensusWorker, ConsensusWorkerContext, HotstuffConfig, HotstuffWorker}, traits::ConsensusSpec, }; +use tari_crypto::ristretto::RistrettoPublicKey; use tari_dan_app_utilities::{ consensus_constants::ConsensusConstants, template_manager::implementation::TemplateManager, @@ -60,6 +61,7 @@ pub type ConsensusTransactionValidator = BoxedValidator, store: SqliteStateStore, local_addr: PeerAddress, signing_service: TariSignatureService, @@ -83,6 +85,7 @@ pub async fn spawn( let hs_config = HotstuffConfig { network, + sidechain_id, max_base_layer_blocks_behind: consensus_constants.max_base_layer_blocks_behind, max_base_layer_blocks_ahead: consensus_constants.max_base_layer_blocks_ahead, num_preshards: consensus_constants.num_preshards, diff --git a/bindings/dist/index.d.ts b/bindings/dist/index.d.ts index 2bdfef775..6e3b58bc2 100644 --- a/bindings/dist/index.d.ts +++ b/bindings/dist/index.d.ts @@ -1,24 +1,24 @@ export * from "./types/AccessRule"; export * from "./types/Account"; export * from "./types/Amount"; -export * from "./types/ArgDef"; export * from "./types/Arg"; +export * from "./types/ArgDef"; export * from "./types/AuthHook"; export * from "./types/Block"; export * from "./types/BucketId"; export * from "./types/Claims"; export * from "./types/Command"; +export * from "./types/Committee"; export * from "./types/CommitteeInfo"; export * from "./types/CommitteeShardInfo"; -export * from "./types/Committee"; export * from "./types/ComponentAccessRules"; export * from "./types/ComponentAddress"; export * from "./types/ComponentBody"; export * from "./types/ComponentHeader"; export * from "./types/ComponentKey"; export * from "./types/ConfidentialClaim"; -export * from "./types/ConfidentialOutputStatement"; export * from "./types/ConfidentialOutput"; +export * from "./types/ConfidentialOutputStatement"; export * from "./types/ConfidentialStatement"; export * from "./types/ConfidentialTransferInputSelection"; export * from "./types/ConfidentialWithdrawProof"; @@ -28,11 +28,12 @@ export * from "./types/EntityId"; export * from "./types/Epoch"; export * from "./types/Event"; export * from "./types/Evidence"; -export * from "./types/ExecutedTransaction"; export * from "./types/ExecuteResult"; +export * from "./types/ExecutedTransaction"; +export * from "./types/ExtraData"; export * from "./types/FeeBreakdown"; -export * from "./types/FeeClaimAddress"; export * from "./types/FeeClaim"; +export * from "./types/FeeClaimAddress"; export * from "./types/FeeCostBreakdown"; export * from "./types/FeeReceipt"; export * from "./types/FeeSource"; @@ -41,10 +42,10 @@ export * from "./types/ForeignProposalAtom"; export * from "./types/FunctionDef"; export * from "./types/IndexedValue"; export * from "./types/IndexedWellKnownTypes"; -export * from "./types/InstructionResult"; export * from "./types/Instruction"; -export * from "./types/JrpcPermissions"; +export * from "./types/InstructionResult"; export * from "./types/JrpcPermission"; +export * from "./types/JrpcPermissions"; export * from "./types/LeaderFee"; export * from "./types/LockFlag"; export * from "./types/LogEntry"; @@ -53,14 +54,14 @@ export * from "./types/Metadata"; export * from "./types/MintConfidentialOutputAtom"; export * from "./types/NetworkCommitteeInfo"; export * from "./types/NodeHeight"; -export * from "./types/NonFungibleAddressContents"; +export * from "./types/NonFungible"; export * from "./types/NonFungibleAddress"; +export * from "./types/NonFungibleAddressContents"; export * from "./types/NonFungibleContainer"; export * from "./types/NonFungibleId"; -export * from "./types/NonFungibleIndexAddress"; export * from "./types/NonFungibleIndex"; +export * from "./types/NonFungibleIndexAddress"; export * from "./types/NonFungibleToken"; -export * from "./types/NonFungible"; export * from "./types/NumPreshards"; export * from "./types/Ordering"; export * from "./types/OwnerRule"; @@ -70,47 +71,47 @@ export * from "./types/QuorumCertificate"; export * from "./types/QuorumDecision"; export * from "./types/RejectReason"; export * from "./types/RequireRule"; +export * from "./types/Resource"; export * from "./types/ResourceAccessRules"; export * from "./types/ResourceAddress"; export * from "./types/ResourceContainer"; -export * from "./types/Resource"; export * from "./types/ResourceType"; export * from "./types/RestrictedAccessRule"; export * from "./types/RuleRequirement"; +export * from "./types/Shard"; export * from "./types/ShardEvidence"; export * from "./types/ShardGroup"; -export * from "./types/Shard"; +export * from "./types/Substate"; export * from "./types/SubstateAddress"; export * from "./types/SubstateDestroyed"; export * from "./types/SubstateDiff"; export * from "./types/SubstateId"; export * from "./types/SubstateLockType"; export * from "./types/SubstateRecord"; -export * from "./types/SubstateRequirementLockIntent"; export * from "./types/SubstateRequirement"; -export * from "./types/Substate"; +export * from "./types/SubstateRequirementLockIntent"; export * from "./types/SubstateType"; export * from "./types/SubstateValue"; export * from "./types/TemplateDef"; export * from "./types/TemplateDefV1"; +export * from "./types/Transaction"; export * from "./types/TransactionAtom"; export * from "./types/TransactionPoolRecord"; export * from "./types/TransactionPoolStage"; -export * from "./types/TransactionReceiptAddress"; export * from "./types/TransactionReceipt"; +export * from "./types/TransactionReceiptAddress"; export * from "./types/TransactionResult"; export * from "./types/TransactionSignature"; export * from "./types/TransactionStatus"; -export * from "./types/Transaction"; export * from "./types/Type"; -export * from "./types/UnclaimedConfidentialOutputAddress"; export * from "./types/UnclaimedConfidentialOutput"; +export * from "./types/UnclaimedConfidentialOutputAddress"; export * from "./types/UnsignedTransaction"; export * from "./types/ValidatorSignature"; -export * from "./types/VaultId"; export * from "./types/Vault"; -export * from "./types/VersionedSubstateIdLockIntent"; +export * from "./types/VaultId"; export * from "./types/VersionedSubstateId"; +export * from "./types/VersionedSubstateIdLockIntent"; export * from "./types/ViewableBalanceProof"; export * from "./base-node-client"; export * from "./tari-indexer-client"; diff --git a/bindings/dist/index.js b/bindings/dist/index.js index 5ae537284..1defd5c79 100644 --- a/bindings/dist/index.js +++ b/bindings/dist/index.js @@ -3,24 +3,24 @@ export * from "./types/AccessRule"; export * from "./types/Account"; export * from "./types/Amount"; -export * from "./types/ArgDef"; export * from "./types/Arg"; +export * from "./types/ArgDef"; export * from "./types/AuthHook"; export * from "./types/Block"; export * from "./types/BucketId"; export * from "./types/Claims"; export * from "./types/Command"; +export * from "./types/Committee"; export * from "./types/CommitteeInfo"; export * from "./types/CommitteeShardInfo"; -export * from "./types/Committee"; export * from "./types/ComponentAccessRules"; export * from "./types/ComponentAddress"; export * from "./types/ComponentBody"; export * from "./types/ComponentHeader"; export * from "./types/ComponentKey"; export * from "./types/ConfidentialClaim"; -export * from "./types/ConfidentialOutputStatement"; export * from "./types/ConfidentialOutput"; +export * from "./types/ConfidentialOutputStatement"; export * from "./types/ConfidentialStatement"; export * from "./types/ConfidentialTransferInputSelection"; export * from "./types/ConfidentialWithdrawProof"; @@ -30,11 +30,12 @@ export * from "./types/EntityId"; export * from "./types/Epoch"; export * from "./types/Event"; export * from "./types/Evidence"; -export * from "./types/ExecutedTransaction"; export * from "./types/ExecuteResult"; +export * from "./types/ExecutedTransaction"; +export * from "./types/ExtraData"; export * from "./types/FeeBreakdown"; -export * from "./types/FeeClaimAddress"; export * from "./types/FeeClaim"; +export * from "./types/FeeClaimAddress"; export * from "./types/FeeCostBreakdown"; export * from "./types/FeeReceipt"; export * from "./types/FeeSource"; @@ -43,10 +44,10 @@ export * from "./types/ForeignProposalAtom"; export * from "./types/FunctionDef"; export * from "./types/IndexedValue"; export * from "./types/IndexedWellKnownTypes"; -export * from "./types/InstructionResult"; export * from "./types/Instruction"; -export * from "./types/JrpcPermissions"; +export * from "./types/InstructionResult"; export * from "./types/JrpcPermission"; +export * from "./types/JrpcPermissions"; export * from "./types/LeaderFee"; export * from "./types/LockFlag"; export * from "./types/LogEntry"; @@ -55,14 +56,14 @@ export * from "./types/Metadata"; export * from "./types/MintConfidentialOutputAtom"; export * from "./types/NetworkCommitteeInfo"; export * from "./types/NodeHeight"; -export * from "./types/NonFungibleAddressContents"; +export * from "./types/NonFungible"; export * from "./types/NonFungibleAddress"; +export * from "./types/NonFungibleAddressContents"; export * from "./types/NonFungibleContainer"; export * from "./types/NonFungibleId"; -export * from "./types/NonFungibleIndexAddress"; export * from "./types/NonFungibleIndex"; +export * from "./types/NonFungibleIndexAddress"; export * from "./types/NonFungibleToken"; -export * from "./types/NonFungible"; export * from "./types/NumPreshards"; export * from "./types/Ordering"; export * from "./types/OwnerRule"; @@ -72,47 +73,47 @@ export * from "./types/QuorumCertificate"; export * from "./types/QuorumDecision"; export * from "./types/RejectReason"; export * from "./types/RequireRule"; +export * from "./types/Resource"; export * from "./types/ResourceAccessRules"; export * from "./types/ResourceAddress"; export * from "./types/ResourceContainer"; -export * from "./types/Resource"; export * from "./types/ResourceType"; export * from "./types/RestrictedAccessRule"; export * from "./types/RuleRequirement"; +export * from "./types/Shard"; export * from "./types/ShardEvidence"; export * from "./types/ShardGroup"; -export * from "./types/Shard"; +export * from "./types/Substate"; export * from "./types/SubstateAddress"; export * from "./types/SubstateDestroyed"; export * from "./types/SubstateDiff"; export * from "./types/SubstateId"; export * from "./types/SubstateLockType"; export * from "./types/SubstateRecord"; -export * from "./types/SubstateRequirementLockIntent"; export * from "./types/SubstateRequirement"; -export * from "./types/Substate"; +export * from "./types/SubstateRequirementLockIntent"; export * from "./types/SubstateType"; export * from "./types/SubstateValue"; export * from "./types/TemplateDef"; export * from "./types/TemplateDefV1"; +export * from "./types/Transaction"; export * from "./types/TransactionAtom"; export * from "./types/TransactionPoolRecord"; export * from "./types/TransactionPoolStage"; -export * from "./types/TransactionReceiptAddress"; export * from "./types/TransactionReceipt"; +export * from "./types/TransactionReceiptAddress"; export * from "./types/TransactionResult"; export * from "./types/TransactionSignature"; export * from "./types/TransactionStatus"; -export * from "./types/Transaction"; export * from "./types/Type"; -export * from "./types/UnclaimedConfidentialOutputAddress"; export * from "./types/UnclaimedConfidentialOutput"; +export * from "./types/UnclaimedConfidentialOutputAddress"; export * from "./types/UnsignedTransaction"; export * from "./types/ValidatorSignature"; -export * from "./types/VaultId"; export * from "./types/Vault"; -export * from "./types/VersionedSubstateIdLockIntent"; +export * from "./types/VaultId"; export * from "./types/VersionedSubstateId"; +export * from "./types/VersionedSubstateIdLockIntent"; export * from "./types/ViewableBalanceProof"; export * from "./base-node-client"; export * from "./tari-indexer-client"; diff --git a/bindings/dist/tari-indexer-client.d.ts b/bindings/dist/tari-indexer-client.d.ts index 2bc290afb..03fbfd537 100644 --- a/bindings/dist/tari-indexer-client.d.ts +++ b/bindings/dist/tari-indexer-client.d.ts @@ -1,34 +1,34 @@ -export * from "./types/tari-indexer-client/IndexerSubmitTransactionResponse"; +export * from "./types/tari-indexer-client/IndexerGetEpochManagerStatsResponse"; +export * from "./types/tari-indexer-client/IndexerAddPeerRequest"; +export * from "./types/tari-indexer-client/NonFungibleSubstate"; +export * from "./types/tari-indexer-client/GetNonFungibleCountResponse"; +export * from "./types/tari-indexer-client/ListSubstatesRequest"; +export * from "./types/tari-indexer-client/IndexerGetIdentityResponse"; export * from "./types/tari-indexer-client/GetTemplateDefinitionRequest"; -export * from "./types/tari-indexer-client/ListSubstatesResponse"; -export * from "./types/tari-indexer-client/IndexerAddPeerResponse"; -export * from "./types/tari-indexer-client/InspectSubstateRequest"; -export * from "./types/tari-indexer-client/ListSubstateItem"; +export * from "./types/tari-indexer-client/IndexerGetSubstateRequest"; +export * from "./types/tari-indexer-client/GetTemplateDefinitionResponse"; +export * from "./types/tari-indexer-client/ListTemplatesRequest"; export * from "./types/tari-indexer-client/IndexerGetAllVnsResponse"; -export * from "./types/tari-indexer-client/ListSubstatesRequest"; -export * from "./types/tari-indexer-client/GetRelatedTransactionsResponse"; -export * from "./types/tari-indexer-client/IndexerTransactionFinalizedResult"; +export * from "./types/tari-indexer-client/GetNonFungiblesRequest"; export * from "./types/tari-indexer-client/IndexerGetSubstateResponse"; +export * from "./types/tari-indexer-client/IndexerSubmitTransactionRequest"; +export * from "./types/tari-indexer-client/IndexerConnection"; +export * from "./types/tari-indexer-client/InspectSubstateResponse"; export * from "./types/tari-indexer-client/IndexerGetAllVnsRequest"; +export * from "./types/tari-indexer-client/InspectSubstateRequest"; export * from "./types/tari-indexer-client/IndexerGetCommsStatsResponse"; -export * from "./types/tari-indexer-client/IndexerConnection"; -export * from "./types/tari-indexer-client/GetNonFungiblesRequest"; -export * from "./types/tari-indexer-client/IndexerAddPeerRequest"; -export * from "./types/tari-indexer-client/GetRelatedTransactionsRequest"; -export * from "./types/tari-indexer-client/GetNonFungiblesResponse"; -export * from "./types/tari-indexer-client/GetTemplateDefinitionResponse"; +export * from "./types/tari-indexer-client/GetNonFungibleCountRequest"; +export * from "./types/tari-indexer-client/GetRelatedTransactionsResponse"; +export * from "./types/tari-indexer-client/IndexerAddPeerResponse"; export * from "./types/tari-indexer-client/IndexerGetConnectionsResponse"; -export * from "./types/tari-indexer-client/IndexerSubmitTransactionRequest"; +export * from "./types/tari-indexer-client/GetNonFungiblesResponse"; +export * from "./types/tari-indexer-client/GetRelatedTransactionsRequest"; +export * from "./types/tari-indexer-client/IndexerGetTransactionResultResponse"; export * from "./types/tari-indexer-client/ListTemplatesResponse"; -export * from "./types/tari-indexer-client/InspectSubstateResponse"; +export * from "./types/tari-indexer-client/IndexerGetTransactionResultRequest"; +export * from "./types/tari-indexer-client/ListSubstatesResponse"; +export * from "./types/tari-indexer-client/IndexerTransactionFinalizedResult"; export * from "./types/tari-indexer-client/GetNonFungibleCollectionsResponse"; -export * from "./types/tari-indexer-client/IndexerGetSubstateRequest"; -export * from "./types/tari-indexer-client/IndexerGetEpochManagerStatsResponse"; -export * from "./types/tari-indexer-client/NonFungibleSubstate"; -export * from "./types/tari-indexer-client/GetNonFungibleCountResponse"; -export * from "./types/tari-indexer-client/ListTemplatesRequest"; -export * from "./types/tari-indexer-client/IndexerGetTransactionResultResponse"; +export * from "./types/tari-indexer-client/IndexerSubmitTransactionResponse"; export * from "./types/tari-indexer-client/IndexerConnectionDirection"; -export * from "./types/tari-indexer-client/IndexerGetIdentityResponse"; -export * from "./types/tari-indexer-client/IndexerGetTransactionResultRequest"; -export * from "./types/tari-indexer-client/GetNonFungibleCountRequest"; +export * from "./types/tari-indexer-client/ListSubstateItem"; diff --git a/bindings/dist/tari-indexer-client.js b/bindings/dist/tari-indexer-client.js index d6c53a6f9..633c07b9e 100644 --- a/bindings/dist/tari-indexer-client.js +++ b/bindings/dist/tari-indexer-client.js @@ -1,36 +1,36 @@ // Copyright 2023 The Tari Project // SPDX-License-Identifier: BSD-3-Clause -export * from "./types/tari-indexer-client/IndexerSubmitTransactionResponse"; +export * from "./types/tari-indexer-client/IndexerGetEpochManagerStatsResponse"; +export * from "./types/tari-indexer-client/IndexerAddPeerRequest"; +export * from "./types/tari-indexer-client/NonFungibleSubstate"; +export * from "./types/tari-indexer-client/GetNonFungibleCountResponse"; +export * from "./types/tari-indexer-client/ListSubstatesRequest"; +export * from "./types/tari-indexer-client/IndexerGetIdentityResponse"; export * from "./types/tari-indexer-client/GetTemplateDefinitionRequest"; -export * from "./types/tari-indexer-client/ListSubstatesResponse"; -export * from "./types/tari-indexer-client/IndexerAddPeerResponse"; -export * from "./types/tari-indexer-client/InspectSubstateRequest"; -export * from "./types/tari-indexer-client/ListSubstateItem"; +export * from "./types/tari-indexer-client/IndexerGetSubstateRequest"; +export * from "./types/tari-indexer-client/GetTemplateDefinitionResponse"; +export * from "./types/tari-indexer-client/ListTemplatesRequest"; export * from "./types/tari-indexer-client/IndexerGetAllVnsResponse"; -export * from "./types/tari-indexer-client/ListSubstatesRequest"; -export * from "./types/tari-indexer-client/GetRelatedTransactionsResponse"; -export * from "./types/tari-indexer-client/IndexerTransactionFinalizedResult"; +export * from "./types/tari-indexer-client/GetNonFungiblesRequest"; export * from "./types/tari-indexer-client/IndexerGetSubstateResponse"; +export * from "./types/tari-indexer-client/IndexerSubmitTransactionRequest"; +export * from "./types/tari-indexer-client/IndexerConnection"; +export * from "./types/tari-indexer-client/InspectSubstateResponse"; export * from "./types/tari-indexer-client/IndexerGetAllVnsRequest"; +export * from "./types/tari-indexer-client/InspectSubstateRequest"; export * from "./types/tari-indexer-client/IndexerGetCommsStatsResponse"; -export * from "./types/tari-indexer-client/IndexerConnection"; -export * from "./types/tari-indexer-client/GetNonFungiblesRequest"; -export * from "./types/tari-indexer-client/IndexerAddPeerRequest"; -export * from "./types/tari-indexer-client/GetRelatedTransactionsRequest"; -export * from "./types/tari-indexer-client/GetNonFungiblesResponse"; -export * from "./types/tari-indexer-client/GetTemplateDefinitionResponse"; +export * from "./types/tari-indexer-client/GetNonFungibleCountRequest"; +export * from "./types/tari-indexer-client/GetRelatedTransactionsResponse"; +export * from "./types/tari-indexer-client/IndexerAddPeerResponse"; export * from "./types/tari-indexer-client/IndexerGetConnectionsResponse"; -export * from "./types/tari-indexer-client/IndexerSubmitTransactionRequest"; +export * from "./types/tari-indexer-client/GetNonFungiblesResponse"; +export * from "./types/tari-indexer-client/GetRelatedTransactionsRequest"; +export * from "./types/tari-indexer-client/IndexerGetTransactionResultResponse"; export * from "./types/tari-indexer-client/ListTemplatesResponse"; -export * from "./types/tari-indexer-client/InspectSubstateResponse"; +export * from "./types/tari-indexer-client/IndexerGetTransactionResultRequest"; +export * from "./types/tari-indexer-client/ListSubstatesResponse"; +export * from "./types/tari-indexer-client/IndexerTransactionFinalizedResult"; export * from "./types/tari-indexer-client/GetNonFungibleCollectionsResponse"; -export * from "./types/tari-indexer-client/IndexerGetSubstateRequest"; -export * from "./types/tari-indexer-client/IndexerGetEpochManagerStatsResponse"; -export * from "./types/tari-indexer-client/NonFungibleSubstate"; -export * from "./types/tari-indexer-client/GetNonFungibleCountResponse"; -export * from "./types/tari-indexer-client/ListTemplatesRequest"; -export * from "./types/tari-indexer-client/IndexerGetTransactionResultResponse"; +export * from "./types/tari-indexer-client/IndexerSubmitTransactionResponse"; export * from "./types/tari-indexer-client/IndexerConnectionDirection"; -export * from "./types/tari-indexer-client/IndexerGetIdentityResponse"; -export * from "./types/tari-indexer-client/IndexerGetTransactionResultRequest"; -export * from "./types/tari-indexer-client/GetNonFungibleCountRequest"; +export * from "./types/tari-indexer-client/ListSubstateItem"; diff --git a/bindings/dist/types/Block.d.ts b/bindings/dist/types/Block.d.ts index 4c04f70fe..5ac2b4aca 100644 --- a/bindings/dist/types/Block.d.ts +++ b/bindings/dist/types/Block.d.ts @@ -1,5 +1,6 @@ import type { Command } from "./Command"; import type { Epoch } from "./Epoch"; +import type { ExtraData } from "./ExtraData"; import type { NodeHeight } from "./NodeHeight"; import type { QuorumCertificate } from "./QuorumCertificate"; import type { Shard } from "./Shard"; @@ -29,4 +30,5 @@ export interface Block { timestamp: number; base_layer_block_height: number; base_layer_block_hash: string; + extra_data: ExtraData | null; } diff --git a/bindings/dist/types/ExtraData.d.ts b/bindings/dist/types/ExtraData.d.ts new file mode 100644 index 000000000..85d9982c8 --- /dev/null +++ b/bindings/dist/types/ExtraData.d.ts @@ -0,0 +1 @@ +export type ExtraData = string; diff --git a/bindings/dist/types/ExtraData.js b/bindings/dist/types/ExtraData.js new file mode 100644 index 000000000..e5b481d1e --- /dev/null +++ b/bindings/dist/types/ExtraData.js @@ -0,0 +1,2 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +export {}; diff --git a/bindings/dist/validator-node-client.d.ts b/bindings/dist/validator-node-client.d.ts index 46ef6ce68..cfd875605 100644 --- a/bindings/dist/validator-node-client.d.ts +++ b/bindings/dist/validator-node-client.d.ts @@ -1,56 +1,56 @@ +export * from "./types/validator-node-client/GetCommitteeRequest"; +export * from "./types/validator-node-client/GetRecentTransactionsResponse"; +export * from "./types/validator-node-client/GetRecentTransactionsRequest"; +export * from "./types/validator-node-client/GetTemplatesRequest"; +export * from "./types/validator-node-client/GetBlocksCountResponse"; +export * from "./types/validator-node-client/VNAddPeerRequest"; +export * from "./types/validator-node-client/GetCommitteeResponse"; export * from "./types/validator-node-client/VNSubmitTransactionRequest"; +export * from "./types/validator-node-client/VNConnectionDirection"; +export * from "./types/validator-node-client/VNAddPeerResponse"; +export * from "./types/validator-node-client/GetSubstatesByTransactionResponse"; +export * from "./types/validator-node-client/VNCommitteeShardInfo"; +export * from "./types/validator-node-client/VNFunctionDef"; +export * from "./types/validator-node-client/VNGetValidatorFeesResponse"; +export * from "./types/validator-node-client/VNGetAllVnsResponse"; +export * from "./types/validator-node-client/TemplateAbi"; +export * from "./types/validator-node-client/GetMempoolStatsResponse"; export * from "./types/validator-node-client/TemplateMetadata"; -export * from "./types/validator-node-client/GetFilteredBlocksCountRequest"; +export * from "./types/validator-node-client/GetBlockResponse"; +export * from "./types/validator-node-client/VNLogLevel"; +export * from "./types/validator-node-client/VNGetAllVnsRequest"; export * from "./types/validator-node-client/VNLogEntry"; export * from "./types/validator-node-client/GetShardKeyRequest"; -export * from "./types/validator-node-client/VNGetTransactionResultResponse"; +export * from "./types/validator-node-client/GetBlockRequest"; export * from "./types/validator-node-client/VNSubmitTransactionResponse"; +export * from "./types/validator-node-client/DryRunTransactionFinalizeResult"; +export * from "./types/validator-node-client/GetTransactionResponse"; +export * from "./types/validator-node-client/GetStateResponse"; +export * from "./types/validator-node-client/VNGetSubstateRequest"; +export * from "./types/validator-node-client/VNGetSubstateResponse"; +export * from "./types/validator-node-client/ListBlocksResponse"; +export * from "./types/validator-node-client/SubstateStatus"; +export * from "./types/validator-node-client/ValidatorNode"; +export * from "./types/validator-node-client/GetFilteredBlocksCountRequest"; +export * from "./types/validator-node-client/ListBlocksRequest"; +export * from "./types/validator-node-client/GetEpochManagerStatsResponse"; export * from "./types/validator-node-client/GetTxPoolResponse"; +export * from "./types/validator-node-client/VNConnection"; export * from "./types/validator-node-client/GetTemplateResponse"; -export * from "./types/validator-node-client/GetBlocksCountResponse"; -export * from "./types/validator-node-client/VNGetValidatorFeesRequest"; -export * from "./types/validator-node-client/GetSubstatesByTransactionResponse"; -export * from "./types/validator-node-client/VNConnectionDirection"; -export * from "./types/validator-node-client/VNAddPeerRequest"; -export * from "./types/validator-node-client/GetTemplatesResponse"; -export * from "./types/validator-node-client/GetTransactionRequest"; +export * from "./types/validator-node-client/ValidatorFee"; +export * from "./types/validator-node-client/VNGetConnectionsResponse"; +export * from "./types/validator-node-client/VNGetCommsStatsResponse"; +export * from "./types/validator-node-client/GetTemplateRequest"; export * from "./types/validator-node-client/GetStateRequest"; -export * from "./types/validator-node-client/VNGetIdentityResponse"; -export * from "./types/validator-node-client/VNFunctionDef"; export * from "./types/validator-node-client/GetBlocksRequest"; -export * from "./types/validator-node-client/GetTemplateRequest"; +export * from "./types/validator-node-client/VNGetTransactionResultRequest"; +export * from "./types/validator-node-client/GetTransactionRequest"; +export * from "./types/validator-node-client/GetTemplatesResponse"; +export * from "./types/validator-node-client/VNGetTransactionResultResponse"; +export * from "./types/validator-node-client/VNArgDef"; export * from "./types/validator-node-client/GetShardKeyResponse"; -export * from "./types/validator-node-client/GetSubstatesByTransactionRequest"; -export * from "./types/validator-node-client/VNGetCommsStatsResponse"; -export * from "./types/validator-node-client/GetTransactionResponse"; -export * from "./types/validator-node-client/GetCommitteeResponse"; -export * from "./types/validator-node-client/VNGetAllVnsRequest"; -export * from "./types/validator-node-client/GetCommitteeRequest"; -export * from "./types/validator-node-client/DryRunTransactionFinalizeResult"; -export * from "./types/validator-node-client/VNGetValidatorFeesResponse"; -export * from "./types/validator-node-client/GetStateResponse"; -export * from "./types/validator-node-client/SubstateStatus"; export * from "./types/validator-node-client/GetBlocksResponse"; -export * from "./types/validator-node-client/ListBlocksResponse"; -export * from "./types/validator-node-client/GetBlockRequest"; -export * from "./types/validator-node-client/VNGetTransactionResultRequest"; -export * from "./types/validator-node-client/GetRecentTransactionsRequest"; -export * from "./types/validator-node-client/ValidatorFee"; -export * from "./types/validator-node-client/VNLogLevel"; -export * from "./types/validator-node-client/GetRecentTransactionsResponse"; -export * from "./types/validator-node-client/VNAddPeerResponse"; -export * from "./types/validator-node-client/VNConnection"; -export * from "./types/validator-node-client/ValidatorNode"; -export * from "./types/validator-node-client/VNGetConnectionsResponse"; -export * from "./types/validator-node-client/ListBlocksRequest"; +export * from "./types/validator-node-client/VNGetIdentityResponse"; +export * from "./types/validator-node-client/GetSubstatesByTransactionRequest"; export * from "./types/validator-node-client/GetNetworkCommitteeResponse"; -export * from "./types/validator-node-client/VNGetSubstateRequest"; -export * from "./types/validator-node-client/GetMempoolStatsResponse"; -export * from "./types/validator-node-client/TemplateAbi"; -export * from "./types/validator-node-client/GetTemplatesRequest"; -export * from "./types/validator-node-client/VNGetSubstateResponse"; -export * from "./types/validator-node-client/VNGetAllVnsResponse"; -export * from "./types/validator-node-client/VNArgDef"; -export * from "./types/validator-node-client/GetEpochManagerStatsResponse"; -export * from "./types/validator-node-client/GetBlockResponse"; -export * from "./types/validator-node-client/VNCommitteeShardInfo"; +export * from "./types/validator-node-client/VNGetValidatorFeesRequest"; diff --git a/bindings/dist/validator-node-client.js b/bindings/dist/validator-node-client.js index 89eb92b00..477e5dd45 100644 --- a/bindings/dist/validator-node-client.js +++ b/bindings/dist/validator-node-client.js @@ -1,58 +1,58 @@ // Copyright 2023 The Tari Project // SPDX-License-Identifier: BSD-3-Clause +export * from "./types/validator-node-client/GetCommitteeRequest"; +export * from "./types/validator-node-client/GetRecentTransactionsResponse"; +export * from "./types/validator-node-client/GetRecentTransactionsRequest"; +export * from "./types/validator-node-client/GetTemplatesRequest"; +export * from "./types/validator-node-client/GetBlocksCountResponse"; +export * from "./types/validator-node-client/VNAddPeerRequest"; +export * from "./types/validator-node-client/GetCommitteeResponse"; export * from "./types/validator-node-client/VNSubmitTransactionRequest"; +export * from "./types/validator-node-client/VNConnectionDirection"; +export * from "./types/validator-node-client/VNAddPeerResponse"; +export * from "./types/validator-node-client/GetSubstatesByTransactionResponse"; +export * from "./types/validator-node-client/VNCommitteeShardInfo"; +export * from "./types/validator-node-client/VNFunctionDef"; +export * from "./types/validator-node-client/VNGetValidatorFeesResponse"; +export * from "./types/validator-node-client/VNGetAllVnsResponse"; +export * from "./types/validator-node-client/TemplateAbi"; +export * from "./types/validator-node-client/GetMempoolStatsResponse"; export * from "./types/validator-node-client/TemplateMetadata"; -export * from "./types/validator-node-client/GetFilteredBlocksCountRequest"; +export * from "./types/validator-node-client/GetBlockResponse"; +export * from "./types/validator-node-client/VNLogLevel"; +export * from "./types/validator-node-client/VNGetAllVnsRequest"; export * from "./types/validator-node-client/VNLogEntry"; export * from "./types/validator-node-client/GetShardKeyRequest"; -export * from "./types/validator-node-client/VNGetTransactionResultResponse"; +export * from "./types/validator-node-client/GetBlockRequest"; export * from "./types/validator-node-client/VNSubmitTransactionResponse"; +export * from "./types/validator-node-client/DryRunTransactionFinalizeResult"; +export * from "./types/validator-node-client/GetTransactionResponse"; +export * from "./types/validator-node-client/GetStateResponse"; +export * from "./types/validator-node-client/VNGetSubstateRequest"; +export * from "./types/validator-node-client/VNGetSubstateResponse"; +export * from "./types/validator-node-client/ListBlocksResponse"; +export * from "./types/validator-node-client/SubstateStatus"; +export * from "./types/validator-node-client/ValidatorNode"; +export * from "./types/validator-node-client/GetFilteredBlocksCountRequest"; +export * from "./types/validator-node-client/ListBlocksRequest"; +export * from "./types/validator-node-client/GetEpochManagerStatsResponse"; export * from "./types/validator-node-client/GetTxPoolResponse"; +export * from "./types/validator-node-client/VNConnection"; export * from "./types/validator-node-client/GetTemplateResponse"; -export * from "./types/validator-node-client/GetBlocksCountResponse"; -export * from "./types/validator-node-client/VNGetValidatorFeesRequest"; -export * from "./types/validator-node-client/GetSubstatesByTransactionResponse"; -export * from "./types/validator-node-client/VNConnectionDirection"; -export * from "./types/validator-node-client/VNAddPeerRequest"; -export * from "./types/validator-node-client/GetTemplatesResponse"; -export * from "./types/validator-node-client/GetTransactionRequest"; +export * from "./types/validator-node-client/ValidatorFee"; +export * from "./types/validator-node-client/VNGetConnectionsResponse"; +export * from "./types/validator-node-client/VNGetCommsStatsResponse"; +export * from "./types/validator-node-client/GetTemplateRequest"; export * from "./types/validator-node-client/GetStateRequest"; -export * from "./types/validator-node-client/VNGetIdentityResponse"; -export * from "./types/validator-node-client/VNFunctionDef"; export * from "./types/validator-node-client/GetBlocksRequest"; -export * from "./types/validator-node-client/GetTemplateRequest"; +export * from "./types/validator-node-client/VNGetTransactionResultRequest"; +export * from "./types/validator-node-client/GetTransactionRequest"; +export * from "./types/validator-node-client/GetTemplatesResponse"; +export * from "./types/validator-node-client/VNGetTransactionResultResponse"; +export * from "./types/validator-node-client/VNArgDef"; export * from "./types/validator-node-client/GetShardKeyResponse"; -export * from "./types/validator-node-client/GetSubstatesByTransactionRequest"; -export * from "./types/validator-node-client/VNGetCommsStatsResponse"; -export * from "./types/validator-node-client/GetTransactionResponse"; -export * from "./types/validator-node-client/GetCommitteeResponse"; -export * from "./types/validator-node-client/VNGetAllVnsRequest"; -export * from "./types/validator-node-client/GetCommitteeRequest"; -export * from "./types/validator-node-client/DryRunTransactionFinalizeResult"; -export * from "./types/validator-node-client/VNGetValidatorFeesResponse"; -export * from "./types/validator-node-client/GetStateResponse"; -export * from "./types/validator-node-client/SubstateStatus"; export * from "./types/validator-node-client/GetBlocksResponse"; -export * from "./types/validator-node-client/ListBlocksResponse"; -export * from "./types/validator-node-client/GetBlockRequest"; -export * from "./types/validator-node-client/VNGetTransactionResultRequest"; -export * from "./types/validator-node-client/GetRecentTransactionsRequest"; -export * from "./types/validator-node-client/ValidatorFee"; -export * from "./types/validator-node-client/VNLogLevel"; -export * from "./types/validator-node-client/GetRecentTransactionsResponse"; -export * from "./types/validator-node-client/VNAddPeerResponse"; -export * from "./types/validator-node-client/VNConnection"; -export * from "./types/validator-node-client/ValidatorNode"; -export * from "./types/validator-node-client/VNGetConnectionsResponse"; -export * from "./types/validator-node-client/ListBlocksRequest"; +export * from "./types/validator-node-client/VNGetIdentityResponse"; +export * from "./types/validator-node-client/GetSubstatesByTransactionRequest"; export * from "./types/validator-node-client/GetNetworkCommitteeResponse"; -export * from "./types/validator-node-client/VNGetSubstateRequest"; -export * from "./types/validator-node-client/GetMempoolStatsResponse"; -export * from "./types/validator-node-client/TemplateAbi"; -export * from "./types/validator-node-client/GetTemplatesRequest"; -export * from "./types/validator-node-client/VNGetSubstateResponse"; -export * from "./types/validator-node-client/VNGetAllVnsResponse"; -export * from "./types/validator-node-client/VNArgDef"; -export * from "./types/validator-node-client/GetEpochManagerStatsResponse"; -export * from "./types/validator-node-client/GetBlockResponse"; -export * from "./types/validator-node-client/VNCommitteeShardInfo"; +export * from "./types/validator-node-client/VNGetValidatorFeesRequest"; diff --git a/bindings/dist/wallet-daemon-client.d.ts b/bindings/dist/wallet-daemon-client.d.ts index 6e37656ae..0a00af2bb 100644 --- a/bindings/dist/wallet-daemon-client.d.ts +++ b/bindings/dist/wallet-daemon-client.d.ts @@ -1,87 +1,87 @@ -export * from "./types/wallet-daemon-client/WalletSubstateRecord"; -export * from "./types/wallet-daemon-client/ProofsFinalizeResponse"; -export * from "./types/wallet-daemon-client/CallInstructionRequest"; -export * from "./types/wallet-daemon-client/AuthLoginAcceptResponse"; -export * from "./types/wallet-daemon-client/AccountsListRequest"; -export * from "./types/wallet-daemon-client/AuthGetAllJwtResponse"; -export * from "./types/wallet-daemon-client/AuthLoginResponse"; -export * from "./types/wallet-daemon-client/GetValidatorFeesRequest"; -export * from "./types/wallet-daemon-client/AccountGetDefaultRequest"; -export * from "./types/wallet-daemon-client/AuthGetAllJwtRequest"; -export * from "./types/wallet-daemon-client/KeyBranch"; -export * from "./types/wallet-daemon-client/AccountGetResponse"; -export * from "./types/wallet-daemon-client/SettingsSetRequest"; -export * from "./types/wallet-daemon-client/GetValidatorFeesResponse"; -export * from "./types/wallet-daemon-client/TransactionGetAllRequest"; +export * from "./types/wallet-daemon-client/AccountsListResponse"; export * from "./types/wallet-daemon-client/RevealFundsRequest"; -export * from "./types/wallet-daemon-client/AuthLoginDenyResponse"; -export * from "./types/wallet-daemon-client/AuthLoginDenyRequest"; -export * from "./types/wallet-daemon-client/TransactionSubmitResponse"; -export * from "./types/wallet-daemon-client/ProofsGenerateResponse"; -export * from "./types/wallet-daemon-client/ClaimValidatorFeesRequest"; -export * from "./types/wallet-daemon-client/AuthLoginRequest"; +export * from "./types/wallet-daemon-client/ClaimBurnResponse"; +export * from "./types/wallet-daemon-client/KeysSetActiveRequest"; +export * from "./types/wallet-daemon-client/WalletSubstateRecord"; +export * from "./types/wallet-daemon-client/AccountsGetBalancesResponse"; +export * from "./types/wallet-daemon-client/SubstatesGetResponse"; export * from "./types/wallet-daemon-client/ListAccountNftRequest"; +export * from "./types/wallet-daemon-client/RevealFundsResponse"; +export * from "./types/wallet-daemon-client/AccountSetDefaultRequest"; +export * from "./types/wallet-daemon-client/GetAccountNftRequest"; +export * from "./types/wallet-daemon-client/TransactionGetAllResponse"; export * from "./types/wallet-daemon-client/TransactionGetRequest"; -export * from "./types/wallet-daemon-client/AuthRevokeTokenResponse"; -export * from "./types/wallet-daemon-client/ProofsFinalizeRequest"; -export * from "./types/wallet-daemon-client/AccountsTransferRequest"; -export * from "./types/wallet-daemon-client/SettingsSetResponse"; -export * from "./types/wallet-daemon-client/KeysListRequest"; +export * from "./types/wallet-daemon-client/KeyBranch"; +export * from "./types/wallet-daemon-client/AuthLoginAcceptRequest"; +export * from "./types/wallet-daemon-client/AccountSetDefaultResponse"; +export * from "./types/wallet-daemon-client/SubstatesListResponse"; +export * from "./types/wallet-daemon-client/AccountGetDefaultRequest"; +export * from "./types/wallet-daemon-client/KeysListResponse"; +export * from "./types/wallet-daemon-client/ProofsGenerateResponse"; +export * from "./types/wallet-daemon-client/TransactionGetAllRequest"; export * from "./types/wallet-daemon-client/AccountsTransferResponse"; -export * from "./types/wallet-daemon-client/TransactionGetResultResponse"; +export * from "./types/wallet-daemon-client/AuthLoginResponse"; export * from "./types/wallet-daemon-client/ClaimBurnRequest"; -export * from "./types/wallet-daemon-client/KeysListResponse"; +export * from "./types/wallet-daemon-client/BalanceEntry"; +export * from "./types/wallet-daemon-client/KeysListRequest"; export * from "./types/wallet-daemon-client/SubstatesGetRequest"; -export * from "./types/wallet-daemon-client/TransactionSubmitRequest"; -export * from "./types/wallet-daemon-client/AccountsGetBalancesResponse"; -export * from "./types/wallet-daemon-client/TransactionGetAllResponse"; -export * from "./types/wallet-daemon-client/AccountsCreateFreeTestCoinsResponse"; -export * from "./types/wallet-daemon-client/ConfidentialTransferResponse"; -export * from "./types/wallet-daemon-client/TransactionGetResponse"; -export * from "./types/wallet-daemon-client/SubstatesGetResponse"; -export * from "./types/wallet-daemon-client/GetAccountNftRequest"; +export * from "./types/wallet-daemon-client/ProofsFinalizeResponse"; export * from "./types/wallet-daemon-client/AuthRevokeTokenRequest"; -export * from "./types/wallet-daemon-client/ProofsGenerateRequest"; -export * from "./types/wallet-daemon-client/RevealFundsResponse"; -export * from "./types/wallet-daemon-client/AccountsInvokeResponse"; -export * from "./types/wallet-daemon-client/AccountsListResponse"; +export * from "./types/wallet-daemon-client/TransactionWaitResultRequest"; +export * from "./types/wallet-daemon-client/TransactionSubmitResponse"; +export * from "./types/wallet-daemon-client/AccountsCreateRequest"; +export * from "./types/wallet-daemon-client/CallInstructionRequest"; +export * from "./types/wallet-daemon-client/WebRtcStartRequest"; export * from "./types/wallet-daemon-client/WebRtcStartResponse"; -export * from "./types/wallet-daemon-client/TransactionGetResultRequest"; +export * from "./types/wallet-daemon-client/MintAccountNftResponse"; export * from "./types/wallet-daemon-client/ProofsCancelResponse"; -export * from "./types/wallet-daemon-client/AccountsCreateRequest"; -export * from "./types/wallet-daemon-client/MintAccountNftRequest"; -export * from "./types/wallet-daemon-client/TransactionClaimBurnResponse"; -export * from "./types/wallet-daemon-client/TransactionWaitResultRequest"; -export * from "./types/wallet-daemon-client/ClaimValidatorFeesResponse"; +export * from "./types/wallet-daemon-client/AccountGetResponse"; +export * from "./types/wallet-daemon-client/ClaimValidatorFeesRequest"; +export * from "./types/wallet-daemon-client/AuthRevokeTokenResponse"; +export * from "./types/wallet-daemon-client/AccountsInvokeRequest"; +export * from "./types/wallet-daemon-client/WebRtcStart"; +export * from "./types/wallet-daemon-client/TransactionWaitResultResponse"; +export * from "./types/wallet-daemon-client/GetValidatorFeesRequest"; export * from "./types/wallet-daemon-client/ConfidentialCreateOutputProofRequest"; -export * from "./types/wallet-daemon-client/KeysCreateRequest"; +export * from "./types/wallet-daemon-client/KeysCreateResponse"; +export * from "./types/wallet-daemon-client/AuthLoginDenyRequest"; +export * from "./types/wallet-daemon-client/ProofsFinalizeRequest"; +export * from "./types/wallet-daemon-client/ProofsCancelRequest"; export * from "./types/wallet-daemon-client/SettingsGetResponse"; -export * from "./types/wallet-daemon-client/ClaimBurnResponse"; -export * from "./types/wallet-daemon-client/WebRtcStartRequest"; -export * from "./types/wallet-daemon-client/ConfidentialViewVaultBalanceResponse"; -export * from "./types/wallet-daemon-client/WebRtcStart"; -export * from "./types/wallet-daemon-client/AccountSetDefaultRequest"; +export * from "./types/wallet-daemon-client/ConfidentialViewVaultBalanceRequest"; +export * from "./types/wallet-daemon-client/GetValidatorFeesResponse"; +export * from "./types/wallet-daemon-client/TransactionGetResponse"; +export * from "./types/wallet-daemon-client/TransactionSubmitRequest"; +export * from "./types/wallet-daemon-client/ListAccountNftResponse"; +export * from "./types/wallet-daemon-client/AccountsInvokeResponse"; +export * from "./types/wallet-daemon-client/AccountsListRequest"; +export * from "./types/wallet-daemon-client/AuthLoginAcceptResponse"; export * from "./types/wallet-daemon-client/ConfidentialCreateOutputProofResponse"; +export * from "./types/wallet-daemon-client/TemplatesGetRequest"; +export * from "./types/wallet-daemon-client/ConfidentialViewVaultBalanceResponse"; +export * from "./types/wallet-daemon-client/SettingsSetRequest"; +export * from "./types/wallet-daemon-client/MintAccountNftRequest"; +export * from "./types/wallet-daemon-client/TransactionClaimBurnResponse"; +export * from "./types/wallet-daemon-client/AuthGetAllJwtRequest"; +export * from "./types/wallet-daemon-client/ClaimValidatorFeesResponse"; +export * from "./types/wallet-daemon-client/ConfidentialTransferResponse"; export * from "./types/wallet-daemon-client/TemplatesGetResponse"; -export * from "./types/wallet-daemon-client/ListAccountNftResponse"; -export * from "./types/wallet-daemon-client/AccountsGetBalancesRequest"; -export * from "./types/wallet-daemon-client/MintAccountNftResponse"; +export * from "./types/wallet-daemon-client/AccountsTransferRequest"; +export * from "./types/wallet-daemon-client/AuthLoginRequest"; +export * from "./types/wallet-daemon-client/AuthGetAllJwtResponse"; export * from "./types/wallet-daemon-client/AccountsCreateFreeTestCoinsRequest"; -export * from "./types/wallet-daemon-client/KeysCreateResponse"; +export * from "./types/wallet-daemon-client/ConfidentialTransferRequest"; +export * from "./types/wallet-daemon-client/SettingsSetResponse"; +export * from "./types/wallet-daemon-client/AccountsCreateFreeTestCoinsResponse"; +export * from "./types/wallet-daemon-client/AccountGetRequest"; +export * from "./types/wallet-daemon-client/KeysCreateRequest"; +export * from "./types/wallet-daemon-client/ProofsGenerateRequest"; +export * from "./types/wallet-daemon-client/TransactionGetResultResponse"; +export * from "./types/wallet-daemon-client/KeysSetActiveResponse"; +export * from "./types/wallet-daemon-client/AuthLoginDenyResponse"; +export * from "./types/wallet-daemon-client/TransactionGetResultRequest"; +export * from "./types/wallet-daemon-client/AccountsCreateResponse"; +export * from "./types/wallet-daemon-client/AccountsGetBalancesRequest"; export * from "./types/wallet-daemon-client/AccountInfo"; export * from "./types/wallet-daemon-client/SubstatesListRequest"; -export * from "./types/wallet-daemon-client/BalanceEntry"; -export * from "./types/wallet-daemon-client/TemplatesGetRequest"; -export * from "./types/wallet-daemon-client/AccountsInvokeRequest"; -export * from "./types/wallet-daemon-client/ProofsCancelRequest"; -export * from "./types/wallet-daemon-client/AccountSetDefaultResponse"; -export * from "./types/wallet-daemon-client/SubstatesListResponse"; -export * from "./types/wallet-daemon-client/KeysSetActiveResponse"; export * from "./types/wallet-daemon-client/ComponentAddressOrName"; -export * from "./types/wallet-daemon-client/AuthLoginAcceptRequest"; -export * from "./types/wallet-daemon-client/KeysSetActiveRequest"; -export * from "./types/wallet-daemon-client/ConfidentialViewVaultBalanceRequest"; -export * from "./types/wallet-daemon-client/ConfidentialTransferRequest"; -export * from "./types/wallet-daemon-client/AccountsCreateResponse"; -export * from "./types/wallet-daemon-client/TransactionWaitResultResponse"; -export * from "./types/wallet-daemon-client/AccountGetRequest"; diff --git a/bindings/dist/wallet-daemon-client.js b/bindings/dist/wallet-daemon-client.js index 3c54e676a..776d38ec1 100644 --- a/bindings/dist/wallet-daemon-client.js +++ b/bindings/dist/wallet-daemon-client.js @@ -1,89 +1,89 @@ // Copyright 2023 The Tari Project // SPDX-License-Identifier: BSD-3-Clause -export * from "./types/wallet-daemon-client/WalletSubstateRecord"; -export * from "./types/wallet-daemon-client/ProofsFinalizeResponse"; -export * from "./types/wallet-daemon-client/CallInstructionRequest"; -export * from "./types/wallet-daemon-client/AuthLoginAcceptResponse"; -export * from "./types/wallet-daemon-client/AccountsListRequest"; -export * from "./types/wallet-daemon-client/AuthGetAllJwtResponse"; -export * from "./types/wallet-daemon-client/AuthLoginResponse"; -export * from "./types/wallet-daemon-client/GetValidatorFeesRequest"; -export * from "./types/wallet-daemon-client/AccountGetDefaultRequest"; -export * from "./types/wallet-daemon-client/AuthGetAllJwtRequest"; -export * from "./types/wallet-daemon-client/KeyBranch"; -export * from "./types/wallet-daemon-client/AccountGetResponse"; -export * from "./types/wallet-daemon-client/SettingsSetRequest"; -export * from "./types/wallet-daemon-client/GetValidatorFeesResponse"; -export * from "./types/wallet-daemon-client/TransactionGetAllRequest"; +export * from "./types/wallet-daemon-client/AccountsListResponse"; export * from "./types/wallet-daemon-client/RevealFundsRequest"; -export * from "./types/wallet-daemon-client/AuthLoginDenyResponse"; -export * from "./types/wallet-daemon-client/AuthLoginDenyRequest"; -export * from "./types/wallet-daemon-client/TransactionSubmitResponse"; -export * from "./types/wallet-daemon-client/ProofsGenerateResponse"; -export * from "./types/wallet-daemon-client/ClaimValidatorFeesRequest"; -export * from "./types/wallet-daemon-client/AuthLoginRequest"; +export * from "./types/wallet-daemon-client/ClaimBurnResponse"; +export * from "./types/wallet-daemon-client/KeysSetActiveRequest"; +export * from "./types/wallet-daemon-client/WalletSubstateRecord"; +export * from "./types/wallet-daemon-client/AccountsGetBalancesResponse"; +export * from "./types/wallet-daemon-client/SubstatesGetResponse"; export * from "./types/wallet-daemon-client/ListAccountNftRequest"; +export * from "./types/wallet-daemon-client/RevealFundsResponse"; +export * from "./types/wallet-daemon-client/AccountSetDefaultRequest"; +export * from "./types/wallet-daemon-client/GetAccountNftRequest"; +export * from "./types/wallet-daemon-client/TransactionGetAllResponse"; export * from "./types/wallet-daemon-client/TransactionGetRequest"; -export * from "./types/wallet-daemon-client/AuthRevokeTokenResponse"; -export * from "./types/wallet-daemon-client/ProofsFinalizeRequest"; -export * from "./types/wallet-daemon-client/AccountsTransferRequest"; -export * from "./types/wallet-daemon-client/SettingsSetResponse"; -export * from "./types/wallet-daemon-client/KeysListRequest"; +export * from "./types/wallet-daemon-client/KeyBranch"; +export * from "./types/wallet-daemon-client/AuthLoginAcceptRequest"; +export * from "./types/wallet-daemon-client/AccountSetDefaultResponse"; +export * from "./types/wallet-daemon-client/SubstatesListResponse"; +export * from "./types/wallet-daemon-client/AccountGetDefaultRequest"; +export * from "./types/wallet-daemon-client/KeysListResponse"; +export * from "./types/wallet-daemon-client/ProofsGenerateResponse"; +export * from "./types/wallet-daemon-client/TransactionGetAllRequest"; export * from "./types/wallet-daemon-client/AccountsTransferResponse"; -export * from "./types/wallet-daemon-client/TransactionGetResultResponse"; +export * from "./types/wallet-daemon-client/AuthLoginResponse"; export * from "./types/wallet-daemon-client/ClaimBurnRequest"; -export * from "./types/wallet-daemon-client/KeysListResponse"; +export * from "./types/wallet-daemon-client/BalanceEntry"; +export * from "./types/wallet-daemon-client/KeysListRequest"; export * from "./types/wallet-daemon-client/SubstatesGetRequest"; -export * from "./types/wallet-daemon-client/TransactionSubmitRequest"; -export * from "./types/wallet-daemon-client/AccountsGetBalancesResponse"; -export * from "./types/wallet-daemon-client/TransactionGetAllResponse"; -export * from "./types/wallet-daemon-client/AccountsCreateFreeTestCoinsResponse"; -export * from "./types/wallet-daemon-client/ConfidentialTransferResponse"; -export * from "./types/wallet-daemon-client/TransactionGetResponse"; -export * from "./types/wallet-daemon-client/SubstatesGetResponse"; -export * from "./types/wallet-daemon-client/GetAccountNftRequest"; +export * from "./types/wallet-daemon-client/ProofsFinalizeResponse"; export * from "./types/wallet-daemon-client/AuthRevokeTokenRequest"; -export * from "./types/wallet-daemon-client/ProofsGenerateRequest"; -export * from "./types/wallet-daemon-client/RevealFundsResponse"; -export * from "./types/wallet-daemon-client/AccountsInvokeResponse"; -export * from "./types/wallet-daemon-client/AccountsListResponse"; +export * from "./types/wallet-daemon-client/TransactionWaitResultRequest"; +export * from "./types/wallet-daemon-client/TransactionSubmitResponse"; +export * from "./types/wallet-daemon-client/AccountsCreateRequest"; +export * from "./types/wallet-daemon-client/CallInstructionRequest"; +export * from "./types/wallet-daemon-client/WebRtcStartRequest"; export * from "./types/wallet-daemon-client/WebRtcStartResponse"; -export * from "./types/wallet-daemon-client/TransactionGetResultRequest"; +export * from "./types/wallet-daemon-client/MintAccountNftResponse"; export * from "./types/wallet-daemon-client/ProofsCancelResponse"; -export * from "./types/wallet-daemon-client/AccountsCreateRequest"; -export * from "./types/wallet-daemon-client/MintAccountNftRequest"; -export * from "./types/wallet-daemon-client/TransactionClaimBurnResponse"; -export * from "./types/wallet-daemon-client/TransactionWaitResultRequest"; -export * from "./types/wallet-daemon-client/ClaimValidatorFeesResponse"; +export * from "./types/wallet-daemon-client/AccountGetResponse"; +export * from "./types/wallet-daemon-client/ClaimValidatorFeesRequest"; +export * from "./types/wallet-daemon-client/AuthRevokeTokenResponse"; +export * from "./types/wallet-daemon-client/AccountsInvokeRequest"; +export * from "./types/wallet-daemon-client/WebRtcStart"; +export * from "./types/wallet-daemon-client/TransactionWaitResultResponse"; +export * from "./types/wallet-daemon-client/GetValidatorFeesRequest"; export * from "./types/wallet-daemon-client/ConfidentialCreateOutputProofRequest"; -export * from "./types/wallet-daemon-client/KeysCreateRequest"; +export * from "./types/wallet-daemon-client/KeysCreateResponse"; +export * from "./types/wallet-daemon-client/AuthLoginDenyRequest"; +export * from "./types/wallet-daemon-client/ProofsFinalizeRequest"; +export * from "./types/wallet-daemon-client/ProofsCancelRequest"; export * from "./types/wallet-daemon-client/SettingsGetResponse"; -export * from "./types/wallet-daemon-client/ClaimBurnResponse"; -export * from "./types/wallet-daemon-client/WebRtcStartRequest"; -export * from "./types/wallet-daemon-client/ConfidentialViewVaultBalanceResponse"; -export * from "./types/wallet-daemon-client/WebRtcStart"; -export * from "./types/wallet-daemon-client/AccountSetDefaultRequest"; +export * from "./types/wallet-daemon-client/ConfidentialViewVaultBalanceRequest"; +export * from "./types/wallet-daemon-client/GetValidatorFeesResponse"; +export * from "./types/wallet-daemon-client/TransactionGetResponse"; +export * from "./types/wallet-daemon-client/TransactionSubmitRequest"; +export * from "./types/wallet-daemon-client/ListAccountNftResponse"; +export * from "./types/wallet-daemon-client/AccountsInvokeResponse"; +export * from "./types/wallet-daemon-client/AccountsListRequest"; +export * from "./types/wallet-daemon-client/AuthLoginAcceptResponse"; export * from "./types/wallet-daemon-client/ConfidentialCreateOutputProofResponse"; +export * from "./types/wallet-daemon-client/TemplatesGetRequest"; +export * from "./types/wallet-daemon-client/ConfidentialViewVaultBalanceResponse"; +export * from "./types/wallet-daemon-client/SettingsSetRequest"; +export * from "./types/wallet-daemon-client/MintAccountNftRequest"; +export * from "./types/wallet-daemon-client/TransactionClaimBurnResponse"; +export * from "./types/wallet-daemon-client/AuthGetAllJwtRequest"; +export * from "./types/wallet-daemon-client/ClaimValidatorFeesResponse"; +export * from "./types/wallet-daemon-client/ConfidentialTransferResponse"; export * from "./types/wallet-daemon-client/TemplatesGetResponse"; -export * from "./types/wallet-daemon-client/ListAccountNftResponse"; -export * from "./types/wallet-daemon-client/AccountsGetBalancesRequest"; -export * from "./types/wallet-daemon-client/MintAccountNftResponse"; +export * from "./types/wallet-daemon-client/AccountsTransferRequest"; +export * from "./types/wallet-daemon-client/AuthLoginRequest"; +export * from "./types/wallet-daemon-client/AuthGetAllJwtResponse"; export * from "./types/wallet-daemon-client/AccountsCreateFreeTestCoinsRequest"; -export * from "./types/wallet-daemon-client/KeysCreateResponse"; +export * from "./types/wallet-daemon-client/ConfidentialTransferRequest"; +export * from "./types/wallet-daemon-client/SettingsSetResponse"; +export * from "./types/wallet-daemon-client/AccountsCreateFreeTestCoinsResponse"; +export * from "./types/wallet-daemon-client/AccountGetRequest"; +export * from "./types/wallet-daemon-client/KeysCreateRequest"; +export * from "./types/wallet-daemon-client/ProofsGenerateRequest"; +export * from "./types/wallet-daemon-client/TransactionGetResultResponse"; +export * from "./types/wallet-daemon-client/KeysSetActiveResponse"; +export * from "./types/wallet-daemon-client/AuthLoginDenyResponse"; +export * from "./types/wallet-daemon-client/TransactionGetResultRequest"; +export * from "./types/wallet-daemon-client/AccountsCreateResponse"; +export * from "./types/wallet-daemon-client/AccountsGetBalancesRequest"; export * from "./types/wallet-daemon-client/AccountInfo"; export * from "./types/wallet-daemon-client/SubstatesListRequest"; -export * from "./types/wallet-daemon-client/BalanceEntry"; -export * from "./types/wallet-daemon-client/TemplatesGetRequest"; -export * from "./types/wallet-daemon-client/AccountsInvokeRequest"; -export * from "./types/wallet-daemon-client/ProofsCancelRequest"; -export * from "./types/wallet-daemon-client/AccountSetDefaultResponse"; -export * from "./types/wallet-daemon-client/SubstatesListResponse"; -export * from "./types/wallet-daemon-client/KeysSetActiveResponse"; export * from "./types/wallet-daemon-client/ComponentAddressOrName"; -export * from "./types/wallet-daemon-client/AuthLoginAcceptRequest"; -export * from "./types/wallet-daemon-client/KeysSetActiveRequest"; -export * from "./types/wallet-daemon-client/ConfidentialViewVaultBalanceRequest"; -export * from "./types/wallet-daemon-client/ConfidentialTransferRequest"; -export * from "./types/wallet-daemon-client/AccountsCreateResponse"; -export * from "./types/wallet-daemon-client/TransactionWaitResultResponse"; -export * from "./types/wallet-daemon-client/AccountGetRequest"; diff --git a/bindings/src/index.ts b/bindings/src/index.ts index 20589d274..453d48483 100644 --- a/bindings/src/index.ts +++ b/bindings/src/index.ts @@ -4,24 +4,24 @@ export * from "./types/AccessRule"; export * from "./types/Account"; export * from "./types/Amount"; -export * from "./types/ArgDef"; export * from "./types/Arg"; +export * from "./types/ArgDef"; export * from "./types/AuthHook"; export * from "./types/Block"; export * from "./types/BucketId"; export * from "./types/Claims"; export * from "./types/Command"; +export * from "./types/Committee"; export * from "./types/CommitteeInfo"; export * from "./types/CommitteeShardInfo"; -export * from "./types/Committee"; export * from "./types/ComponentAccessRules"; export * from "./types/ComponentAddress"; export * from "./types/ComponentBody"; export * from "./types/ComponentHeader"; export * from "./types/ComponentKey"; export * from "./types/ConfidentialClaim"; -export * from "./types/ConfidentialOutputStatement"; export * from "./types/ConfidentialOutput"; +export * from "./types/ConfidentialOutputStatement"; export * from "./types/ConfidentialStatement"; export * from "./types/ConfidentialTransferInputSelection"; export * from "./types/ConfidentialWithdrawProof"; @@ -31,11 +31,12 @@ export * from "./types/EntityId"; export * from "./types/Epoch"; export * from "./types/Event"; export * from "./types/Evidence"; -export * from "./types/ExecutedTransaction"; export * from "./types/ExecuteResult"; +export * from "./types/ExecutedTransaction"; +export * from "./types/ExtraData"; export * from "./types/FeeBreakdown"; -export * from "./types/FeeClaimAddress"; export * from "./types/FeeClaim"; +export * from "./types/FeeClaimAddress"; export * from "./types/FeeCostBreakdown"; export * from "./types/FeeReceipt"; export * from "./types/FeeSource"; @@ -44,10 +45,10 @@ export * from "./types/ForeignProposalAtom"; export * from "./types/FunctionDef"; export * from "./types/IndexedValue"; export * from "./types/IndexedWellKnownTypes"; -export * from "./types/InstructionResult"; export * from "./types/Instruction"; -export * from "./types/JrpcPermissions"; +export * from "./types/InstructionResult"; export * from "./types/JrpcPermission"; +export * from "./types/JrpcPermissions"; export * from "./types/LeaderFee"; export * from "./types/LockFlag"; export * from "./types/LogEntry"; @@ -56,14 +57,14 @@ export * from "./types/Metadata"; export * from "./types/MintConfidentialOutputAtom"; export * from "./types/NetworkCommitteeInfo"; export * from "./types/NodeHeight"; -export * from "./types/NonFungibleAddressContents"; +export * from "./types/NonFungible"; export * from "./types/NonFungibleAddress"; +export * from "./types/NonFungibleAddressContents"; export * from "./types/NonFungibleContainer"; export * from "./types/NonFungibleId"; -export * from "./types/NonFungibleIndexAddress"; export * from "./types/NonFungibleIndex"; +export * from "./types/NonFungibleIndexAddress"; export * from "./types/NonFungibleToken"; -export * from "./types/NonFungible"; export * from "./types/NumPreshards"; export * from "./types/Ordering"; export * from "./types/OwnerRule"; @@ -73,47 +74,47 @@ export * from "./types/QuorumCertificate"; export * from "./types/QuorumDecision"; export * from "./types/RejectReason"; export * from "./types/RequireRule"; +export * from "./types/Resource"; export * from "./types/ResourceAccessRules"; export * from "./types/ResourceAddress"; export * from "./types/ResourceContainer"; -export * from "./types/Resource"; export * from "./types/ResourceType"; export * from "./types/RestrictedAccessRule"; export * from "./types/RuleRequirement"; +export * from "./types/Shard"; export * from "./types/ShardEvidence"; export * from "./types/ShardGroup"; -export * from "./types/Shard"; +export * from "./types/Substate"; export * from "./types/SubstateAddress"; export * from "./types/SubstateDestroyed"; export * from "./types/SubstateDiff"; export * from "./types/SubstateId"; export * from "./types/SubstateLockType"; export * from "./types/SubstateRecord"; -export * from "./types/SubstateRequirementLockIntent"; export * from "./types/SubstateRequirement"; -export * from "./types/Substate"; +export * from "./types/SubstateRequirementLockIntent"; export * from "./types/SubstateType"; export * from "./types/SubstateValue"; export * from "./types/TemplateDef"; export * from "./types/TemplateDefV1"; +export * from "./types/Transaction"; export * from "./types/TransactionAtom"; export * from "./types/TransactionPoolRecord"; export * from "./types/TransactionPoolStage"; -export * from "./types/TransactionReceiptAddress"; export * from "./types/TransactionReceipt"; +export * from "./types/TransactionReceiptAddress"; export * from "./types/TransactionResult"; export * from "./types/TransactionSignature"; export * from "./types/TransactionStatus"; -export * from "./types/Transaction"; export * from "./types/Type"; -export * from "./types/UnclaimedConfidentialOutputAddress"; export * from "./types/UnclaimedConfidentialOutput"; +export * from "./types/UnclaimedConfidentialOutputAddress"; export * from "./types/UnsignedTransaction"; export * from "./types/ValidatorSignature"; -export * from "./types/VaultId"; export * from "./types/Vault"; -export * from "./types/VersionedSubstateIdLockIntent"; +export * from "./types/VaultId"; export * from "./types/VersionedSubstateId"; +export * from "./types/VersionedSubstateIdLockIntent"; export * from "./types/ViewableBalanceProof"; export * from "./base-node-client"; export * from "./tari-indexer-client"; diff --git a/bindings/src/tari-indexer-client.ts b/bindings/src/tari-indexer-client.ts index 9d60c9416..e9782093f 100644 --- a/bindings/src/tari-indexer-client.ts +++ b/bindings/src/tari-indexer-client.ts @@ -1,37 +1,37 @@ // Copyright 2023 The Tari Project // SPDX-License-Identifier: BSD-3-Clause -export * from "./types/tari-indexer-client/IndexerSubmitTransactionResponse"; +export * from "./types/tari-indexer-client/IndexerGetEpochManagerStatsResponse"; +export * from "./types/tari-indexer-client/IndexerAddPeerRequest"; +export * from "./types/tari-indexer-client/NonFungibleSubstate"; +export * from "./types/tari-indexer-client/GetNonFungibleCountResponse"; +export * from "./types/tari-indexer-client/ListSubstatesRequest"; +export * from "./types/tari-indexer-client/IndexerGetIdentityResponse"; export * from "./types/tari-indexer-client/GetTemplateDefinitionRequest"; -export * from "./types/tari-indexer-client/ListSubstatesResponse"; -export * from "./types/tari-indexer-client/IndexerAddPeerResponse"; -export * from "./types/tari-indexer-client/InspectSubstateRequest"; -export * from "./types/tari-indexer-client/ListSubstateItem"; +export * from "./types/tari-indexer-client/IndexerGetSubstateRequest"; +export * from "./types/tari-indexer-client/GetTemplateDefinitionResponse"; +export * from "./types/tari-indexer-client/ListTemplatesRequest"; export * from "./types/tari-indexer-client/IndexerGetAllVnsResponse"; -export * from "./types/tari-indexer-client/ListSubstatesRequest"; -export * from "./types/tari-indexer-client/GetRelatedTransactionsResponse"; -export * from "./types/tari-indexer-client/IndexerTransactionFinalizedResult"; +export * from "./types/tari-indexer-client/GetNonFungiblesRequest"; export * from "./types/tari-indexer-client/IndexerGetSubstateResponse"; +export * from "./types/tari-indexer-client/IndexerSubmitTransactionRequest"; +export * from "./types/tari-indexer-client/IndexerConnection"; +export * from "./types/tari-indexer-client/InspectSubstateResponse"; export * from "./types/tari-indexer-client/IndexerGetAllVnsRequest"; +export * from "./types/tari-indexer-client/InspectSubstateRequest"; export * from "./types/tari-indexer-client/IndexerGetCommsStatsResponse"; -export * from "./types/tari-indexer-client/IndexerConnection"; -export * from "./types/tari-indexer-client/GetNonFungiblesRequest"; -export * from "./types/tari-indexer-client/IndexerAddPeerRequest"; -export * from "./types/tari-indexer-client/GetRelatedTransactionsRequest"; -export * from "./types/tari-indexer-client/GetNonFungiblesResponse"; -export * from "./types/tari-indexer-client/GetTemplateDefinitionResponse"; +export * from "./types/tari-indexer-client/GetNonFungibleCountRequest"; +export * from "./types/tari-indexer-client/GetRelatedTransactionsResponse"; +export * from "./types/tari-indexer-client/IndexerAddPeerResponse"; export * from "./types/tari-indexer-client/IndexerGetConnectionsResponse"; -export * from "./types/tari-indexer-client/IndexerSubmitTransactionRequest"; +export * from "./types/tari-indexer-client/GetNonFungiblesResponse"; +export * from "./types/tari-indexer-client/GetRelatedTransactionsRequest"; +export * from "./types/tari-indexer-client/IndexerGetTransactionResultResponse"; export * from "./types/tari-indexer-client/ListTemplatesResponse"; -export * from "./types/tari-indexer-client/InspectSubstateResponse"; +export * from "./types/tari-indexer-client/IndexerGetTransactionResultRequest"; +export * from "./types/tari-indexer-client/ListSubstatesResponse"; +export * from "./types/tari-indexer-client/IndexerTransactionFinalizedResult"; export * from "./types/tari-indexer-client/GetNonFungibleCollectionsResponse"; -export * from "./types/tari-indexer-client/IndexerGetSubstateRequest"; -export * from "./types/tari-indexer-client/IndexerGetEpochManagerStatsResponse"; -export * from "./types/tari-indexer-client/NonFungibleSubstate"; -export * from "./types/tari-indexer-client/GetNonFungibleCountResponse"; -export * from "./types/tari-indexer-client/ListTemplatesRequest"; -export * from "./types/tari-indexer-client/IndexerGetTransactionResultResponse"; +export * from "./types/tari-indexer-client/IndexerSubmitTransactionResponse"; export * from "./types/tari-indexer-client/IndexerConnectionDirection"; -export * from "./types/tari-indexer-client/IndexerGetIdentityResponse"; -export * from "./types/tari-indexer-client/IndexerGetTransactionResultRequest"; -export * from "./types/tari-indexer-client/GetNonFungibleCountRequest"; +export * from "./types/tari-indexer-client/ListSubstateItem"; diff --git a/bindings/src/types/Block.ts b/bindings/src/types/Block.ts index 9495e6faa..ef612eb0a 100644 --- a/bindings/src/types/Block.ts +++ b/bindings/src/types/Block.ts @@ -1,6 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Command } from "./Command"; import type { Epoch } from "./Epoch"; +import type { ExtraData } from "./ExtraData"; import type { NodeHeight } from "./NodeHeight"; import type { QuorumCertificate } from "./QuorumCertificate"; import type { Shard } from "./Shard"; @@ -28,4 +29,5 @@ export interface Block { timestamp: number; base_layer_block_height: number; base_layer_block_hash: string; + extra_data: ExtraData | null; } diff --git a/bindings/src/types/ExtraData.ts b/bindings/src/types/ExtraData.ts new file mode 100644 index 000000000..7854af3ab --- /dev/null +++ b/bindings/src/types/ExtraData.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ExtraData = string; diff --git a/bindings/src/validator-node-client.ts b/bindings/src/validator-node-client.ts index 37a2d665c..989140390 100644 --- a/bindings/src/validator-node-client.ts +++ b/bindings/src/validator-node-client.ts @@ -1,59 +1,59 @@ // Copyright 2023 The Tari Project // SPDX-License-Identifier: BSD-3-Clause +export * from "./types/validator-node-client/GetCommitteeRequest"; +export * from "./types/validator-node-client/GetRecentTransactionsResponse"; +export * from "./types/validator-node-client/GetRecentTransactionsRequest"; +export * from "./types/validator-node-client/GetTemplatesRequest"; +export * from "./types/validator-node-client/GetBlocksCountResponse"; +export * from "./types/validator-node-client/VNAddPeerRequest"; +export * from "./types/validator-node-client/GetCommitteeResponse"; export * from "./types/validator-node-client/VNSubmitTransactionRequest"; +export * from "./types/validator-node-client/VNConnectionDirection"; +export * from "./types/validator-node-client/VNAddPeerResponse"; +export * from "./types/validator-node-client/GetSubstatesByTransactionResponse"; +export * from "./types/validator-node-client/VNCommitteeShardInfo"; +export * from "./types/validator-node-client/VNFunctionDef"; +export * from "./types/validator-node-client/VNGetValidatorFeesResponse"; +export * from "./types/validator-node-client/VNGetAllVnsResponse"; +export * from "./types/validator-node-client/TemplateAbi"; +export * from "./types/validator-node-client/GetMempoolStatsResponse"; export * from "./types/validator-node-client/TemplateMetadata"; -export * from "./types/validator-node-client/GetFilteredBlocksCountRequest"; +export * from "./types/validator-node-client/GetBlockResponse"; +export * from "./types/validator-node-client/VNLogLevel"; +export * from "./types/validator-node-client/VNGetAllVnsRequest"; export * from "./types/validator-node-client/VNLogEntry"; export * from "./types/validator-node-client/GetShardKeyRequest"; -export * from "./types/validator-node-client/VNGetTransactionResultResponse"; +export * from "./types/validator-node-client/GetBlockRequest"; export * from "./types/validator-node-client/VNSubmitTransactionResponse"; +export * from "./types/validator-node-client/DryRunTransactionFinalizeResult"; +export * from "./types/validator-node-client/GetTransactionResponse"; +export * from "./types/validator-node-client/GetStateResponse"; +export * from "./types/validator-node-client/VNGetSubstateRequest"; +export * from "./types/validator-node-client/VNGetSubstateResponse"; +export * from "./types/validator-node-client/ListBlocksResponse"; +export * from "./types/validator-node-client/SubstateStatus"; +export * from "./types/validator-node-client/ValidatorNode"; +export * from "./types/validator-node-client/GetFilteredBlocksCountRequest"; +export * from "./types/validator-node-client/ListBlocksRequest"; +export * from "./types/validator-node-client/GetEpochManagerStatsResponse"; export * from "./types/validator-node-client/GetTxPoolResponse"; +export * from "./types/validator-node-client/VNConnection"; export * from "./types/validator-node-client/GetTemplateResponse"; -export * from "./types/validator-node-client/GetBlocksCountResponse"; -export * from "./types/validator-node-client/VNGetValidatorFeesRequest"; -export * from "./types/validator-node-client/GetSubstatesByTransactionResponse"; -export * from "./types/validator-node-client/VNConnectionDirection"; -export * from "./types/validator-node-client/VNAddPeerRequest"; -export * from "./types/validator-node-client/GetTemplatesResponse"; -export * from "./types/validator-node-client/GetTransactionRequest"; +export * from "./types/validator-node-client/ValidatorFee"; +export * from "./types/validator-node-client/VNGetConnectionsResponse"; +export * from "./types/validator-node-client/VNGetCommsStatsResponse"; +export * from "./types/validator-node-client/GetTemplateRequest"; export * from "./types/validator-node-client/GetStateRequest"; -export * from "./types/validator-node-client/VNGetIdentityResponse"; -export * from "./types/validator-node-client/VNFunctionDef"; export * from "./types/validator-node-client/GetBlocksRequest"; -export * from "./types/validator-node-client/GetTemplateRequest"; +export * from "./types/validator-node-client/VNGetTransactionResultRequest"; +export * from "./types/validator-node-client/GetTransactionRequest"; +export * from "./types/validator-node-client/GetTemplatesResponse"; +export * from "./types/validator-node-client/VNGetTransactionResultResponse"; +export * from "./types/validator-node-client/VNArgDef"; export * from "./types/validator-node-client/GetShardKeyResponse"; -export * from "./types/validator-node-client/GetSubstatesByTransactionRequest"; -export * from "./types/validator-node-client/VNGetCommsStatsResponse"; -export * from "./types/validator-node-client/GetTransactionResponse"; -export * from "./types/validator-node-client/GetCommitteeResponse"; -export * from "./types/validator-node-client/VNGetAllVnsRequest"; -export * from "./types/validator-node-client/GetCommitteeRequest"; -export * from "./types/validator-node-client/DryRunTransactionFinalizeResult"; -export * from "./types/validator-node-client/VNGetValidatorFeesResponse"; -export * from "./types/validator-node-client/GetStateResponse"; -export * from "./types/validator-node-client/SubstateStatus"; export * from "./types/validator-node-client/GetBlocksResponse"; -export * from "./types/validator-node-client/ListBlocksResponse"; -export * from "./types/validator-node-client/GetBlockRequest"; -export * from "./types/validator-node-client/VNGetTransactionResultRequest"; -export * from "./types/validator-node-client/GetRecentTransactionsRequest"; -export * from "./types/validator-node-client/ValidatorFee"; -export * from "./types/validator-node-client/VNLogLevel"; -export * from "./types/validator-node-client/GetRecentTransactionsResponse"; -export * from "./types/validator-node-client/VNAddPeerResponse"; -export * from "./types/validator-node-client/VNConnection"; -export * from "./types/validator-node-client/ValidatorNode"; -export * from "./types/validator-node-client/VNGetConnectionsResponse"; -export * from "./types/validator-node-client/ListBlocksRequest"; +export * from "./types/validator-node-client/VNGetIdentityResponse"; +export * from "./types/validator-node-client/GetSubstatesByTransactionRequest"; export * from "./types/validator-node-client/GetNetworkCommitteeResponse"; -export * from "./types/validator-node-client/VNGetSubstateRequest"; -export * from "./types/validator-node-client/GetMempoolStatsResponse"; -export * from "./types/validator-node-client/TemplateAbi"; -export * from "./types/validator-node-client/GetTemplatesRequest"; -export * from "./types/validator-node-client/VNGetSubstateResponse"; -export * from "./types/validator-node-client/VNGetAllVnsResponse"; -export * from "./types/validator-node-client/VNArgDef"; -export * from "./types/validator-node-client/GetEpochManagerStatsResponse"; -export * from "./types/validator-node-client/GetBlockResponse"; -export * from "./types/validator-node-client/VNCommitteeShardInfo"; +export * from "./types/validator-node-client/VNGetValidatorFeesRequest"; diff --git a/bindings/src/wallet-daemon-client.ts b/bindings/src/wallet-daemon-client.ts index 140f65141..d23e8f6cd 100644 --- a/bindings/src/wallet-daemon-client.ts +++ b/bindings/src/wallet-daemon-client.ts @@ -1,90 +1,90 @@ // Copyright 2023 The Tari Project // SPDX-License-Identifier: BSD-3-Clause -export * from "./types/wallet-daemon-client/WalletSubstateRecord"; -export * from "./types/wallet-daemon-client/ProofsFinalizeResponse"; -export * from "./types/wallet-daemon-client/CallInstructionRequest"; -export * from "./types/wallet-daemon-client/AuthLoginAcceptResponse"; -export * from "./types/wallet-daemon-client/AccountsListRequest"; -export * from "./types/wallet-daemon-client/AuthGetAllJwtResponse"; -export * from "./types/wallet-daemon-client/AuthLoginResponse"; -export * from "./types/wallet-daemon-client/GetValidatorFeesRequest"; -export * from "./types/wallet-daemon-client/AccountGetDefaultRequest"; -export * from "./types/wallet-daemon-client/AuthGetAllJwtRequest"; -export * from "./types/wallet-daemon-client/KeyBranch"; -export * from "./types/wallet-daemon-client/AccountGetResponse"; -export * from "./types/wallet-daemon-client/SettingsSetRequest"; -export * from "./types/wallet-daemon-client/GetValidatorFeesResponse"; -export * from "./types/wallet-daemon-client/TransactionGetAllRequest"; +export * from "./types/wallet-daemon-client/AccountsListResponse"; export * from "./types/wallet-daemon-client/RevealFundsRequest"; -export * from "./types/wallet-daemon-client/AuthLoginDenyResponse"; -export * from "./types/wallet-daemon-client/AuthLoginDenyRequest"; -export * from "./types/wallet-daemon-client/TransactionSubmitResponse"; -export * from "./types/wallet-daemon-client/ProofsGenerateResponse"; -export * from "./types/wallet-daemon-client/ClaimValidatorFeesRequest"; -export * from "./types/wallet-daemon-client/AuthLoginRequest"; +export * from "./types/wallet-daemon-client/ClaimBurnResponse"; +export * from "./types/wallet-daemon-client/KeysSetActiveRequest"; +export * from "./types/wallet-daemon-client/WalletSubstateRecord"; +export * from "./types/wallet-daemon-client/AccountsGetBalancesResponse"; +export * from "./types/wallet-daemon-client/SubstatesGetResponse"; export * from "./types/wallet-daemon-client/ListAccountNftRequest"; +export * from "./types/wallet-daemon-client/RevealFundsResponse"; +export * from "./types/wallet-daemon-client/AccountSetDefaultRequest"; +export * from "./types/wallet-daemon-client/GetAccountNftRequest"; +export * from "./types/wallet-daemon-client/TransactionGetAllResponse"; export * from "./types/wallet-daemon-client/TransactionGetRequest"; -export * from "./types/wallet-daemon-client/AuthRevokeTokenResponse"; -export * from "./types/wallet-daemon-client/ProofsFinalizeRequest"; -export * from "./types/wallet-daemon-client/AccountsTransferRequest"; -export * from "./types/wallet-daemon-client/SettingsSetResponse"; -export * from "./types/wallet-daemon-client/KeysListRequest"; +export * from "./types/wallet-daemon-client/KeyBranch"; +export * from "./types/wallet-daemon-client/AuthLoginAcceptRequest"; +export * from "./types/wallet-daemon-client/AccountSetDefaultResponse"; +export * from "./types/wallet-daemon-client/SubstatesListResponse"; +export * from "./types/wallet-daemon-client/AccountGetDefaultRequest"; +export * from "./types/wallet-daemon-client/KeysListResponse"; +export * from "./types/wallet-daemon-client/ProofsGenerateResponse"; +export * from "./types/wallet-daemon-client/TransactionGetAllRequest"; export * from "./types/wallet-daemon-client/AccountsTransferResponse"; -export * from "./types/wallet-daemon-client/TransactionGetResultResponse"; +export * from "./types/wallet-daemon-client/AuthLoginResponse"; export * from "./types/wallet-daemon-client/ClaimBurnRequest"; -export * from "./types/wallet-daemon-client/KeysListResponse"; +export * from "./types/wallet-daemon-client/BalanceEntry"; +export * from "./types/wallet-daemon-client/KeysListRequest"; export * from "./types/wallet-daemon-client/SubstatesGetRequest"; -export * from "./types/wallet-daemon-client/TransactionSubmitRequest"; -export * from "./types/wallet-daemon-client/AccountsGetBalancesResponse"; -export * from "./types/wallet-daemon-client/TransactionGetAllResponse"; -export * from "./types/wallet-daemon-client/AccountsCreateFreeTestCoinsResponse"; -export * from "./types/wallet-daemon-client/ConfidentialTransferResponse"; -export * from "./types/wallet-daemon-client/TransactionGetResponse"; -export * from "./types/wallet-daemon-client/SubstatesGetResponse"; -export * from "./types/wallet-daemon-client/GetAccountNftRequest"; +export * from "./types/wallet-daemon-client/ProofsFinalizeResponse"; export * from "./types/wallet-daemon-client/AuthRevokeTokenRequest"; -export * from "./types/wallet-daemon-client/ProofsGenerateRequest"; -export * from "./types/wallet-daemon-client/RevealFundsResponse"; -export * from "./types/wallet-daemon-client/AccountsInvokeResponse"; -export * from "./types/wallet-daemon-client/AccountsListResponse"; +export * from "./types/wallet-daemon-client/TransactionWaitResultRequest"; +export * from "./types/wallet-daemon-client/TransactionSubmitResponse"; +export * from "./types/wallet-daemon-client/AccountsCreateRequest"; +export * from "./types/wallet-daemon-client/CallInstructionRequest"; +export * from "./types/wallet-daemon-client/WebRtcStartRequest"; export * from "./types/wallet-daemon-client/WebRtcStartResponse"; -export * from "./types/wallet-daemon-client/TransactionGetResultRequest"; +export * from "./types/wallet-daemon-client/MintAccountNftResponse"; export * from "./types/wallet-daemon-client/ProofsCancelResponse"; -export * from "./types/wallet-daemon-client/AccountsCreateRequest"; -export * from "./types/wallet-daemon-client/MintAccountNftRequest"; -export * from "./types/wallet-daemon-client/TransactionClaimBurnResponse"; -export * from "./types/wallet-daemon-client/TransactionWaitResultRequest"; -export * from "./types/wallet-daemon-client/ClaimValidatorFeesResponse"; +export * from "./types/wallet-daemon-client/AccountGetResponse"; +export * from "./types/wallet-daemon-client/ClaimValidatorFeesRequest"; +export * from "./types/wallet-daemon-client/AuthRevokeTokenResponse"; +export * from "./types/wallet-daemon-client/AccountsInvokeRequest"; +export * from "./types/wallet-daemon-client/WebRtcStart"; +export * from "./types/wallet-daemon-client/TransactionWaitResultResponse"; +export * from "./types/wallet-daemon-client/GetValidatorFeesRequest"; export * from "./types/wallet-daemon-client/ConfidentialCreateOutputProofRequest"; -export * from "./types/wallet-daemon-client/KeysCreateRequest"; +export * from "./types/wallet-daemon-client/KeysCreateResponse"; +export * from "./types/wallet-daemon-client/AuthLoginDenyRequest"; +export * from "./types/wallet-daemon-client/ProofsFinalizeRequest"; +export * from "./types/wallet-daemon-client/ProofsCancelRequest"; export * from "./types/wallet-daemon-client/SettingsGetResponse"; -export * from "./types/wallet-daemon-client/ClaimBurnResponse"; -export * from "./types/wallet-daemon-client/WebRtcStartRequest"; -export * from "./types/wallet-daemon-client/ConfidentialViewVaultBalanceResponse"; -export * from "./types/wallet-daemon-client/WebRtcStart"; -export * from "./types/wallet-daemon-client/AccountSetDefaultRequest"; +export * from "./types/wallet-daemon-client/ConfidentialViewVaultBalanceRequest"; +export * from "./types/wallet-daemon-client/GetValidatorFeesResponse"; +export * from "./types/wallet-daemon-client/TransactionGetResponse"; +export * from "./types/wallet-daemon-client/TransactionSubmitRequest"; +export * from "./types/wallet-daemon-client/ListAccountNftResponse"; +export * from "./types/wallet-daemon-client/AccountsInvokeResponse"; +export * from "./types/wallet-daemon-client/AccountsListRequest"; +export * from "./types/wallet-daemon-client/AuthLoginAcceptResponse"; export * from "./types/wallet-daemon-client/ConfidentialCreateOutputProofResponse"; +export * from "./types/wallet-daemon-client/TemplatesGetRequest"; +export * from "./types/wallet-daemon-client/ConfidentialViewVaultBalanceResponse"; +export * from "./types/wallet-daemon-client/SettingsSetRequest"; +export * from "./types/wallet-daemon-client/MintAccountNftRequest"; +export * from "./types/wallet-daemon-client/TransactionClaimBurnResponse"; +export * from "./types/wallet-daemon-client/AuthGetAllJwtRequest"; +export * from "./types/wallet-daemon-client/ClaimValidatorFeesResponse"; +export * from "./types/wallet-daemon-client/ConfidentialTransferResponse"; export * from "./types/wallet-daemon-client/TemplatesGetResponse"; -export * from "./types/wallet-daemon-client/ListAccountNftResponse"; -export * from "./types/wallet-daemon-client/AccountsGetBalancesRequest"; -export * from "./types/wallet-daemon-client/MintAccountNftResponse"; +export * from "./types/wallet-daemon-client/AccountsTransferRequest"; +export * from "./types/wallet-daemon-client/AuthLoginRequest"; +export * from "./types/wallet-daemon-client/AuthGetAllJwtResponse"; export * from "./types/wallet-daemon-client/AccountsCreateFreeTestCoinsRequest"; -export * from "./types/wallet-daemon-client/KeysCreateResponse"; +export * from "./types/wallet-daemon-client/ConfidentialTransferRequest"; +export * from "./types/wallet-daemon-client/SettingsSetResponse"; +export * from "./types/wallet-daemon-client/AccountsCreateFreeTestCoinsResponse"; +export * from "./types/wallet-daemon-client/AccountGetRequest"; +export * from "./types/wallet-daemon-client/KeysCreateRequest"; +export * from "./types/wallet-daemon-client/ProofsGenerateRequest"; +export * from "./types/wallet-daemon-client/TransactionGetResultResponse"; +export * from "./types/wallet-daemon-client/KeysSetActiveResponse"; +export * from "./types/wallet-daemon-client/AuthLoginDenyResponse"; +export * from "./types/wallet-daemon-client/TransactionGetResultRequest"; +export * from "./types/wallet-daemon-client/AccountsCreateResponse"; +export * from "./types/wallet-daemon-client/AccountsGetBalancesRequest"; export * from "./types/wallet-daemon-client/AccountInfo"; export * from "./types/wallet-daemon-client/SubstatesListRequest"; -export * from "./types/wallet-daemon-client/BalanceEntry"; -export * from "./types/wallet-daemon-client/TemplatesGetRequest"; -export * from "./types/wallet-daemon-client/AccountsInvokeRequest"; -export * from "./types/wallet-daemon-client/ProofsCancelRequest"; -export * from "./types/wallet-daemon-client/AccountSetDefaultResponse"; -export * from "./types/wallet-daemon-client/SubstatesListResponse"; -export * from "./types/wallet-daemon-client/KeysSetActiveResponse"; export * from "./types/wallet-daemon-client/ComponentAddressOrName"; -export * from "./types/wallet-daemon-client/AuthLoginAcceptRequest"; -export * from "./types/wallet-daemon-client/KeysSetActiveRequest"; -export * from "./types/wallet-daemon-client/ConfidentialViewVaultBalanceRequest"; -export * from "./types/wallet-daemon-client/ConfidentialTransferRequest"; -export * from "./types/wallet-daemon-client/AccountsCreateResponse"; -export * from "./types/wallet-daemon-client/TransactionWaitResultResponse"; -export * from "./types/wallet-daemon-client/AccountGetRequest"; diff --git a/dan_layer/common_types/src/bytes.rs b/dan_layer/common_types/src/bytes.rs new file mode 100644 index 000000000..e6e5b374b --- /dev/null +++ b/dan_layer/common_types/src/bytes.rs @@ -0,0 +1,94 @@ +// Copyright 2024, The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +use std::{cmp, convert::TryFrom, ops::Deref}; + +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Default, Deserialize, Serialize)] +pub struct MaxSizeBytes { + inner: Vec, +} + +impl MaxSizeBytes { + pub fn into_vec(self) -> Vec { + self.inner + } + + pub fn from_bytes_checked>(bytes: T) -> Option { + let b = bytes.as_ref(); + if b.len() > MAX { + None + } else { + Some(Self { inner: b.to_vec() }) + } + } + + pub fn from_bytes_truncate>(bytes: T) -> Self { + let b = bytes.as_ref(); + let len = cmp::min(b.len(), MAX); + Self { + inner: b[..len].to_vec(), + } + } +} + +impl From> for Vec { + fn from(value: MaxSizeBytes) -> Self { + value.inner + } +} + +impl TryFrom> for MaxSizeBytes { + type Error = MaxSizeBytesError; + + fn try_from(value: Vec) -> Result { + if value.len() > MAX { + Err(MaxSizeBytesError::MaxSizeBytesLengthError { + expected: MAX, + actual: value.len(), + }) + } else { + Ok(MaxSizeBytes { inner: value }) + } + } +} + +impl AsRef<[u8]> for MaxSizeBytes { + fn as_ref(&self) -> &[u8] { + &self.inner + } +} + +impl Deref for MaxSizeBytes { + type Target = [u8]; + + fn deref(&self) -> &Self::Target { + &self.inner + } +} + +#[derive(Debug, thiserror::Error)] +pub enum MaxSizeBytesError { + #[error("Invalid Bytes length: expected {expected}, got {actual}")] + MaxSizeBytesLengthError { expected: usize, actual: usize }, +} diff --git a/dan_layer/common_types/src/extra_data.rs b/dan_layer/common_types/src/extra_data.rs new file mode 100644 index 000000000..9afe71bec --- /dev/null +++ b/dan_layer/common_types/src/extra_data.rs @@ -0,0 +1,69 @@ +// Copyright 2024. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +use std::collections::BTreeMap; + +use serde::{Deserialize, Serialize}; +use tari_crypto::{ristretto::RistrettoPublicKey, tari_utilities::ByteArray}; +#[cfg(feature = "ts")] +use ts_rs::TS; + +use crate::{MaxSizeBytes, MaxSizeBytesError}; + +const MAX_DATA_SIZE: usize = 256; +type ExtraFieldValue = MaxSizeBytes; + +#[repr(u8)] +#[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Serialize, Deserialize)] +pub enum ExtraFieldKey { + SidechainId = 0x00, +} + +#[derive(Clone, Debug, Deserialize, Serialize)] +#[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] +pub struct ExtraData(#[cfg_attr(feature = "ts", ts(type = "string"))] BTreeMap); + +impl ExtraData { + pub const fn new() -> Self { + Self(BTreeMap::new()) + } + + pub fn insert>(&mut self, key: ExtraFieldKey, value: V) -> &mut Self { + let value = value.into(); + self.0.insert(key, value); + self + } + + pub fn insert_sidechain_id(&mut self, sidechain_id: RistrettoPublicKey) -> Result<&mut Self, MaxSizeBytesError> { + self.0 + .insert(ExtraFieldKey::SidechainId, sidechain_id.as_bytes().to_vec().try_into()?); + Ok(self) + } + + pub fn get(&self, key: &ExtraFieldKey) -> Option<&ExtraFieldValue> { + self.0.get(key) + } + + pub fn contains_key(&self, key: &ExtraFieldKey) -> bool { + self.0.contains_key(key) + } +} diff --git a/dan_layer/common_types/src/lib.rs b/dan_layer/common_types/src/lib.rs index 688249ba0..2437144a6 100644 --- a/dan_layer/common_types/src/lib.rs +++ b/dan_layer/common_types/src/lib.rs @@ -1,12 +1,18 @@ // Copyright 2022 The Tari Project // SPDX-License-Identifier: BSD-3-Clause +mod bytes; +pub use bytes::{MaxSizeBytes, MaxSizeBytesError}; + pub mod crypto; mod epoch; pub use epoch::Epoch; +mod extra_data; +pub use extra_data::{ExtraData, ExtraFieldKey}; + pub mod committee; pub mod hasher; pub mod hashing; diff --git a/dan_layer/consensus/src/block_validations.rs b/dan_layer/consensus/src/block_validations.rs index 88ea5f1ac..506682bb9 100644 --- a/dan_layer/consensus/src/block_validations.rs +++ b/dan_layer/consensus/src/block_validations.rs @@ -2,7 +2,8 @@ // SPDX-License-Identifier: BSD-3-Clause use tari_common::configuration::Network; -use tari_dan_common_types::{committee::Committee, DerivableFromPublicKey}; +use tari_crypto::{ristretto::RistrettoPublicKey, tari_utilities::ByteArray}; +use tari_dan_common_types::{committee::Committee, DerivableFromPublicKey, ExtraFieldKey}; use tari_dan_storage::consensus_models::Block; use tari_epoch_manager::EpochManagerReader; @@ -23,6 +24,7 @@ pub async fn check_proposal( // tip. Without this, the check has a race condition between the base layer scanner and consensus. // check_base_layer_block_hash::(block, epoch_manager, config).await?; check_network(block, config.network)?; + check_sidechain_id(block, config)?; check_hash_and_height(block)?; let committee_for_block = epoch_manager .get_committee_by_validator_public_key(block.epoch(), block.proposed_by()) @@ -218,3 +220,46 @@ pub async fn check_quorum_certificate( } Ok(()) } + +pub fn check_sidechain_id(candidate_block: &Block, config: &HotstuffConfig) -> Result<(), HotStuffError> { + // We only require the sidechain id on the genesis block + if !candidate_block.is_genesis() { + return Ok(()); + } + + // If we are using a sidechain id in the network, we need to check it matches the candidate block one + if let Some(expected_sidechain_id) = &config.sidechain_id { + // Extract the sidechain id from the candidate block + let extra_data = candidate_block.extra_data().ok_or::( + ProposalValidationError::MissingSidechainId { + block_id: *candidate_block.id(), + } + .into(), + )?; + let sidechain_id_bytes = extra_data.get(&ExtraFieldKey::SidechainId).ok_or::( + ProposalValidationError::InvalidSidechainId { + block_id: *candidate_block.id(), + reason: "SidechainId key not present".to_owned(), + } + .into(), + )?; + let sidechain_id = RistrettoPublicKey::from_canonical_bytes(sidechain_id_bytes).map_err(|e| { + ProposalValidationError::InvalidSidechainId { + block_id: *candidate_block.id(), + reason: e.to_string(), + } + })?; + + // The sidechain id must match the sidechain of the current network + if sidechain_id != *expected_sidechain_id { + return Err(ProposalValidationError::MismatchedSidechainId { + block_id: *candidate_block.id(), + expected_sidechain_id: expected_sidechain_id.clone(), + sidechain_id, + } + .into()); + } + } + + Ok(()) +} diff --git a/dan_layer/consensus/src/hotstuff/config.rs b/dan_layer/consensus/src/hotstuff/config.rs index b51e78d12..72c7d3691 100644 --- a/dan_layer/consensus/src/hotstuff/config.rs +++ b/dan_layer/consensus/src/hotstuff/config.rs @@ -4,6 +4,7 @@ use std::time::Duration; use tari_common::configuration::Network; +use tari_crypto::ristretto::RistrettoPublicKey; use tari_dan_common_types::NumPreshards; #[derive(Debug, Clone)] @@ -13,4 +14,5 @@ pub struct HotstuffConfig { pub max_base_layer_blocks_behind: u64, pub num_preshards: NumPreshards, pub pacemaker_max_base_time: Duration, + pub sidechain_id: Option, } diff --git a/dan_layer/consensus/src/hotstuff/error.rs b/dan_layer/consensus/src/hotstuff/error.rs index 717f0ddd9..2daa7b677 100644 --- a/dan_layer/consensus/src/hotstuff/error.rs +++ b/dan_layer/consensus/src/hotstuff/error.rs @@ -2,9 +2,10 @@ // SPDX-License-Identifier: BSD-3-Clause use tari_common_types::types::FixedHash; +use tari_crypto::ristretto::RistrettoPublicKey; use tari_dan_common_types::{Epoch, NodeHeight, VersionedSubstateIdError}; use tari_dan_storage::{ - consensus_models::{BlockId, LeafBlock, LockedBlock, QuorumCertificate, TransactionPoolError}, + consensus_models::{BlockError, BlockId, LeafBlock, LockedBlock, QuorumCertificate, TransactionPoolError}, StorageError, }; use tari_epoch_manager::EpochManagerError; @@ -103,6 +104,8 @@ pub enum HotStuffError { foreign_block_id: BlockId, transaction_id: TransactionId, }, + #[error("Block building error: {0}")] + BlockBuildingError(#[from] BlockError), } impl From for HotStuffError { @@ -235,4 +238,17 @@ pub enum ProposalValidationError { node" )] NoTransactionsInCommittee { block_id: BlockId }, + #[error("Foreign node submitted an foreign proposal {block_id} that did not contain a sidechain ID")] + MissingSidechainId { block_id: BlockId }, + #[error("Foreign node submitted an foreign proposal {block_id} with an invalid sidechain ID: {reason}")] + InvalidSidechainId { block_id: BlockId, reason: String }, + #[error( + "Foreign node submitted an foreign proposal {block_id} with a mistmatched sidechain ID: expected \ + {expected_sidechain_id} but got {sidechain_id}" + )] + MismatchedSidechainId { + block_id: BlockId, + expected_sidechain_id: RistrettoPublicKey, + sidechain_id: RistrettoPublicKey, + }, } diff --git a/dan_layer/consensus/src/hotstuff/on_propose.rs b/dan_layer/consensus/src/hotstuff/on_propose.rs index 0bd6e32c9..81b581160 100644 --- a/dan_layer/consensus/src/hotstuff/on_propose.rs +++ b/dan_layer/consensus/src/hotstuff/on_propose.rs @@ -587,6 +587,7 @@ where TConsensusSpec: ConsensusSpec EpochTime::now().as_u64(), base_layer_block_height, base_layer_block_hash, + None, ); let signature = self.signing_service.sign(next_block.id()); diff --git a/dan_layer/consensus/src/hotstuff/on_receive_local_proposal.rs b/dan_layer/consensus/src/hotstuff/on_receive_local_proposal.rs index d3c6e4159..91edbd4a9 100644 --- a/dan_layer/consensus/src/hotstuff/on_receive_local_proposal.rs +++ b/dan_layer/consensus/src/hotstuff/on_receive_local_proposal.rs @@ -256,7 +256,12 @@ impl OnReceiveLocalProposalHandler HotstuffWorker { fn create_zero_block_if_required(&self, epoch: Epoch, shard_group: ShardGroup) -> Result<(), HotStuffError> { self.state_store.with_write_tx(|tx| { // The parent for genesis blocks refer to this zero block - let mut zero_block = Block::zero_block(self.config.network, self.config.num_preshards); + let mut zero_block = Block::zero_block( + self.config.network, + self.config.num_preshards, + self.config.sidechain_id.clone(), + )?; if !zero_block.exists(&**tx)? { debug!(target: LOG_TARGET, "Creating zero block"); zero_block.justify().insert(tx)?; @@ -746,7 +750,12 @@ impl HotstuffWorker { zero_block.commit_diff(tx, BlockDiff::empty(*zero_block.id()))?; } - let mut genesis = Block::genesis(self.config.network, epoch, shard_group); + let mut genesis = Block::genesis( + self.config.network, + epoch, + shard_group, + self.config.sidechain_id.clone(), + )?; if !genesis.exists(&**tx)? { info!(target: LOG_TARGET, "✨Creating genesis block {genesis}"); genesis.justify().insert(tx)?; diff --git a/dan_layer/consensus_tests/src/support/validator/builder.rs b/dan_layer/consensus_tests/src/support/validator/builder.rs index 866580c39..696c50827 100644 --- a/dan_layer/consensus_tests/src/support/validator/builder.rs +++ b/dan_layer/consensus_tests/src/support/validator/builder.rs @@ -132,6 +132,7 @@ impl ValidatorBuilder { max_base_layer_blocks_behind: 5, network: Network::LocalNet, pacemaker_max_base_time: Duration::from_secs(10), + sidechain_id: None, }, self.address.clone(), inbound_messaging, diff --git a/dan_layer/p2p/proto/consensus.proto b/dan_layer/p2p/proto/consensus.proto index e60fd6021..e533c2adb 100644 --- a/dan_layer/p2p/proto/consensus.proto +++ b/dan_layer/p2p/proto/consensus.proto @@ -98,6 +98,11 @@ message Block { uint64 base_layer_block_height = 14; bytes base_layer_block_hash = 15; bool is_dummy = 16; + ExtraData extra_data = 17; +} + +message ExtraData { + bytes encoded_extra_data = 1; } message LeaderFee { diff --git a/dan_layer/p2p/src/conversions/consensus.rs b/dan_layer/p2p/src/conversions/consensus.rs index 13bf6e541..99237365f 100644 --- a/dan_layer/p2p/src/conversions/consensus.rs +++ b/dan_layer/p2p/src/conversions/consensus.rs @@ -41,6 +41,7 @@ use tari_crypto::tari_utilities::ByteArray; use tari_dan_common_types::{ shard::Shard, Epoch, + ExtraData, NodeHeight, ShardGroup, SubstateLockType, @@ -461,6 +462,7 @@ impl From<&tari_dan_storage::consensus_models::Block> for proto::consensus::Bloc base_layer_block_height: value.base_layer_block_height(), base_layer_block_hash: value.base_layer_block_hash().as_bytes().to_vec(), is_dummy: value.is_dummy(), + extra_data: value.extra_data().map(Into::into), } } } @@ -483,6 +485,8 @@ impl TryFrom for tari_dan_storage::consensus_models::Bl .ok_or_else(|| anyhow!("Block conversion: QC not provided"))? .try_into()?; + let extra_data = value.extra_data.map(TryInto::try_into).transpose()?; + if value.is_dummy { Ok(Self::dummy_block( network, @@ -518,11 +522,30 @@ impl TryFrom for tari_dan_storage::consensus_models::Bl value.timestamp, value.base_layer_block_height, value.base_layer_block_hash.try_into()?, + extra_data, )) } } } +//---------------------------------- Evidence --------------------------------------------// + +impl From<&ExtraData> for proto::consensus::ExtraData { + fn from(value: &ExtraData) -> Self { + Self { + encoded_extra_data: encode(value).unwrap(), + } + } +} + +impl TryFrom for ExtraData { + type Error = anyhow::Error; + + fn try_from(value: proto::consensus::ExtraData) -> Result { + Ok(decode_exact(&value.encoded_extra_data)?) + } +} + //---------------------------------- Command --------------------------------------------// impl From<&Command> for proto::consensus::Command { diff --git a/dan_layer/state_store_sqlite/migrations/2023-06-08-091819_create_state_store/up.sql b/dan_layer/state_store_sqlite/migrations/2023-06-08-091819_create_state_store/up.sql index d905ef783..c03eafb83 100644 --- a/dan_layer/state_store_sqlite/migrations/2023-06-08-091819_create_state_store/up.sql +++ b/dan_layer/state_store_sqlite/migrations/2023-06-08-091819_create_state_store/up.sql @@ -35,6 +35,7 @@ create table blocks timestamp bigint not NULL, base_layer_block_height bigint not NULL, base_layer_block_hash text not NULL, + extra_data text NULL, created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (qc_id) REFERENCES quorum_certificates (qc_id) ); @@ -63,6 +64,7 @@ create table parked_blocks base_layer_block_height bigint not NULL, base_layer_block_hash text not NULL, foreign_proposals text not NULL, + extra_data text NULL, created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ); @@ -377,6 +379,7 @@ CREATE TABLE foreign_proposals proposed_in_block text NULL REFERENCES blocks (block_id), proposed_in_block_height bigint NULL, status text not NULL, + extra_data text NULL, created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (block_id) ); diff --git a/dan_layer/state_store_sqlite/src/schema.rs b/dan_layer/state_store_sqlite/src/schema.rs index d800e9eaf..41c94f6b0 100644 --- a/dan_layer/state_store_sqlite/src/schema.rs +++ b/dan_layer/state_store_sqlite/src/schema.rs @@ -38,6 +38,7 @@ diesel::table! { timestamp -> BigInt, base_layer_block_height -> BigInt, base_layer_block_hash -> Text, + extra_data -> Nullable, created_at -> Timestamp, } } @@ -110,6 +111,7 @@ diesel::table! { proposed_in_block -> Nullable, proposed_in_block_height -> Nullable, status -> Text, + extra_data -> Nullable, created_at -> Timestamp, } } @@ -250,6 +252,7 @@ diesel::table! { base_layer_block_height -> BigInt, base_layer_block_hash -> Text, foreign_proposals -> Text, + extra_data -> Nullable, created_at -> Timestamp, } } diff --git a/dan_layer/state_store_sqlite/src/sql_models/block.rs b/dan_layer/state_store_sqlite/src/sql_models/block.rs index 346750565..d03394ae4 100644 --- a/dan_layer/state_store_sqlite/src/sql_models/block.rs +++ b/dan_layer/state_store_sqlite/src/sql_models/block.rs @@ -38,6 +38,7 @@ pub struct Block { pub timestamp: i64, pub base_layer_block_height: i64, pub base_layer_block_hash: String, + pub extra_data: Option, pub created_at: PrimitiveDateTime, } @@ -81,6 +82,7 @@ impl Block { self.timestamp as u64, self.base_layer_block_height as u64, deserialize_hex_try_from(&self.base_layer_block_hash)?, + self.extra_data.map(|val| deserialize_json(&val)).transpose()?, )) } } @@ -106,6 +108,7 @@ pub struct ParkedBlock { pub base_layer_block_height: i64, pub base_layer_block_hash: String, pub foreign_proposals: String, + pub extra_data: Option, pub created_at: PrimitiveDateTime, } @@ -151,6 +154,7 @@ impl TryFrom for (consensus_models::Block, Vec, pub proposed_in_block_height: Option, pub status: String, + pub extra_data: Option, pub created_at: PrimitiveDateTime, } @@ -84,6 +85,7 @@ impl ForeignProposal { self.timestamp as u64, self.base_layer_block_height as u64, deserialize_hex_try_from(&self.base_layer_block_hash)?, + self.extra_data.map(|val| deserialize_json(&val)).transpose()?, ); let status = consensus_models::ForeignProposalStatus::from_str(&self.status)?; diff --git a/dan_layer/state_store_sqlite/src/writer.rs b/dan_layer/state_store_sqlite/src/writer.rs index d8b0d6604..77195f19e 100644 --- a/dan_layer/state_store_sqlite/src/writer.rs +++ b/dan_layer/state_store_sqlite/src/writer.rs @@ -186,6 +186,7 @@ impl<'a, TAddr: NodeAddressable> SqliteStateStoreWriteTransaction<'a, TAddr> { parked_blocks::base_layer_block_height.eq(block.base_layer_block_height() as i64), parked_blocks::base_layer_block_hash.eq(serialize_hex(block.base_layer_block_hash())), parked_blocks::foreign_proposals.eq(serialize_json(foreign_proposals)?), + parked_blocks::extra_data.eq(block.extra_data().map(serialize_json).transpose()?), ); diesel::insert_into(parked_blocks::table) @@ -238,6 +239,7 @@ impl<'tx, TAddr: NodeAddressable + 'tx> StateStoreWriteTransaction for SqliteSta blocks::timestamp.eq(block.timestamp() as i64), blocks::base_layer_block_height.eq(block.base_layer_block_height() as i64), blocks::base_layer_block_hash.eq(serialize_hex(block.base_layer_block_hash())), + blocks::extra_data.eq(block.extra_data().map(serialize_json).transpose()?), ); diesel::insert_into(blocks::table) @@ -570,6 +572,7 @@ impl<'tx, TAddr: NodeAddressable + 'tx> StateStoreWriteTransaction for SqliteSta foreign_proposals::justify_qc_id.eq(serialize_hex(foreign_proposal.justify_qc().id())), foreign_proposals::block_pledge.eq(serialize_json(foreign_proposal.block_pledge())?), foreign_proposals::status.eq(ForeignProposalStatus::New.to_string()), + foreign_proposals::extra_data.eq(foreign_proposal.block().extra_data().map(serialize_json).transpose()?), ); diesel::insert_into(foreign_proposals::table) diff --git a/dan_layer/state_store_sqlite/tests/tests.rs b/dan_layer/state_store_sqlite/tests/tests.rs index 93ea0dda3..7663f195b 100644 --- a/dan_layer/state_store_sqlite/tests/tests.rs +++ b/dan_layer/state_store_sqlite/tests/tests.rs @@ -47,7 +47,7 @@ mod confirm_all_transitions { let atom3 = create_tx_atom(); let network = Default::default(); - let zero_block = Block::zero_block(network, NumPreshards::P64); + let zero_block = Block::zero_block(network, NumPreshards::P64, None).unwrap(); zero_block.insert(&mut tx).unwrap(); let block1 = Block::new( network, @@ -67,6 +67,7 @@ mod confirm_all_transitions { EpochTime::now().as_u64(), 0, FixedHash::zero(), + None, ); block1.insert(&mut tx).unwrap(); diff --git a/dan_layer/storage/src/consensus_models/block.rs b/dan_layer/storage/src/consensus_models/block.rs index 19dd95e31..f90de5e3c 100644 --- a/dan_layer/storage/src/consensus_models/block.rs +++ b/dan_layer/storage/src/consensus_models/block.rs @@ -13,7 +13,7 @@ use log::*; use serde::{Deserialize, Serialize}; use tari_common::configuration::Network; use tari_common_types::types::{FixedHash, FixedHashSizeError, PublicKey}; -use tari_crypto::tari_utilities::epoch_time::EpochTime; +use tari_crypto::{ristretto::RistrettoPublicKey, tari_utilities::epoch_time::EpochTime}; use tari_dan_common_types::{ committee::CommitteeInfo, hashing, @@ -21,6 +21,8 @@ use tari_dan_common_types::{ serde_with, shard::Shard, Epoch, + ExtraData, + MaxSizeBytesError, NodeAddressable, NodeHeight, NumPreshards, @@ -67,6 +69,12 @@ use crate::{ const LOG_TARGET: &str = "tari::dan::storage::consensus_models::block"; +#[derive(Debug, thiserror::Error)] +pub enum BlockError { + #[error("Extra data size error: {0}")] + ExtraDataSizeError(#[from] MaxSizeBytesError), +} + #[derive(Debug, Clone, Serialize, Deserialize)] #[cfg_attr(feature = "ts", derive(TS), ts(export, export_to = "../../bindings/src/types/"))] pub struct Block { @@ -113,6 +121,7 @@ pub struct Block { base_layer_block_height: u64, #[cfg_attr(feature = "ts", ts(type = "string"))] base_layer_block_hash: FixedHash, + extra_data: Option, } impl Block { @@ -133,6 +142,7 @@ impl Block { timestamp: u64, base_layer_block_height: u64, base_layer_block_hash: FixedHash, + extra_data: Option, ) -> Self { let mut block = Self { id: BlockId::zero(), @@ -156,6 +166,7 @@ impl Block { timestamp, base_layer_block_height, base_layer_block_hash, + extra_data, }; block.id = block.calculate_hash().into(); block @@ -184,6 +195,7 @@ impl Block { timestamp: u64, base_layer_block_height: u64, base_layer_block_hash: FixedHash, + extra_data: Option, ) -> Self { Self { id, @@ -207,11 +219,17 @@ impl Block { timestamp, base_layer_block_height, base_layer_block_hash, + extra_data, } } - pub fn genesis(network: Network, epoch: Epoch, shard_group: ShardGroup) -> Self { - Self::new( + pub fn genesis( + network: Network, + epoch: Epoch, + shard_group: ShardGroup, + sidechain_id: Option, + ) -> Result { + Ok(Self::new( network, BlockId::zero(), QuorumCertificate::genesis(epoch, shard_group), @@ -228,12 +246,17 @@ impl Block { 0, 0, FixedHash::zero(), - ) + Self::extra_data_from_sidechain_id(sidechain_id)?, + )) } /// This is the parent block for all genesis blocks. Its block ID is always zero. - pub fn zero_block(network: Network, num_preshards: NumPreshards) -> Self { - Self { + pub fn zero_block( + network: Network, + num_preshards: NumPreshards, + sidechain_id: Option, + ) -> Result { + Ok(Self { network, id: BlockId::zero(), parent: BlockId::zero(), @@ -255,7 +278,8 @@ impl Block { timestamp: EpochTime::now().as_u64(), base_layer_block_height: 0, base_layer_block_hash: FixedHash::zero(), - } + extra_data: Self::extra_data_from_sidechain_id(sidechain_id)?, + }) } pub fn dummy_block( @@ -293,12 +317,20 @@ impl Block { timestamp: parent_timestamp, base_layer_block_height: parent_base_layer_block_height, base_layer_block_hash: parent_base_layer_block_hash, + extra_data: None, }; block.id = block.calculate_hash().into(); block.is_justified = false; block } + fn extra_data_from_sidechain_id(sidechain_id: Option) -> Result, BlockError> { + let extra_data = sidechain_id + .map(|id| ExtraData::new().insert_sidechain_id(id).cloned()) + .transpose()?; + Ok(extra_data) + } + pub fn calculate_hash(&self) -> FixedHash { // Hash is created from the hash of the "body" and // then hashed with the parent, so that you can @@ -329,6 +361,7 @@ impl Block { .chain(&self.timestamp) .chain(&self.base_layer_block_height) .chain(&self.base_layer_block_hash) + .chain(&self.extra_data) .result(); hashing::block_hasher().chain(&self.parent).chain(&inner_hash).result() @@ -538,6 +571,10 @@ impl Block { pub fn base_layer_block_hash(&self) -> &FixedHash { &self.base_layer_block_hash } + + pub fn extra_data(&self) -> Option<&ExtraData> { + self.extra_data.as_ref() + } } impl Block { diff --git a/dan_layer/storage/src/error.rs b/dan_layer/storage/src/error.rs index 4e50058bd..fb9fc003f 100644 --- a/dan_layer/storage/src/error.rs +++ b/dan_layer/storage/src/error.rs @@ -23,6 +23,8 @@ use tari_common_types::types::FixedHashSizeError; use tari_dan_common_types::optional::IsNotFoundError; +use crate::consensus_models::BlockError; + #[derive(Debug, thiserror::Error)] pub enum StorageError { #[error("Could not connect to storage:{reason}")] @@ -60,6 +62,8 @@ pub enum StorageError { DataInconsistency { details: String }, #[error("General storage error: {details}")] General { details: String }, + #[error("Block creation error: {0}")] + BlockError(#[from] BlockError), } impl IsNotFoundError for StorageError {