Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

Update crypto-com-chain branch #1

Merged
merged 8 commits into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions tendermint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@ authors = [
circle-ci = { repository = "interchainio/tendermint-rs" }

[dependencies]
byteorder = { version = "1.2" }
bytes = "0.4"
chrono = { version = "0.4", features = ["serde"] }
digest = "0.8"
failure = "0.1"
hkdf = { version = "0.7" }
hyper = { version = "0.10" }
prost-amino = { version = "0.4.0" }
prost-amino-derive = { version = "0.4.0" }
Expand All @@ -48,7 +45,6 @@ subtle-encoding = { version = "0.3", features = ["bech32-preview"] }
tai64 = { version = "3", features = ["chrono"] }
toml = { version = "0.5" }
uuid = { version = "0.7", default-features = false }
x25519-dalek = { version = "0.5", default-features = false, features = ["u64_backend"] }
zeroize = { version = "0.9" }

[dev-dependencies]
Expand Down
5 changes: 4 additions & 1 deletion tendermint/src/abci/transaction/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use crate::error::{Error, ErrorKind};
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
use sha2::{Digest, Sha256};
use std::{
fmt::{self, Debug, Display},
str::FromStr,
Expand Down Expand Up @@ -30,7 +31,9 @@ impl Hash {

impl Default for Hash {
fn default() -> Hash {
Hash([0; LENGTH])
// hash of empty data
let mut bytes = [0u8; LENGTH];
bytes.copy_from_slice(&Sha256::digest(&[])[..LENGTH]);
}
}

Expand Down
5 changes: 5 additions & 0 deletions tendermint/src/node/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ pub struct ProtocolVersionInfo {
pub struct ListenAddress(String);

impl ListenAddress {
/// Construct `ListenAddress`
pub fn new(s: String) -> ListenAddress {
ListenAddress(s)
}

/// Convert `ListenAddress` to a `net::Address`
pub fn to_net_address(&self) -> Option<net::Address> {
// TODO(tarcieri): validate these and handle them better at parse time
Expand Down
2 changes: 1 addition & 1 deletion tendermint/src/rpc/endpoint/broadcast/tx_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl rpc::Request for Request {
}

/// Response from either an async or sync transaction broadcast request.
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize, Default)]
pub struct Response {
/// Code
pub code: Code,
Expand Down
4 changes: 2 additions & 2 deletions tendermint/src/rpc/endpoint/broadcast/tx_commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl rpc::Request for Request {
}

/// Response from `/broadcast_tx_commit`.
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize, Default)]
pub struct Response {
/// `CheckTx` result
pub check_tx: TxResult,
Expand All @@ -52,7 +52,7 @@ pub struct Response {
impl rpc::Response for Response {}

/// Results from either `CheckTx` or `DeliverTx`.
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize, Default)]
pub struct TxResult {
/// Code
pub code: Code,
Expand Down
39 changes: 0 additions & 39 deletions tendermint/tests/secret_connection.rs

This file was deleted.