Update to parity-scale-codec (#3232)

* WIP: update codec

* WIP

* compiling

* WIP

* rename parity-scale-codec to codec

* WIP

* fix

* remove old comments

* use published crates

* fix expected error msg

* bump version

* fmt and fix

* remove old comment

* fix wrong decoding impl

* implement encode like for structures

* undo removal of old pending changes

* trailingzeroinput

* Apply suggestions from code review

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
Co-Authored-By: DemiMarie-parity <48690212+DemiMarie-parity@users.noreply.github.com>

* update codec

* fmt

* version is 1.0.0

* show more error

* fmt
This commit is contained in:
thiolliere
2019-08-06 19:36:23 +02:00
committed by Bastian Köcher
parent a0d442333f
commit 4ed67e03a4
211 changed files with 867 additions and 682 deletions
+4 -4
View File
@@ -25,7 +25,7 @@ use rstd::collections::btree_set::BTreeSet;
use srml_support::{decl_module, decl_storage, for_each_tuple, StorageValue};
use srml_support::traits::{FindAuthor, VerifySeal, Get};
use srml_support::dispatch::Result as DispatchResult;
use parity_codec::{Encode, Decode};
use codec::{Encode, Decode};
use system::ensure_none;
use sr_primitives::traits::{SimpleArithmetic, Header as HeaderT, One, Zero};
use sr_primitives::weights::SimpleDispatchInfo;
@@ -382,7 +382,7 @@ mod tests {
{
for (id, data) in digests {
if id == TEST_ID {
return u64::decode(&mut &data[..]);
return u64::decode(&mut &data[..]).ok();
}
}
@@ -409,8 +409,8 @@ mod tests {
for (id, seal) in seals {
if id == TEST_ID {
match u64::decode(&mut &seal[..]) {
None => return Err("wrong seal"),
Some(a) => {
Err(_) => return Err("wrong seal"),
Ok(a) => {
if a != author {
return Err("wrong author in seal");
}