Skip to content

Commit

Permalink
Merge branch 'development' into switch_when_node_offline
Browse files Browse the repository at this point in the history
  • Loading branch information
aviator-app[bot] authored Dec 9, 2021
2 parents c9f9f04 + e4bace6 commit 670df46
Show file tree
Hide file tree
Showing 713 changed files with 6,311 additions and 3,438 deletions.
48 changes: 24 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions applications/tari_app_grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ authors = ["The Tari Development Community"]
description = "This crate is to provide a single source for all cross application grpc files and conversions to and from tari::core"
repository = "https://github.com/tari-project/tari"
license = "BSD-3-Clause"
version = "0.21.2"
version = "0.22.0"
edition = "2018"

[dependencies]
tari_common_types = { version = "^0.21", path = "../../base_layer/common_types"}
tari_common_types = { version = "^0.22", path = "../../base_layer/common_types"}
tari_core = { path = "../../base_layer/core"}
tari_crypto = { git = "https://github.com/tari-project/tari-crypto.git", branch = "main" }
tari_comms = { path = "../../comms"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

use std::convert::TryFrom;

use tari_core::{tari_utilities::convert::try_convert_all, transactions::aggregated_body::AggregateBody};

use crate::tari_rpc as grpc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
// 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 crate::tari_rpc as grpc;
use tari_core::base_node::state_machine_service::states::{StateInfo, StateInfo::*};

use crate::tari_rpc as grpc;

impl From<StateInfo> for grpc::BaseNodeState {
fn from(info: StateInfo) -> Self {
match info {
Expand Down
4 changes: 3 additions & 1 deletion applications/tari_app_grpc/src/conversions/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
// 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 crate::tari_rpc as grpc;
use std::convert::{TryFrom, TryInto};

use tari_core::blocks::Block;

use crate::tari_rpc as grpc;

impl From<tari_core::blocks::Block> for grpc::Block {
fn from(block: Block) -> Self {
Self {
Expand Down
10 changes: 6 additions & 4 deletions applications/tari_app_grpc/src/conversions/block_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@
// 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 crate::{
conversions::{datetime_to_timestamp, timestamp_to_datetime},
tari_rpc as grpc,
};
use std::convert::TryFrom;

use tari_common_types::types::BlindingFactor;
use tari_core::{blocks::BlockHeader, proof_of_work::ProofOfWork};
use tari_crypto::tari_utilities::{ByteArray, Hashable};

use crate::{
conversions::{datetime_to_timestamp, timestamp_to_datetime},
tari_rpc as grpc,
};

impl From<BlockHeader> for grpc::BlockHeader {
fn from(h: BlockHeader) -> Self {
let pow_algo = h.pow_algo();
Expand Down
3 changes: 2 additions & 1 deletion applications/tari_app_grpc/src/conversions/chain_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
// 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 crate::tari_rpc as grpc;
use tari_common_types::chain_metadata::ChainMetadata;

use crate::tari_rpc as grpc;

impl From<ChainMetadata> for grpc::MetaData {
fn from(meta: ChainMetadata) -> Self {
let diff = meta.accumulated_difficulty();
Expand Down
3 changes: 2 additions & 1 deletion applications/tari_app_grpc/src/conversions/com_signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

use std::convert::TryFrom;

use tari_common_types::types::{ComSignature, Commitment, PrivateKey};
use tari_core::crypto::tari_utilities::ByteArray;

use crate::tari_rpc as grpc;
use tari_common_types::types::{ComSignature, Commitment, PrivateKey};

impl TryFrom<grpc::ComSignature> for ComSignature {
type Error = String;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
// 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 crate::tari_rpc as grpc;
use std::convert::TryFrom;

use tari_core::{consensus::ConsensusConstants, proof_of_work::PowAlgorithm};

use crate::tari_rpc as grpc;

impl From<ConsensusConstants> for grpc::ConsensusConstants {
fn from(cc: ConsensusConstants) -> Self {
let (emission_initial, emission_decay, emission_tail) = cc.emission_amounts();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
// 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 crate::tari_rpc as grpc;
use std::convert::TryFrom;

use tari_core::{blocks::HistoricalBlock, chain_storage::ChainStorageError};

use crate::tari_rpc as grpc;

impl TryFrom<HistoricalBlock> for grpc::HistoricalBlock {
type Error = ChainStorageError;

Expand Down
6 changes: 3 additions & 3 deletions applications/tari_app_grpc/src/conversions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ mod transaction_kernel;
mod transaction_output;
mod unblinded_output;

use prost_types::Timestamp;
use tari_core::crypto::tari_utilities::epoch_time::EpochTime;

pub use self::{
aggregate_body::*,
base_node_state::*,
Expand All @@ -58,10 +61,7 @@ pub use self::{
transaction_kernel::*,
transaction_output::*,
};

use crate::{tari_rpc as grpc, tari_rpc::BlockGroupRequest};
use prost_types::Timestamp;
use tari_core::crypto::tari_utilities::epoch_time::EpochTime;

/// Utility function that converts a `EpochTime` to a `prost::Timestamp`
pub fn datetime_to_timestamp(datetime: EpochTime) -> Timestamp {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@
// 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 crate::tari_rpc as grpc;
use std::convert::{TryFrom, TryInto};

use tari_common_types::types::BlindingFactor;
use tari_core::{
blocks::{NewBlockHeaderTemplate, NewBlockTemplate},
crypto::tari_utilities::ByteArray,
proof_of_work::ProofOfWork,
};

use crate::tari_rpc as grpc;

impl From<NewBlockTemplate> for grpc::NewBlockTemplate {
fn from(block: NewBlockTemplate) -> Self {
let header = grpc::NewBlockHeaderTemplate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

use std::convert::TryFrom;

use tari_core::transactions::transaction_entities::{OutputFeatures, OutputFlags};
use tari_core::transactions::transaction::{OutputFeatures, OutputFlags};

use crate::tari_rpc as grpc;

Expand Down
Loading

0 comments on commit 670df46

Please sign in to comment.