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

Commit

Permalink
Update crypto-com-chain branch (#1)
Browse files Browse the repository at this point in the history
* build(deps): update tai64 requirement from 2 to 3 (informalsystems#22)

Updates the requirements on [tai64](https://github.com/iqlusioninc/crates) to permit the latest version.
- [Release notes](https://github.com/iqlusioninc/crates/releases)
- [Commits](iqlusioninc/crates@canonical-path/v2.0.0...tai64/3.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* max_gas should be i64, can be -1

* remove unneed clones

* remove secret_connection

* implement utility traits for tendermint data types
  • Loading branch information
yihuang authored and tomtau committed Nov 12, 2019
1 parent 9582303 commit 79ce68f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 47 deletions.
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.

0 comments on commit 79ce68f

Please sign in to comment.