Backports to beta (#1919)
* RPC errors & logs (#1845) * Refactoring errors in RPC * Updating jsonrpc-core * Fixing code_at * Avoid mentioning obvious segments in proof [ci:skip] * fixed cache_manager lock order * Purging .derefs, fixing clippy warnings. (#1890) * Fixing clippy warnings * Purging derefs * Simplifying engine derefs * Simplifying more engine derefs * Adding more details to miner log * fixed #1889, .DS_Store is no longer treated as key file (#1892) * fixed #1889, .DS_Store is no longer treated as key file * ethstore filters directories, hidden files and common system files * fixed compiling * fix regression with geth dir * fix regression with geth dir * Fix ipc compilation and add ipc feature to test targets (#1902) * fix compilation and add it to the ci run * no separator? * use quotes and spaces * RocksDB version bump * Don't return deleted nodes that are not yet flushed (#1908) * polling & connection timeouts (#1910) * Peers RPC + UI displaying active/connected/max peers (#1915) * Peers API * Bumping Parity-UI * Fixing tests * Save nodes removed from backing_overlay until commit (#1917)
This commit is contained in:
@@ -14,8 +14,6 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::ops::Deref;
|
||||
use std::default::Default;
|
||||
use elastic_array::*;
|
||||
use rlp::bytes::{ToBytes, VecLike};
|
||||
use rlp::{Stream, Encoder, Encodable};
|
||||
@@ -293,7 +291,7 @@ impl<'a> Encodable for &'a[u8] {
|
||||
|
||||
impl Encodable for Vec<u8> {
|
||||
fn rlp_append(&self, s: &mut RlpStream) {
|
||||
s.append_value(&U8Slice(self.deref()))
|
||||
s.append_value(&U8Slice(self))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,7 +332,7 @@ impl<'a, T> Encodable for &'a[T] where T: Encodable {
|
||||
|
||||
impl<T> Encodable for Vec<T> where T: Encodable {
|
||||
fn rlp_append(&self, s: &mut RlpStream) {
|
||||
Encodable::rlp_append(&self.deref(), s);
|
||||
Encodable::rlp_append(&self.as_slice(), s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Common RLP traits
|
||||
use std::ops::Deref;
|
||||
use rlp::bytes::VecLike;
|
||||
use rlp::{DecoderError, UntrustedRlp};
|
||||
use rlp::rlpstream::RlpStream;
|
||||
@@ -244,7 +243,7 @@ pub trait ByteEncodable {
|
||||
fn bytes_len(&self) -> usize;
|
||||
}
|
||||
|
||||
/// Structure encodable to RLP. Implement this trait for
|
||||
/// Structure encodable to RLP. Implement this trait for
|
||||
pub trait Encodable {
|
||||
/// Append a value to the stream
|
||||
fn rlp_append(&self, s: &mut RlpStream);
|
||||
@@ -257,7 +256,7 @@ pub trait Encodable {
|
||||
}
|
||||
|
||||
/// Get the hash or RLP encoded representation
|
||||
fn rlp_sha3(&self) -> H256 { self.rlp_bytes().deref().sha3() }
|
||||
fn rlp_sha3(&self) -> H256 { (&*self.rlp_bytes()).sha3() }
|
||||
}
|
||||
|
||||
/// Encodable wrapper trait required to handle special case of encoding a &[u8] as string and not as list
|
||||
|
||||
Reference in New Issue
Block a user