Skip to content

Commit

Permalink
Change type of max_gas to i64, and remove two clones. (#61)
Browse files Browse the repository at this point in the history
* max_gas should be i64, can be -1

* remove unneed clones
  • Loading branch information
yihuang authored and liamsi committed Dec 11, 2019
1 parent 9415981 commit 0b9450d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tendermint/src/abci/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl Transaction {

/// Convert this transaction into a byte vector
pub fn into_vec(self) -> Vec<u8> {
self.0.clone()
self.0
}

/// Borrow the contents of this transaction as a byte slice
Expand Down Expand Up @@ -79,7 +79,7 @@ impl Data {

/// Convert this collection into a vector
pub fn into_vec(self) -> Vec<Transaction> {
self.iter().cloned().collect()
self.txs.unwrap_or_default()
}

/// Iterate over the transactions in the collection
Expand Down
6 changes: 3 additions & 3 deletions tendermint/src/block/size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ pub struct Size {

/// Maximum amount of gas which can be spent on a block
#[serde(
serialize_with = "serializers::serialize_u64",
deserialize_with = "serializers::parse_u64"
serialize_with = "serializers::serialize_i64",
deserialize_with = "serializers::parse_i64"
)]
pub max_gas: u64,
pub max_gas: i64,

/// Time iota in ms
#[serde(
Expand Down

0 comments on commit 0b9450d

Please sign in to comment.